diff pylons_app/controllers/admin.py @ 44:d924b931b488

Added managment pages. + fixed routing bug done a lot in templates
author marcink
date Wed, 07 Apr 2010 16:42:11 +0200
parents 2e1247e62c5b
children a886f5eba757
line wrap: on
line diff
--- a/pylons_app/controllers/admin.py	Wed Apr 07 15:28:50 2010 +0200
+++ b/pylons_app/controllers/admin.py	Wed Apr 07 16:42:11 2010 +0200
@@ -8,6 +8,7 @@
 from mercurial import ui, hg
 from mercurial.error import RepoError
 from ConfigParser import ConfigParser
+from pylons_app.lib import auth
 log = logging.getLogger(__name__)
 
 class AdminController(BaseController):
@@ -15,12 +16,21 @@
 
     def __before__(self):
         c.staticurl = g.statics
+        c.admin_user = True
         
     def index(self):
         # Return a rendered template
         return render('/admin.html')
 
-
+    def repos_manage(self):
+        return render('/repos_manage.html')
+    
+    def users_manage(self):
+        conn, cur = auth.get_sqlite_conn_cur()
+        cur.execute('SELECT * FROM users')
+        c.users_list = cur.fetchall()        
+        return render('/users_manage.html')
+                
     def manage_hgrc(self):
         pass
 
@@ -32,8 +42,8 @@
         
 
         #extra check it can be add since it's the command
-        if new_repo == 'add':
-            c.msg = 'you basstard ! this repo is a command'
+        if new_repo == '_admin':
+            c.msg = 'DENIED'
             c.new_repo = ''
             return render('add.html')