allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [21/27] git commit: [#7657] Add an extension point for additional user details
Date Mon, 29 Sep 2014 16:17:52 GMT
[#7657] Add an extension point for additional user details


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/ae1dc97c
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/ae1dc97c
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/ae1dc97c

Branch: refs/heads/db/7657
Commit: ae1dc97c70b42aff2022dd1125f29235e324985a
Parents: d90674a
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Thu Sep 18 10:48:56 2014 +0300
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Fri Sep 26 18:37:26 2014 +0000

----------------------------------------------------------------------
 Allura/allura/controllers/site_admin.py         |  5 +++-
 Allura/allura/lib/plugin.py                     |  7 ++++++
 .../templates/site_admin_user_details.html      | 24 +++++++++-----------
 3 files changed, 22 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/ae1dc97c/Allura/allura/controllers/site_admin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/site_admin.py b/Allura/allura/controllers/site_admin.py
index 271e50b..335a0e6 100644
--- a/Allura/allura/controllers/site_admin.py
+++ b/Allura/allura/controllers/site_admin.py
@@ -468,11 +468,14 @@ class AdminUserDetailsController(object):
             raise HTTPNotFound()
         projects = user.my_projects().all()
         audit_log = self._audit_log(user, limit, page)
-        return {
+        info = {
             'user': user,
             'projects': projects,
             'audit_log': audit_log,
         }
+        p = AuthenticationProvider.get(request)
+        info.update(p.user_details(user))
+        return info
 
     def _audit_log(self, user, limit, page):
         limit = int(limit)

http://git-wip-us.apache.org/repos/asf/allura/blob/ae1dc97c/Allura/allura/lib/plugin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/plugin.py b/Allura/allura/lib/plugin.py
index 1186cf6..1ad4ef0 100644
--- a/Allura/allura/lib/plugin.py
+++ b/Allura/allura/lib/plugin.py
@@ -277,6 +277,13 @@ class AuthenticationProvider(object):
         '''
         raise NotImplementedError, 'get_last_password_updated'
 
+    def user_details(self, user):
+        '''Returns detailed information about user.
+
+        :param user: a :class:`User <allura.model.auth.User>`
+        '''
+        return {}
+
     def is_password_expired(self, user):
         days = asint(config.get('auth.pwdexpire.days', 0))
         before = asint(config.get('auth.pwdexpire.before', 0))

http://git-wip-us.apache.org/repos/asf/allura/blob/ae1dc97c/Allura/allura/templates/site_admin_user_details.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/site_admin_user_details.html b/Allura/allura/templates/site_admin_user_details.html
index fbbb0f4..dd771cc 100644
--- a/Allura/allura/templates/site_admin_user_details.html
+++ b/Allura/allura/templates/site_admin_user_details.html
@@ -34,6 +34,7 @@
           <li>Full name: {{ user.get_pref('display_name') }}</li>
           <li>Registered: {{ user.registration_date() }} ({{ h.ago(user.registration_date())
}})</li>
         </ul>
+        {% block extra_general_info %}{% endblock %}
         </div>
 
         <div class="grid-6">
@@ -45,21 +46,18 @@
           <input type='hidden' name='username' value='{{ user.username }}'>
           {{lib.csrf_token()}}
         </form>
-        </div>
 
-        <div class="grid-16">&nbsp;</div>
-        <div class="grid-6">
-          <form action='/nf/admin/user/set_random_password' method="POST">
-            <input type="submit" value="Set random password">
-            <input type='hidden' name='username' value='{{ user.username }}'>
-            {{lib.csrf_token()}}
-          </form>
+        <form action='/nf/admin/user/set_random_password' method="POST">
+          <input type="submit" value="Set random password">
+          <input type='hidden' name='username' value='{{ user.username }}'>
+          {{lib.csrf_token()}}
+        </form>
 
-          <form action='/nf/admin/user/send_password_reset_link' method="POST">
-            <input type="submit" value="Send password reset link">
-            <input type='hidden' name='username' value='{{ user.username }}'>
-            {{lib.csrf_token()}}
-          </form>
+        <form action='/nf/admin/user/send_password_reset_link' method="POST">
+          <input type="submit" value="Send password reset link">
+          <input type='hidden' name='username' value='{{ user.username }}'>
+          {{lib.csrf_token()}}
+        </form>
         </div>
       </fieldset>
     </div>


Mime
View raw message