Skip to content

Commit

Permalink
stub out user manager admin panel
Browse files Browse the repository at this point in the history
  • Loading branch information
ejucovy committed Aug 14, 2012
1 parent b1a08c0 commit 1346dc9
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 1 deletion.
63 changes: 63 additions & 0 deletions trac_gitolite/templates/admin_repository_users.html
@@ -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>
8 changes: 7 additions & 1 deletion trac_gitolite/user_manager.py
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 1346dc9

Please sign in to comment.