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:03 UTC
[6/8] git commit: [#7372] ticket:583 Add .ini option to allow users
to disable account
[#7372] ticket:583 Add .ini option to allow users to disable account
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/e4398716
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/e4398716
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/e4398716
Branch: refs/heads/master
Commit: e4398716b91dc52c576b459f46a4621dfc544d59
Parents: 202a6f1
Author: Igor Bondarenko <je...@gmail.com>
Authored: Mon May 19 16:34:39 2014 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Fri May 23 18:03:05 2014 +0000
----------------------------------------------------------------------
Allura/allura/controllers/auth.py | 4 +++-
Allura/allura/templates/user_prefs.html | 8 +++++---
Allura/development.ini | 2 ++
Allura/test.ini | 1 +
4 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/e4398716/Allura/allura/controllers/auth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/auth.py b/Allura/allura/controllers/auth.py
index e72ae8f..d93e053 100644
--- a/Allura/allura/controllers/auth.py
+++ b/Allura/allura/controllers/auth.py
@@ -25,6 +25,7 @@ from tg.decorators import with_trailing_slash
from pylons import tmpl_context as c, app_globals as g
from pylons import request, response
from webob import exc as wexc
+from paste.deploy.converters import asbool
import allura.tasks.repo_tasks
from allura import model as M
@@ -78,7 +79,8 @@ class AuthController(BaseController):
self.user_info = UserInfoController()
self.subscriptions = SubscriptionsController()
self.oauth = OAuthController()
- self.disable = DisableAccountController()
+ if asbool(config.get('auth.allow_user_to_disable_account', False)):
+ self.disable = DisableAccountController()
def __getattr__(self, name):
urls = plugin.UserPreferencesProvider.get().additional_urls()
http://git-wip-us.apache.org/repos/asf/allura/blob/e4398716/Allura/allura/templates/user_prefs.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/user_prefs.html b/Allura/allura/templates/user_prefs.html
index 36a7463..25d1120 100644
--- a/Allura/allura/templates/user_prefs.html
+++ b/Allura/allura/templates/user_prefs.html
@@ -143,7 +143,9 @@
{{ lib.csrf_token() }}
</form>
</div>
-<div class="grid-20">
- <p><a href="/auth/disable">Disable account</a></p>
-</div>
+{% if h.asbool(tg.config.get('auth.allow_user_to_disable_account', False)) %}
+ <div class="grid-20">
+ <p><a href="/auth/disable">Disable account</a></p>
+ </div>
+{% endif %}
{% endblock %}
http://git-wip-us.apache.org/repos/asf/allura/blob/e4398716/Allura/development.ini
----------------------------------------------------------------------
diff --git a/Allura/development.ini b/Allura/development.ini
index 124afaa..e1e7c4a 100644
--- a/Allura/development.ini
+++ b/Allura/development.ini
@@ -83,6 +83,8 @@ auth.ldap.password.algorithm = 6
auth.ldap.password.rounds = 6000
auth.ldap.password.salt_len = 16
+auth.allow_user_to_disable_account = true
+
# In seconds
auth.recovery_hash_expiry_period = 600
http://git-wip-us.apache.org/repos/asf/allura/blob/e4398716/Allura/test.ini
----------------------------------------------------------------------
diff --git a/Allura/test.ini b/Allura/test.ini
index f6c9ae0..8d0f849 100644
--- a/Allura/test.ini
+++ b/Allura/test.ini
@@ -144,6 +144,7 @@ auth.ldap.password.algorithm = 6
auth.ldap.password.rounds = 6000
auth.ldap.password.salt_len = 16
+auth.allow_user_to_disable_account = true
[app:main_with_amqp]
use = main