8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-09 03:16:25 +00:00

Ouverture de port avec warning si ipv4

This commit is contained in:
Gabriel Detraz 2017-10-03 06:31:03 +02:00 committed by root
parent cb273c1493
commit 52fb4ea9f6
2 changed files with 1 additions and 4 deletions

View file

@ -96,13 +96,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<i class="glyphicon glyphicon-edit"></i> Gerer les alias <i class="glyphicon glyphicon-edit"></i> Gerer les alias
</a> </a>
</li> </li>
{% if interface.may_have_port_open %}
<li> <li>
<a href="{% url 'machines:port-config' interface.id%}"> <a href="{% url 'machines:port-config' interface.id%}">
<i class="glyphicon glyphicon-edit"></i> Gerer la configuration des ports <i class="glyphicon glyphicon-edit"></i> Gerer la configuration des ports
</a> </a>
</li> </li>
{% endif %}
<li> <li>
<a href="{% url 'machines:history' 'interface' interface.id %}"> <a href="{% url 'machines:history' 'interface' interface.id %}">
<i class="glyphicon glyphicon-time"></i> Historique <i class="glyphicon glyphicon-time"></i> Historique

View file

@ -1002,8 +1002,7 @@ def configure_ports(request, pk):
messages.error(request, u"Interface inexistante" ) messages.error(request, u"Interface inexistante" )
return redirect("/machines") return redirect("/machines")
if not interface_instance.may_have_port_open(): if not interface_instance.may_have_port_open():
messages.error(request, "L'ip de cette interface n'est pas publique ou non assignée") messages.error(request, "Attention, l'ipv4 n'est pas publique, l'ouverture n'aura pas d'effet en v4")
return redirect("/machines")
interface = EditOuverturePortConfigForm(request.POST or None, instance=interface_instance) interface = EditOuverturePortConfigForm(request.POST or None, instance=interface_instance)
if interface.is_valid(): if interface.is_valid():
interface.save() interface.save()