Commits

ejucovy  committed bf3c353

stub out user manager admin panel

  • Participants
  • Parent commits f7aa017

Comments (0)

Files changed (2)

File trac_gitolite/templates/admin_repository_users.html

+<!DOCTYPE html
+    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:xi="http://www.w3.org/2001/XInclude"
+      xmlns:py="http://genshi.edgewall.org/"
+      xmlns:i18n="http://genshi.edgewall.org/i18n">
+  <xi:include href="admin.html"/>
+  <head>
+    <title>Repository Users</title>
+  </head>
+
+  <body>
+    <h2>Manage Repository Users</h2>
+
+    <form enctype="multipart/form-encoded" class="addnew" method="post" action="">
+      <fieldset>
+	<legend>Add User:</legend>
+	<div class="field">
+	  <label>Name:
+	    <input type="text" name="name" />
+	  </label>
+	</div>
+	<div class="field">
+	  <label>SSH Public Key:
+	    <input type="file" name="sshkey" />
+	  </label>
+	</div>
+	<div class="buttons">
+	  <input type="submit" name="add_user" value="Add" />
+	</div>
+      </fieldset>
+    </form>
+
+    <form method="post" action="">
+
+    <table class="listing">
+      <thead>
+	<tr>
+	  <th class="sel">&nbsp;</th>
+	  <th>Name</th>
+	</tr>
+      </thead>
+      <tbody>
+	<tr py:for="user in users">
+	  <td class="sel">
+	    <input type="checkbox" name="$user" />
+	  </td>
+	  <td>
+	    $user
+	  </td>
+	</tr>
+      </tbody>
+    </table>
+
+    <div class="buttons">
+      <input type="submit" value="${_('Remove selected users')}" />
+    </div>
+
+    </form>
+  </body>
+
+</html>

File trac_gitolite/user_manager.py

 from trac.config import Option, BoolOption
 from trac.util.translation import _
 from trac.web.chrome import ITemplateProvider
+from trac.web.chrome import add_notice
 
 from trac_gitolite import utils
 
     def render_admin_panel(self, req, category, page, path_info):
         req.perm.require('VERSIONCONTROL_ADMIN')
 
-        pass
+        if req.method == 'POST':
+            add_notice(req, _('The selected users have been removed and no longer have SSH access to your repositories.  Note that if they have Trac accounts, they may still be able to browse the source code through the web.'))
+            req.redirect(req.href.admin(category, page))
+
+        data = {'users': self.get_users()}
+        return 'admin_repository_users.html', data
 
     # ITemplateProvider methods