You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2014/05/28 00:00:02 UTC
[5/8] git commit: [#7372] ticket:583 Disable account skeleton
[#7372] ticket:583 Disable account skeleton
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/bab493a9
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/bab493a9
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/bab493a9
Branch: refs/heads/master
Commit: bab493a93281f3beda55f510d70c4da0c1129010
Parents: f9c8072
Author: Igor Bondarenko <je...@gmail.com>
Authored: Wed May 14 11:10:26 2014 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Fri May 23 18:02:37 2014 +0000
----------------------------------------------------------------------
Allura/allura/controllers/auth.py | 14 +++++++
.../allura/templates/user_disable_account.html | 39 ++++++++++++++++++++
Allura/allura/templates/user_prefs.html | 3 ++
3 files changed, 56 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/bab493a9/Allura/allura/controllers/auth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/auth.py b/Allura/allura/controllers/auth.py
index a0d1848..6ebf2b0 100644
--- a/Allura/allura/controllers/auth.py
+++ b/Allura/allura/controllers/auth.py
@@ -76,6 +76,7 @@ class AuthController(BaseController):
self.user_info = UserInfoController()
self.subscriptions = SubscriptionsController()
self.oauth = OAuthController()
+ self.disable = DisableAccountController()
def __getattr__(self, name):
urls = plugin.UserPreferencesProvider.get().additional_urls()
@@ -845,3 +846,16 @@ class OAuthController(BaseController):
access_token.delete()
flash('Token revoked')
redirect('.')
+
+
+class DisableAccountController(BaseController):
+
+ def _check_security(self):
+ require_authenticated()
+
+ @with_trailing_slash
+ @expose('jinja:allura:templates/user_disable_account.html')
+ def index(self, **kw):
+ provider = plugin.AuthenticationProvider.get(request)
+ menu = provider.account_navigation()
+ return {'menu': menu}
http://git-wip-us.apache.org/repos/asf/allura/blob/bab493a9/Allura/allura/templates/user_disable_account.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/user_disable_account.html b/Allura/allura/templates/user_disable_account.html
new file mode 100644
index 0000000..631b7ef
--- /dev/null
+++ b/Allura/allura/templates/user_disable_account.html
@@ -0,0 +1,39 @@
+{#-
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-#}
+{% set hide_left_bar = True %}
+{% extends g.theme.master %}
+
+{% block title %}{{c.user.username}} / Disable account{% endblock %}
+
+{% block header %}Disable account for {{c.user.username}}{% endblock %}
+
+{% block content %}
+ <ul id="account-nav-menu" class="b-hornav droppy">
+ {% for item in menu -%}
+ <li id="{{ item.tabid }}">
+ <a href="{{ item.target }}">
+ {{ item.title }}
+ <div class="marker{% if item.target.rstrip('/') == request.path.rstrip('/') %} current{% endif %}"></div>
+ </a>
+ </li>
+ {%- endfor %}
+ </ul>
+
+ <h2>Disable account</h2>
+{% endblock %}
http://git-wip-us.apache.org/repos/asf/allura/blob/bab493a9/Allura/allura/templates/user_prefs.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/user_prefs.html b/Allura/allura/templates/user_prefs.html
index 97453cb..900c9f0 100644
--- a/Allura/allura/templates/user_prefs.html
+++ b/Allura/allura/templates/user_prefs.html
@@ -153,4 +153,7 @@
{{ lib.csrf_token() }}
</form>
</div>
+<div class="grid-20">
+ <p><a href="/auth/disable">Disable account</a></p>
+</div>
{% endblock %}