4 usage: %(progname)s [args] 9 import os, sys, string, time, getopt, re
12 import neo_cgi, neo_util, neo_cs
14 from pyclearsilver
import CSPage
15 from pyclearsilver
import odb
21 import roslib.scriptutil
27 self.
db = db_webui.initSchema()
30 webutil.set_tabs(hdf, [
"admin",
"users"])
34 username = hdf.getValue(
"Query.username",
"").strip()
35 password = hdf.getValue(
"Query.password",
"").strip()
36 role = hdf.getValue(
"Query.role",
"").strip()
39 if self.authdb.users.lookup(username=username):
40 hdf.setValue(
"CGI.cur.error_message.username",
"User %s already exists." % username)
42 hdf.setValue(
"CGI.cur.error_message.username",
"Please specify a user name (3 or more characters).")
44 hdf.setValue(
"CGI.cur.error_message.password",
"Please specify a password (3 or more characters).")
45 if hdf.getObj(
"CGI.cur.error_message"):
50 row = self.authdb.users.newRow()
51 row.username = hdf.getValue(
"Query.username",
"")
52 new_password = hdf.getValue(
"Query.password",
"")
53 row.setPassword(new_password)
54 row.role = hdf.getValue(
"Query.role",
"")
57 hdf.setValue(
"CGI.cur.error_message.password",
"There was an error when trying to save this user.")
62 return MyPage(context, pagename=
"newuser", nologin=
False)
65 context = CSPage.Context()
68 if __name__ ==
"__main__":
def redirectUri(self, redirectTo)
def Action_CreateUser(self, hdf)