Permalink
Browse files

custom logout page

  • Loading branch information...
1 parent e829be2 commit b6fb264b437dab7d6e9eec146f4a1476a37ae3de @fwenzel committed May 5, 2010
Showing with 21 additions and 10 deletions.
  1. +0 −3 apps/sso/urls.py
  2. +8 −0 apps/users/templates/users/logout.html
  3. +3 −4 apps/users/templates/users/profile.html
  4. +1 −1 templates/base.html
  5. +9 −2 urls.py
View
3 apps/sso/urls.py
@@ -6,7 +6,4 @@
# The homepage.
url('^$', direct_to_template, {'template': 'sso/home.html'},
name='home'),
-
- # Login through service whitelist
- url('^users/login/?$', 'sso.views.whitelist_login'),
)
View
8 apps/users/templates/users/logout.html
@@ -0,0 +1,8 @@
+{% extends "base.html" %}
+
+{% block content %}
+<h2>{% block title %}Logged out{% endblock %}</h2>
+
+ <p>You have successfully logged out.</p>
+ {% if url %}<p><a href="{{ url }}">Click here</a> to return to {{ url }}</p>{% endif %}
+{% endblock %}
View
7 apps/users/templates/users/profile.html
@@ -3,7 +3,7 @@
{% block content %}
<h1>User Profile</h1>
-<h2>User Info</h2>
+<h2>{% block title %}User Info{% endblock %}</h2>
<table>
<tr>
<th>Name</th>
@@ -21,9 +21,8 @@
<h2>Associated Sites</h2>
<p>
-These are the sites you have authorized to log you in via single-sign-on.
-To authorize additional sites, go to the sites and click on their SSO log-in
-link.
+These are the sites you have logged in to via single-sign-on. To authorize
+additional sites, go to the sites and click on their SSO log-in link.
</p>
{% if user.sites.all %}
<ul>
View
2 templates/base.html
@@ -4,7 +4,7 @@
<head>
<meta charset="utf-8"/>
-<title>{% block title %}Mozilla SSO{% endblock %}</title>
+<title>{% block title %}Welcome{% endblock %} | Mozilla SSO</title>
<link rel="shortcut icon" type="image/ico" href="{{ MEDIA_URL }}img/favicon.ico"/>
<link rel="stylesheet" href="{{ MEDIA_URL }}css/squirrel.css" type="text/css" media="screen"/>
View
11 urls.py
@@ -8,8 +8,15 @@
urlpatterns = patterns('',
('', include('sso.urls')),
- # order is important here: Both apps provide login/logout so only the
- # first will match.
+ # Hook up login/logout separately from the following apps
+
+ # Login through service whitelist
+ url(r'^users/login/?$', 'sso.views.whitelist_login'),
+ url(r'^users/logout/?$', 'cas_provider.views.logout', {
+ 'template_name': 'users/logout.html'}),
+
+ # order is important here: If both apps provide a URL, only the first one
+ # will match.
(r'^users/', include('cas_provider.urls')),
(r'^users/', include('registration.urls')),

0 comments on commit b6fb264

Please sign in to comment.