Permalink
Browse files

stub out user manager admin panel

  • Loading branch information...
1 parent b1a08c0 commit 1346dc9060e631e84499f40b9744abe0c43d0a4d @ejucovy ejucovy committed Aug 14, 2012
Showing with 70 additions and 1 deletion.
  1. +63 −0 trac_gitolite/templates/admin_repository_users.html
  2. +7 −1 trac_gitolite/user_manager.py
@@ -0,0 +1,63 @@
+<!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>
@@ -5,6 +5,7 @@
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
@@ -33,7 +34,12 @@ def get_admin_panels(self, req):
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

0 comments on commit 1346dc9

Please sign in to comment.