Changeset 1503
- Timestamp:
- 11/10/06 00:02:37 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
accountmanagerplugin/trunk/acct_mgr/admin.py
r1291 r1503 14 14 from trac.util import sorted 15 15 from trac.util.datefmt import format_datetime 16 from webadmin.web_ui import IAdminPageProvider16 from trac.admin import IAdminPanelProvider 17 17 18 18 from acct_mgr.api import AccountManager … … 21 21 class AccountManagerAdminPage(Component): 22 22 23 implements(IAdminPa geProvider)23 implements(IAdminPanelProvider) 24 24 25 25 def __init__(self): … … 27 27 28 28 # IAdminPageProvider 29 def get_admin_pa ges(self, req):29 def get_admin_panels(self, req): 30 30 if req.perm.has_permission('TRAC_ADMIN'): 31 31 yield ('general', 'General', 'accounts', 'Accounts') 32 32 33 def process_admin_request(self, req, cat, page, path_info):33 def render_admin_panel(self, req, cat, page, path_info): 34 34 perm = PermissionSystem(self.env) 35 data = {} 35 36 if req.method == 'POST': 36 37 if req.args.get('add'): … … 38 39 _create_user(req, self.env, check_permissions=False) 39 40 except TracError, e: 40 req.hdf['registration.error'] = e.message41 data['registration_error'] = e.message 41 42 elif req.args.get('remove'): 42 43 sel = req.args.get('sel') … … 63 64 account['last_visit'] = format_datetime(last_visit) 64 65 65 req.hdf['accounts'] = sorted(accounts.itervalues(),66 key=lambda acct: acct['username'])66 data['accounts'] = sorted(accounts.itervalues(), 67 key=lambda acct: acct['username']) 67 68 68 return 'admin_accounts. cs', None69 return 'admin_accounts.html', data 69 70 accountmanagerplugin/trunk/acct_mgr/templates/admin_accounts.html
r1290 r1503 1 <h2>Manage User Accounts</h2> 1 <!DOCTYPE html 2 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 4 <html xmlns="http://www.w3.org/1999/xhtml" 5 xmlns:xi="http://www.w3.org/2001/XInclude" 6 xmlns:py="http://genshi.edgewall.org/"> 7 <xi:include href="admin.html" /> 8 <head> 9 <title>Basics</title> 10 </head> 2 11 3 <form id="addaccount" class="addnew" method="post"> 4 <fieldset> 5 <?cs if registration.error ?> 6 <div class="system-message"><p><?cs var:registration.error ?></p></div> 7 <?cs /if ?> 12 <body> 13 <h2>Manage User Accounts</h2> 8 14 9 <legend>Add Account:</legend> 10 <div class="field"> 11 <label>Username: <input type="text" name="user" class="textwidget" /></label> 12 </div> 13 <div class="field"> 14 <label>Password: <input type="password" name="password" class="textwidget" /></label> 15 </div> 16 <div class="field"> 17 <label>Confirm password: <input type="password" name="password_confirm" class="textwidget" /></label> 18 </div> 19 <div class="field"> 20 <label>Name: <input type="text" name="name" class="textwidget" /></label> 21 </div> 22 <div class="field"> 23 <label>Email: <input type="text" name="email" class="textwidget" /></label> 24 </div> 25 <p class="help">Add a new user account.</p> 26 <div class="buttons"> 27 <input type="submit" name="add" value=" Add "> 28 </div> 29 </fieldset> 30 </form> 15 <form id="addaccount" class="addnew" method="post"> 16 <fieldset> 17 <div class="system-message" 18 py:if="registration_error"><p>${registration_error}</p></div> 31 19 32 <form method="post"> 33 <table class="listing" id="accountlist"> 34 <thead> 35 <tr><th class="sel"> </th><th>Account</th><th>Name</th><th>Email</th><th>Last Login</th></tr> 36 </thead><tbody><?cs 37 each:account = accounts ?> 38 <tr> 39 <td><input type="checkbox" name="sel" value="<?cs var:account.username ?>" /></td> 40 <td><?cs var:account.username ?></td> 41 <td><?cs var:account.name ?></td> 42 <td><?cs var:account.email ?></td> 43 <td><?cs var:account.last_visit ?></td> 44 </tr><?cs 45 /each ?></tbody> 46 </table> 47 <div class="buttons"> 48 <input type="submit" name="remove" value="Remove selected accounts" /> 49 </div> 50 </form> 20 <legend>Add Account:</legend> 21 <div class="field"> 22 <label>Username: <input type="text" name="user" class="textwidget" /></label> 23 </div> 24 <div class="field"> 25 <label>Password: <input type="password" name="password" class="textwidget" /></label> 26 </div> 27 <div class="field"> 28 <label>Confirm password: <input type="password" name="password_confirm" class="textwidget" /></label> 29 </div> 30 <div class="field"> 31 <label>Name: <input type="text" name="name" class="textwidget" /></label> 32 </div> 33 <div class="field"> 34 <label>Email: <input type="text" name="email" class="textwidget" /></label> 35 </div> 36 <p class="help">Add a new user account.</p> 37 <div class="buttons"> 38 <input type="submit" name="add" value=" Add " /> 39 </div> 40 </fieldset> 41 </form> 51 42 52 43 <form method="post"> 44 <table class="listing" id="accountlist"> 45 <thead> 46 <tr><th class="sel"> </th><th>Account</th><th>Name</th><th>Email</th><th>Last Login</th></tr> 47 </thead> 48 <tbody> 49 <tr py:for="account in accounts"> 50 <td><input type="checkbox" name="sel" value="${account.username}" /></td> 51 <td>${account.username}</td> 52 <td>${account.name}</td> 53 <td>${account.email}</td> 54 <td>${account.last_visit}</td> 55 </tr> 56 </tbody> 57 </table> 58 <div class="buttons"> 59 <input type="submit" name="remove" value="Remove selected accounts" /> 60 </div> 61 </form> 62 </body> 63 </html> accountmanagerplugin/trunk/setup.py
r1128 r1503 5 5 setup( 6 6 name = 'TracAccountManager', 7 version = '0. 1.2',7 version = '0.2', 8 8 author = 'Matthew Good', 9 9 author_email = 'trac@matt-good.net', … … 22 22 23 23 install_requires = [ 24 'TracWebAdmin',24 #'trac>=0.11', 25 25 ], 26 26
