Commit 34cff057 authored by Leonidas Poulopoulos's avatar Leonidas Poulopoulos
Browse files

This commit closes 1755 , closes 1754

parent 33281310
......@@ -26,12 +26,20 @@ class RouteForm(forms.ModelForm):
def clean_source(self):
data = self.cleaned_data['source']
private_error = False
if data:
try:
address = IPNetwork(data)
return self.cleaned_data["source"]
if address.is_private:
private_error = True
raise forms.ValidationError('Private addresses not allowed')
else:
return self.cleaned_data["source"]
except Exception:
raise forms.ValidationError('Invalid network address format')
error_text = 'Invalid network address format'
if private_error:
error_text = 'Private addresses not allowed'
raise forms.ValidationError(error_text)
def clean_destination(self):
data = self.cleaned_data['destination']
......
......@@ -7,6 +7,7 @@ from django.views.decorators.csrf import csrf_exempt
from django.core import urlresolvers
from django.core import serializers
from django.contrib.auth.decorators import login_required
from django.contrib.auth import logout
from django.http import HttpResponseRedirect, HttpResponseForbidden, HttpResponse
from django.shortcuts import get_object_or_404, render_to_response
from django.core.context_processors import request
......@@ -263,7 +264,8 @@ def add_port(request):
@login_required
@never_cache
def user_logout(request):
return HttpResponseRedirect(settings.SHIB_LOGOUT_URL)
logout(request)
return HttpResponseRedirect(reverse('group-routes'))
@never_cache
def load_jscript(request, file):
......
......@@ -99,12 +99,10 @@
</div>
<div id="footer">
{% comment %}
{% if user.is_authenticated %}
{% trans "If you have any questions or need help, contact GRNET Helpdesk at <a href='mailto:helpdesk@grnet.gr'>helpdesk@grnet.gr</a> or 800-11-47638." %}<br />
{% endif %}
<a href="http://www.grnet.gr">{% trans "GRNET" %} NOC</a> | <a href="/about/info/">{% trans "Info" %}</a> | <a href="/about/terms-of-service">{% trans "Service Terms" %}</a>
{% endcomment %}
<a href="http://www.grnet.gr">{% trans "GRNET" %} NOC</a> | <a href="#">{% trans "Info" %}</a> | <a href="#">{% trans "Service Terms" %}</a>
</div>
</div>
</body>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment