00001
00002
00003 """
00004 usage: %(progname)s [args]
00005 """
00006
00007 import nstart
00008
00009 import os, sys, string, time, getopt, re
00010 from pyclearsilver.log import *
00011
00012 import neo_cgi, neo_util, neo_cs
00013
00014 from pyclearsilver import CSPage
00015 from pyclearsilver import odb
00016
00017 import MBPage
00018 import db_webui
00019 from auth import db_auth
00020
00021 import roslib
00022 import roslib.scriptutil
00023
00024 import webutil
00025
00026 class MyPage(MBPage.MBPage):
00027 def setup(self, hdf):
00028 self.db = db_webui.initSchema()
00029 self.auth_db = db_auth.initSchema()
00030
00031 def display(self, hdf):
00032 webutil.set_tabs(hdf, ["admin", "users"])
00033
00034 user_records = self.auth_db.users.fetchAllRows()
00035 user_records.hdfExport("CGI.cur.users", hdf)
00036
00037 def Action_DeleteUser(self, hdf):
00038 username = hdf.getValue("Query.username", "").strip()
00039 row = self.authdb.users.lookup(username=username)
00040 row.delete()
00041 self.redirectUri("users.py")
00042
00043 def run(context):
00044 return MyPage(context, pagename="users", nologin=False)
00045
00046 def main():
00047 context = CSPage.Context()
00048 run(context).start()
00049
00050 if __name__ == "__main__":
00051 main()