Main Page
Namespaces
Classes
Files
File List
src
webui
mod
webui
cgibin
edituser.py
Go to the documentation of this file.
1
#! /usr/bin/env python
2
3
"""
4
usage: %(progname)s [args]
5
"""
6
7
import
nstart
8
9
import
os, sys, string, time, getopt, re
10
from
pyclearsilver.log
import
*
11
12
import
neo_cgi, neo_util, neo_cs
13
14
from
pyclearsilver
import
CSPage
15
from
pyclearsilver
import
odb
16
17
import
MBPage
18
import
db_webui
19
20
import
roslib
21
import
roslib.scriptutil
22
#import rospy
23
import
webutil
24
25
class
MyPage
(
MBPage.MBPage
):
26
def
setup
(self, hdf):
27
self.
db
= db_webui.initSchema()
28
29
def
display
(self, hdf):
30
webutil.set_tabs(hdf, [
"admin"
,
"users"
])
31
username = hdf.getValue(
"Query.username"
,
""
).strip()
32
row = self.authdb.users.lookup(username=username)
33
row.hdfExport(
"CGI.cur.user"
, hdf)
34
35
def
Action_SaveUser
(self, hdf):
36
# load params from request
37
username = hdf.getValue(
"Query.username"
,
""
).strip()
38
role = hdf.getValue(
"Query.role"
,
""
).strip()
39
40
# save the new user record
41
try
:
42
row = self.authdb.users.lookup(username=username)
43
row.role = hdf.getValue(
"Query.role"
,
""
)
44
row.save()
45
except
:
46
hdf.setValue(
"CGI.cur.error_message.password"
,
"There was an error when trying to save this user."
)
47
48
self.
redirectUri
(
"users.py"
)
49
50
def
run
(context):
51
return
MyPage
(context, pagename=
"edituser"
, nologin=
False
)
52
53
def
main
():
54
context = CSPage.Context()
55
run
(context).
start
()
56
57
if
__name__ ==
"__main__"
:
58
main
()
webui.startcgi.start
start
Definition:
startcgi.py:4
pyclearsilver::log
webui.MBPage.MBPage.db
db
Definition:
MBPage.py:32
pyclearsilver::CSPage::CSPage::redirectUri
def redirectUri(self, redirectTo)
webui.MBPage.MBPage
Definition:
MBPage.py:18
webui.mod.webui.cgibin.edituser.MyPage
Definition:
edituser.py:25
webui.mod.webui.cgibin.edituser.main
def main()
Definition:
edituser.py:53
webui.mod.webui.cgibin.edituser.MyPage.Action_SaveUser
def Action_SaveUser(self, hdf)
Definition:
edituser.py:35
webui.mod.webui.cgibin.edituser.MyPage.setup
def setup(self, hdf)
Definition:
edituser.py:26
webui.mod.webui.cgibin.edituser.MyPage.display
def display(self, hdf)
Definition:
edituser.py:29
webui.mod.webui.cgibin.edituser.run
def run(context)
Definition:
edituser.py:50
webui
Author(s): Scott Hassan
autogenerated on Mon Jun 10 2019 15:51:24