@@ -58,11 +58,9 @@
if( !g.okSetup ){
login_needed();
}
- style_header();
-
- @ <h2>Setup</h2>
+ style_header("Setup");
@ <dl id="setup">
menu_entry("Users", "setup_ulist",
"Grant privileges to individual users.");
menu_entry("Access", "setup_access",
@@ -90,11 +88,9 @@
return;
}
style_submenu_element("Add", "Add User", "setup_uedit");
- style_header();
- @ <h2>List Of Users</h2>
- @ <hr>
+ style_header("User List");
@ <table align="left" hspace="10" border="1" cellpadding="10"><tr><td>
@ <table cellspacing=0 cellpadding=0 border=0>
@ <tr>
@ <th align="right">User ID</th>
@@ -158,9 +154,9 @@
*/
void user_edit(void){
const char *zId, *zLogin, *zInfo, *zCap;
char *oaa, *oas, *oar, *oaw, *oan, *oai, *oaj, *oao, *oap ;
- char *oak, *oad, *oaq;
+ char *oak, *oad, *oaq, *oac, *oaf, *oam;
int doWrite;
int uid;
int higherUser = 0; /* True if user being edited is SETUP and the */
/* user doing the editing is ADMIN. Disallow editing */
@@ -207,18 +203,26 @@
int aq = P("aq")!=0;
int ar = P("ar")!=0;
int as = g.okSetup && P("as")!=0;
int aw = P("aw")!=0;
+ int ac = P("ac")!=0;
+ int af = P("af")!=0;
+ int am = P("am")!=0;
+#if 0
if( as ) aa = 1;
if( aa ) ai = aw = ap = 1;
if( aw ) an = ar = 1;
if( ai ) ao = 1;
if( ak ) aj = 1;
+#endif
if( aa ){ zCap[i++] = 'a'; }
+ if( ac ){ zCap[i++] = 'c'; }
if( ad ){ zCap[i++] = 'd'; }
+ if( af ){ zCap[i++] = 'f'; }
if( ai ){ zCap[i++] = 'i'; }
if( aj ){ zCap[i++] = 'j'; }
if( ak ){ zCap[i++] = 'k'; }
+ if( am ){ zCap[i++] = 'm'; }
if( an ){ zCap[i++] = 'n'; }
if( ao ){ zCap[i++] = 'o'; }
if( ap ){ zCap[i++] = 'p'; }
if( aq ){ zCap[i++] = 'q'; }
@@ -234,9 +238,9 @@
zLogin = P("login");
if( uid>0 &&
db_exists("SELECT 1 FROM user WHERE login=%Q AND uid!=%d", zLogin, uid)
){
- style_header();
+ style_header("User Creation Error");
@ <font color="red">Login "%h(zLogin)" is already used by a different
@ user.</font>
@
@ <p><a href="setup_uedit?id=%d(uid))>[Bummer]</a></p>
@@ -256,18 +260,22 @@
*/
zLogin = "";
zInfo = "";
zCap = "";
- oaa = oad = oai = oaj = oak = oan = oao = oap = oaq = oar = oas = oaw = "";
+ oaa = oac = oad = oaf = oai = oaj = oak = oam =
+ oan = oao = oap = oaq = oar = oas = oaw = "";
if( uid ){
zLogin = db_text("", "SELECT login FROM user WHERE uid=%d", uid);
zInfo = db_text("", "SELECT info FROM user WHERE uid=%d", uid);
zCap = db_text("", "SELECT cap FROM user WHERE uid=%d", uid);
if( strchr(zCap, 'a') ) oaa = " checked";
+ if( strchr(zCap, 'c') ) oac = " checked";
if( strchr(zCap, 'd') ) oad = " checked";
+ if( strchr(zCap, 'f') ) oaf = " checked";
if( strchr(zCap, 'i') ) oai = " checked";
if( strchr(zCap, 'j') ) oaj = " checked";
if( strchr(zCap, 'k') ) oak = " checked";
+ if( strchr(zCap, 'm') ) oam = " checked";
if( strchr(zCap, 'n') ) oan = " checked";
if( strchr(zCap, 'o') ) oao = " checked";
if( strchr(zCap, 'p') ) oap = " checked";
if( strchr(zCap, 'q') ) oaq = " checked";
@@ -278,13 +286,12 @@
/* Begin generating the page
*/
style_submenu_element("Cancel", "Cancel", "setup_ulist");
- style_header();
if( uid ){
- @ <h2>Edit User %h(zLogin)</h2>
+ style_header(mprintf("Edit User %h", zLogin));
}else{
- @ <h2>Add A New User</h2>
+ style_header("Add A New User");
}
@ <table align="left" hspace="20" vspace="10"><tr><td>
@ <form action="%s(g.zPath)" method="POST">
@ <table>
@@ -306,22 +313,25 @@
@ </tr>
@ <tr>
@ <td align="right" valign="top">Capabilities:</td>
@ <td>
- @ <input type="checkbox" name="aa"%s(oaa)>Admin</input><br>
- @ <input type="checkbox" name="ad"%s(oad)>Delete</input><br>
- @ <input type="checkbox" name="ai"%s(oai)>Check-In</input><br>
- @ <input type="checkbox" name="aj"%s(oaj)>Read Wiki</input><br>
- @ <input type="checkbox" name="ak"%s(oak)>Write Wiki</input><br>
- @ <input type="checkbox" name="an"%s(oan)>New Tkt</input><br>
- @ <input type="checkbox" name="ao"%s(oao)>Check-Out</input><br>
- @ <input type="checkbox" name="ap"%s(oap)>Password</input><br>
- @ <input type="checkbox" name="aq"%s(oaq)>Query</input><br>
- @ <input type="checkbox" name="ar"%s(oar)>Read</input><br>
if( g.okSetup ){
@ <input type="checkbox" name="as"%s(oas)>Setup</input><br>
}
- @ <input type="checkbox" name="aw"%s(oaw)>Write</input>
+ @ <input type="checkbox" name="aa"%s(oaa)>Admin</input><br>
+ @ <input type="checkbox" name="ad"%s(oad)>Delete</input><br>
+ @ <input type="checkbox" name="ap"%s(oap)>Password</input><br>
+ @ <input type="checkbox" name="aq"%s(oaq)>Query</input><br>
+ @ <input type="checkbox" name="ai"%s(oai)>Check-In</input><br>
+ @ <input type="checkbox" name="ao"%s(oao)>Check-Out</input><br>
+ @ <input type="checkbox" name="aj"%s(oaj)>Read Wiki</input><br>
+ @ <input type="checkbox" name="af"%s(oaf)>New Wiki</input><br>
+ @ <input type="checkbox" name="am"%s(oam)>Append Wiki</input><br>
+ @ <input type="checkbox" name="ak"%s(oak)>Write Wiki</input><br>
+ @ <input type="checkbox" name="ar"%s(oar)>Read Tkt</input><br>
+ @ <input type="checkbox" name="an"%s(oan)>New Tkt</input><br>
+ @ <input type="checkbox" name="ac"%s(oac)>Append Tkt</input><br>
+ @ <input type="checkbox" name="aw"%s(oaw)>Write Tkt</input>
@ </td>
@ </tr>
@ <tr>
@ <td align="right">Password:</td>
@@ -342,13 +352,8 @@
@ so you are not permitted to make changes to %h(zId).
@ </p></li>
@
}
- @ <li><p>
- @ The <b>Read</b> and <b>Write</b> privileges give the user the ability
- @ to read and write tickets. The <b>New Tkt</b> capability means that
- @ the user is able to create new tickets.
- @ </p></li>
@
@ <li><p>
@ The <b>Delete</b> privilege give the user the ability to erase
@ wiki, tickets, and atttachments that have been added by anonymous
@@ -451,11 +456,10 @@
if( !g.okSetup ){
login_needed();
}
- style_header();
- db_begin_transaction();
- @ <h2>Access Control Settings</h2>
+ style_header("Access Control Settings");
+ db_begin_transaction();
@ <form action="%s(g.zBaseURL)/setup_access" method="POST">
@ <hr>
onoff_attribute("Require password for local access",
@@ -492,11 +496,10 @@
if( !g.okSetup ){
login_needed();
}
- style_header();
- db_begin_transaction();
- @ <h2>WWW Configuration</h2>
+ style_header("WWW Configuration");
+ db_begin_transaction();
@ <form action="%s(g.zBaseURL)/setup_config" method="POST">
@ <hr>
entry_attribute("Home page", 60, "homepage", "hp", "");