Commit 376f24ab authored by Gabriel Detraz's avatar Gabriel Detraz

Merge branch 'master' into switches

parents 0fb6b3b9 88642571
...@@ -85,6 +85,7 @@ server { ...@@ -85,6 +85,7 @@ server {
proxy_pass http://%(proxy_pass)s; proxy_pass http://%(proxy_pass)s;
proxy_set_header Host %(serveur)s; proxy_set_header Host %(serveur)s;
proxy_set_header P-Real-IP $remote_addr; proxy_set_header P-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
} }
} }
......
#!/bin/bash #!/bin/bash
LANG=fr_FR.UTF-8 sudo -u list /var/lib/mailman/bin/change_pw "$@" LANG=fr_FR.UTF-8 sudo /var/lib/mailman/bin/change_pw "$@"
#!/bin/bash #!/bin/bash
LANG=fr_FR.UTF-8 sudo -u list /var/lib/mailman/bin/find_member "$@" LANG=fr_FR.UTF-8 sudo /var/lib/mailman/bin/find_member "$@"
#!/bin/bash #!/bin/bash
LANG=fr_FR.UTF-8 sudo -u list /var/lib/mailman/bin/list_admins "$@" LANG=fr_FR.UTF-8 sudo /var/lib/mailman/bin/list_admins "$@"
#!/bin/bash #!/bin/bash
LANG=fr_FR.UTF-8 sudo -u list /var/lib/mailman/bin/list_lists "$@" LANG=fr_FR.UTF-8 sudo /var/lib/mailman/bin/list_lists "$@"
#!/bin/bash #!/bin/bash
LANG=fr_FR.UTF-8 sudo -u list /var/lib/mailman/bin/list_members "$@" LANG=fr_FR.UTF-8 sudo /var/lib/mailman/bin/list_members "$@"
#!/bin/bash #!/bin/bash
LANG=fr_FR.UTF-8 sudo -u list /var/lib/mailman/bin/list_requests "$@" LANG=fr_FR.UTF-8 sudo /var/lib/mailman/bin/list_requests "$@"
#!/bin/bash #!/bin/bash
LANG=fr_FR.UTF-8 sudo -u list /var/lib/mailman/bin/newlist "$@" LANG=fr_FR.UTF-8 sudo /var/lib/mailman/bin/newlist "$@"
...@@ -46,9 +46,9 @@ try_ff () { ...@@ -46,9 +46,9 @@ try_ff () {
if git status | grep -E "^(# )?Your branch is behind.*can be fast-forwarded.$" -q; then if git status | grep -E "^(# )?Your branch is behind.*can be fast-forwarded.$" -q; then
echo "Fast forward..." echo "Fast forward..."
if [ $hasmodules -eq 0 ]; then if [ $hasmodules -eq 0 ]; then
git pull --recurse-submodules origin master || exit 12 git pull --ff-only --recurse-submodules origin master || exit 12
else else
git pull || exit 12 git pull --ff-only || exit 12
fi fi
else else
echo "Nothing to fast forward" echo "Nothing to fast forward"
......
...@@ -52,7 +52,7 @@ class AnonymousAuth(BaseAuth): ...@@ -52,7 +52,7 @@ class AnonymousAuth(BaseAuth):
p = urlparse.urlparse(request.url) p = urlparse.urlparse(request.url)
# Prevent preference edition and quicklink when anonymous # Prevent preference edition and quicklink when anonymous
if action == "userprefs" or action == "quicklink": if action == "userprefs" or action == "quicklink":
url = urlparse.urlunparse(('https', p.netloc, p.path, "", "", "")) url = urlparse.urlunparse(('https', p.netloc, p.path, "", "", "")).encode('utf8')
request.http_redirect(url) request.http_redirect(url)
......
...@@ -38,21 +38,22 @@ class PyCAS(object): ...@@ -38,21 +38,22 @@ class PyCAS(object):
def login_url(self, service): def login_url(self, service):
"""Return the login URL for the given service.""" """Return the login URL for the given service."""
url = self.server_url + self.login_path + '?service=' + urllib.quote_plus(service) url = self.server_url + self.login_path + '?service=' + urllib.quote_plus(service.encode('utf8'))
if self.renew: if self.renew:
url += "&renew=true" url += "&renew=true"
return url return url.decode('utf8')
def logout_url(self, redirect_url=None): def logout_url(self, redirect_url=None):
"""Return the logout URL.""" """Return the logout URL."""
url = self.server_url + self.logout_path url = self.server_url + self.logout_path
if redirect_url: if redirect_url:
url += '?url=' + urllib.quote_plus(redirect_url) url += '?url=' + urllib.quote_plus(redirect_url.encode('utf8'))
url += '&service=' + urllib.quote_plus(redirect_url) url += '&service=' + urllib.quote_plus(redirect_url.encode('utf8'))
return url return url
def validate_url(self, service, ticket): def validate_url(self, service, ticket):
"""Return the validation URL for the given service. (For CAS 1.0)""" """Return the validation URL for the given service. (For CAS 1.0)"""
url = self.server_url + self.validate_path + '?service=' + urllib.quote_plus(service) + '&ticket=' + urllib.quote_plus(ticket) url = self.server_url + self.validate_path + '?service=' + urllib.quote_plus(service.encode('utf8')) + '&ticket=' + urllib.quote_plus(ticket)
if self.renew: if self.renew:
url += "&renew=true" url += "&renew=true"
return url return url
...@@ -136,14 +137,14 @@ class CASAuth(BaseAuth): ...@@ -136,14 +137,14 @@ class CASAuth(BaseAuth):
if self.ticket_path and request.method == 'POST': if self.ticket_path and request.method == 'POST':
logoutRequest=request.form.get('logoutRequest', None) logoutRequest=request.form.get('logoutRequest', None)
if logoutRequest is not None: if logoutRequest is not None:
sys.stderr.write("Tentative de deconnexion du CAS : %s\n" % logoutRequest) sys.stderr.write("Tentative de déconnexion du CAS : %s\n" % logoutRequest.decode('ascii', 'ignore'))
self.cas.singlesignout(logout_user, logoutRequest) self.cas.singlesignout(logout_user, logoutRequest)
# valid ticket on CAS # valid ticket on CAS
if ticket and ticket.startswith('ST-'): if ticket and ticket.startswith('ST-'):
valid, username = self.cas.validate_ticket(url, ticket) valid, username = self.cas.validate_ticket(url, ticket)
if valid: if valid:
sys.stderr.write("Authentifiaction de %s sur le CAS\n" % username) sys.stderr.write("Authentifiction de %s sur le CAS\n" % username)
u = user.User(request, auth_username=username, auth_method=self.name) u = user.User(request, auth_username=username, auth_method=self.name)
# auto create user ? # auto create user ?
if self.create_user: if self.create_user:
......
...@@ -38,7 +38,7 @@ class PublicCategories(AnonymousAuth): ...@@ -38,7 +38,7 @@ class PublicCategories(AnonymousAuth):
sys.stderr.write("Getting page from cache") sys.stderr.write("Getting page from cache")
page = request.page page = request.page
else: else:
pagename=urllib.unquote(p.path[1:]) pagename= urllib.unquote(p.path[1:]).encode('ascii', 'ignore')
if pagename.endswith(u'/'): if pagename.endswith(u'/'):
pagename=pagename[:-1] pagename=pagename[:-1]
page = Page(request, pagename) page = Page(request, pagename)
...@@ -53,14 +53,14 @@ class PublicCategories(AnonymousAuth): ...@@ -53,14 +53,14 @@ class PublicCategories(AnonymousAuth):
sys.stderr.write("%r dans la page %r\n" % (cat, p.path[1:])) sys.stderr.write("%r dans la page %r\n" % (cat, p.path[1:]))
return True return True
else: else:
sys.stderr.write("categories is empty, searching in page body of %s\n" % p.path[1:]) sys.stderr.write("categories is empty, searching in page body of %s\n" % p.path[1:].encode('utf8'))
body = page.getPageText() body = page.getPageText()
for cat in self.pub_cats: for cat in self.pub_cats:
if cat in body: if cat in body:
sys.stderr.write("%r dans la page %r\n" % (cat, p.path[1:])) sys.stderr.write("%s dans la page %s\n" % (cat.encode('utf8'), p.path[1:].encode('utf8')))
return True return True
sys.stderr.write("%r n'est pas dans la page %r, %r\n" % (cat, p.path[1:], categories)) sys.stderr.write("%s n'est pas dans la page %s, %r\n" % (cat.encode('utf8'), p.path[1:].encode('utf8'), categories))
return False return False
......
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