Overview
SHA1 Hash: | 66f4caa379d2bf03ea15eee5ec96bac9044e4db2 |
---|---|
Date: | 2007-07-23 19:52:51 |
User: | drh |
Comment: | Improvements to the WWW interface. |
Timelines: | ancestors | descendants | both | trunk |
Other Links: | files | ZIP archive | manifest |
Tags And Properties
- branch=trunk inherited from [a28c83647d]
- sym-trunk inherited from [a28c83647d]
Changes
[hide diffs]Modified src/info.c from [0c1aa485af] to [cb6cea5bd7].
@@ -116,11 +116,11 @@ Stmt q; int rid; char cType; char *zType; - style_header(); + style_header("Version Information"); rid = name_to_rid(g.zExtra); if( rid==0 ){ @ No such object: %h(g.argv[2]) style_footer(); return; @@ -276,11 +276,11 @@ if( zV2==0 ){ cgi_redirect("index"); } vid2 = uuid_to_rid(zV2, 0); p2 = record_from_rid(vid2); - style_header(); + style_header("File Diff"); if( zV1==0 ){ zV1 = db_text(0, "SELECT uuid FROM record WHERE rid=" " (SELECT a FROM link WHERE typecode='P' AND b=%d)", vid2); }
Modified src/login.c from [eed2c5dedd] to [c801bf1f9b].
@@ -107,11 +107,11 @@ zCookie, zIpAddr, expires, uid ); cgi_redirect(zGoto); } } - style_header(); + style_header("Login/Logout"); @ %s(zErrMsg) @ <form action="login" method="POST"> if( P("g") ){ @ <input type="hidden" name="nxp" value="%h(P("g"))"> } @@ -244,19 +244,26 @@ case 's': g.okSetup = g.okDelete = 1; case 'a': g.okAdmin = g.okRdTkt = g.okWrTkt = g.okQuery = g.okRdWiki = g.okWrWiki = g.okNewTkt = g.okPassword = 1; case 'i': g.okRead = g.okWrite = 1; break; - case 'd': g.okDelete = 1; break; - case 'j': g.okRdWiki = 1; break; - case 'k': g.okWrWiki = g.okRdWiki = 1; break; - case 'n': g.okNewTkt = 1; break; case 'o': g.okRead = 1; break; + + case 'd': g.okDelete = 1; break; case 'p': g.okPassword = 1; break; case 'q': g.okQuery = 1; break; + + case 'j': g.okRdWiki = 1; break; + case 'k': g.okWrWiki = g.okRdWiki = g.okApndWiki =1; break; + case 'm': g.okApndWiki = 1; break; + case 'f': g.okNewWiki = 1; break; + case 'r': g.okRdTkt = 1; break; - case 'w': g.okWrTkt = g.okRdTkt = g.okNewTkt = 1; break; + case 'n': g.okNewTkt = 1; break; + case 'w': g.okWrTkt = g.okRdTkt = g.okNewTkt = + g.okApndTkt = 1; break; + case 'c': g.okApndTkt = 1; break; } } } /*
Modified src/main.c from [3326d06274] to [e0071db8be].
@@ -87,13 +87,16 @@ int okRead; /* xfer outbound */ int okWrite; /* xfer inbound */ int okSetup; /* use Setup screens on web interface */ int okRdTkt; /* view tickets via web */ int okWrTkt; /* make changes to tickets via web */ + int okNewTkt; /* create new tickets */ + int okApndTkt; /* append to tickets via the web */ int okRdWiki; /* view wiki via web */ int okWrWiki; /* edit wiki via web */ - int okNewTkt; /* create new tickets */ + int okNewWiki; /* create new wiki via web */ + int okApndWiki; /* append to wiki via web */ int okPassword; /* change password */ int okAdmin; /* administrative permission */ int okDelete; /* delete wiki or tickets */ int okQuery; /* create new reports */
Modified src/setup.c from [73c8a12ccc] to [91d49b89a0].
@@ -57,13 +57,11 @@ login_check_credentials(); 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", "Control access settings."); @@ -89,13 +87,11 @@ login_needed(); 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> @ <th> Capabilities </th> @@ -157,11 +153,11 @@ ** WEBPAGE: /setup_uedit */ 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 */ @@ -206,20 +202,28 @@ int ap = P("ap")!=0; 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'; } if( ar ){ zCap[i++] = 'r'; } @@ -233,11 +237,11 @@ } 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> style_footer(); @@ -255,20 +259,24 @@ /* Load the existing information about the user, if any */ 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"; if( strchr(zCap, 'r') ) oar = " checked"; @@ -277,15 +285,14 @@ } /* 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> @ <tr> @@ -305,24 +312,27 @@ @ <td><input type="text" name="info" size=40 value="%h(zInfo)"></td> @ </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> @ <td><input type="password" name="pw" value=""></td> @@ -341,15 +351,10 @@ @ User %h(zId) has Setup privileges and you only have Admin privileges @ 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 @ users. This capability is intended for deletion of spam. @@ -450,13 +455,12 @@ login_check_credentials(); 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", "authenticate-localhost", "localauth", 1); @@ -491,13 +495,12 @@ login_check_credentials(); 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", ""); @ <p>The name of a wiki file that is the homepage for the website.
Modified src/style.c from [b4958eee41] to [7b2fdcfed5].
@@ -67,31 +67,36 @@ } /* ** Draw the header. */ -void style_header(void){ +void style_header(const char *zTitle){ const char *zLogInOut = "Logout"; login_check_credentials(); @ <html> @ <body bgcolor="white"> @ <hr size="1"> @ <table border="0" cellpadding="0" cellspacing="0" width="100%%"> @ <tr><td valign="top" align="left"> - @ <big><big><b>Fossil SCM</b></big></big><br> + @ <big><big><b>%s(zTitle)</b></big></big><br> if( g.zLogin==0 || g.zLogin[0]==0 ){ @ <small>not logged in</small> zLogInOut = "Login"; }else{ @ <small>logged in as %h(g.zLogin)</small> } @ </td><td valign="top" align="right"> @ <a href="%s(g.zBaseURL)/index">Home</a> @ | <a href="%s(g.zBaseURL)/timeline">Timeline</a> + if( g.okRdWiki ){ + @ | <a href="%s(g.zBaseURL)/wiki">Wiki</a> + } +#if 0 @ | <font color="#888888">Search</font> @ | <font color="#888888">Ticket</font> @ | <font color="#888888">Reports</font> +#endif if( g.okSetup ){ @ | <a href="%s(g.zBaseURL)/setup">Setup</a> } if( !g.noPswd ){ @ | <a href="%s(g.zBaseURL)/login">%s(zLogInOut)</a> @@ -125,18 +130,18 @@ ** WEBPAGE: index ** WEBPAGE: home ** WEBPAGE: not_found */ void page_index(void){ - style_header(); + style_header("Main Title Page"); @ This will become the title page style_footer(); } /* ** WEBPAGE: test_env */ void page_test_env(void){ - style_header(); + style_header("Environment Test"); cgi_print_all(); style_footer(); }
Modified src/timeline.c from [5b214b819f] to [cd16841a59].
@@ -52,23 +52,21 @@ ** WEBPAGE: timeline */ void page_timeline(void){ Stmt q; char zPrevDate[20]; - style_header(); + style_header("Timeline"); zPrevDate[0] = 0; db_prepare(&q, - "SELECT rid, type, uuid, datetime(ctime,'unixepoch','localtime'), comment" - " FROM record" - " WHERE NOT phantom AND NOT cancel" - " AND type IN ('v')" - " ORDER BY ctime DESC" - " LIMIT 100" + "SELECT uuid, datetime(event.mtime,'localtime'), comment" + " FROM event, blob" + " WHERE event.type='ci' AND blob.rid=event.objid" + " ORDER BY event.mtime DESC" ); @ <table cellspacing=0 border=0 cellpadding=0> while( db_step(&q)==SQLITE_ROW ){ - const char *zDate = db_column_text(&q, 3); + const char *zDate = db_column_text(&q, 1); if( memcmp(zDate, zPrevDate, 10) ){ sprintf(zPrevDate, "%.10s", zDate); @ <tr><td colspan=3> @ <table cellpadding=2 border=0> @ <tr><td bgcolor="#a0b5f4" class="border1"> @@ -79,12 +77,12 @@ @ </td></tr> } @ <tr><td valign="top">%s(&zDate[11])</td> @ <td width="20"></td> @ <td valign="top" align="left"> - hyperlink_to_uuid(db_column_text(&q,2)); - @ %s(db_column_text(&q,4))</td> + hyperlink_to_uuid(db_column_text(&q,0)); + @ %s(db_column_text(&q,2))</td> } db_finalize(&q); @ </table> style_footer(); }
Modified src/wiki.c from [5d70c36fe5] to [b7ab86df2b].
@@ -32,9 +32,9 @@ ** ** Render the wiki page that is named after the /wiki/ part of ** the url. */ void wiki_page(void){ - style_header(); + style_header("Wiki"); @ extra=%h(g.zExtra) style_footer(); }