Fossil SCM
Add the new "reader" role, analogous to "developer".
Commit
355ee475554304a88afe5f11c4ad74a3d12aa9e9
Parent
0baf4be679ea8d5…
2 files changed
+13
-2
+26
-3
+13
-2
| --- src/login.c | ||
| +++ src/login.c | ||
| @@ -336,10 +336,11 @@ | ||
| 336 | 336 | /* |
| 337 | 337 | ** Set the global capability flags based on a capability string. |
| 338 | 338 | */ |
| 339 | 339 | void login_set_capabilities(const char *zCap){ |
| 340 | 340 | static char *zDev = 0; |
| 341 | + static char *zUser = 0; | |
| 341 | 342 | int i; |
| 342 | 343 | for(i=0; zCap[i]; i++){ |
| 343 | 344 | switch( zCap[i] ){ |
| 344 | 345 | case 's': g.okSetup = 1; /* Fall thru into Admin */ |
| 345 | 346 | case 'a': g.okAdmin = g.okRdTkt = g.okWrTkt = |
| @@ -366,10 +367,20 @@ | ||
| 366 | 367 | case 'n': g.okNewTkt = 1; break; |
| 367 | 368 | case 'w': g.okWrTkt = g.okRdTkt = g.okNewTkt = |
| 368 | 369 | g.okApndTkt = 1; break; |
| 369 | 370 | case 'c': g.okApndTkt = 1; break; |
| 370 | 371 | case 't': g.okTktFmt = 1; break; |
| 372 | + | |
| 373 | + /* The "u" privileges is a little different. It recursively | |
| 374 | + ** inherits all privileges of the user named "reader" */ | |
| 375 | + case 'u': { | |
| 376 | + if( zUser==0 ){ | |
| 377 | + zUser = db_text("", "SELECT cap FROM user WHERE login='reader'"); | |
| 378 | + login_set_capabilities(zUser); | |
| 379 | + } | |
| 380 | + break; | |
| 381 | + } | |
| 371 | 382 | |
| 372 | 383 | /* The "v" privileges is a little different. It recursively |
| 373 | 384 | ** inherits all privileges of the user named "developer" */ |
| 374 | 385 | case 'v': { |
| 375 | 386 | if( zDev==0 ){ |
| @@ -411,12 +422,12 @@ | ||
| 411 | 422 | case 'p': rc = g.okPassword; break; |
| 412 | 423 | /* case 'q': */ |
| 413 | 424 | case 'r': rc = g.okRdTkt; break; |
| 414 | 425 | case 's': rc = g.okSetup; break; |
| 415 | 426 | case 't': rc = g.okTktFmt; break; |
| 416 | - /* case 'u': */ | |
| 417 | - /* case 'v': */ | |
| 427 | + /* case 'u': READER */ | |
| 428 | + /* case 'v': DEVELOPER */ | |
| 418 | 429 | case 'w': rc = g.okWrTkt; break; |
| 419 | 430 | /* case 'x': */ |
| 420 | 431 | /* case 'y': */ |
| 421 | 432 | case 'z': rc = g.okZip; break; |
| 422 | 433 | default: rc = 0; break; |
| 423 | 434 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -336,10 +336,11 @@ | |
| 336 | /* |
| 337 | ** Set the global capability flags based on a capability string. |
| 338 | */ |
| 339 | void login_set_capabilities(const char *zCap){ |
| 340 | static char *zDev = 0; |
| 341 | int i; |
| 342 | for(i=0; zCap[i]; i++){ |
| 343 | switch( zCap[i] ){ |
| 344 | case 's': g.okSetup = 1; /* Fall thru into Admin */ |
| 345 | case 'a': g.okAdmin = g.okRdTkt = g.okWrTkt = |
| @@ -366,10 +367,20 @@ | |
| 366 | case 'n': g.okNewTkt = 1; break; |
| 367 | case 'w': g.okWrTkt = g.okRdTkt = g.okNewTkt = |
| 368 | g.okApndTkt = 1; break; |
| 369 | case 'c': g.okApndTkt = 1; break; |
| 370 | case 't': g.okTktFmt = 1; break; |
| 371 | |
| 372 | /* The "v" privileges is a little different. It recursively |
| 373 | ** inherits all privileges of the user named "developer" */ |
| 374 | case 'v': { |
| 375 | if( zDev==0 ){ |
| @@ -411,12 +422,12 @@ | |
| 411 | case 'p': rc = g.okPassword; break; |
| 412 | /* case 'q': */ |
| 413 | case 'r': rc = g.okRdTkt; break; |
| 414 | case 's': rc = g.okSetup; break; |
| 415 | case 't': rc = g.okTktFmt; break; |
| 416 | /* case 'u': */ |
| 417 | /* case 'v': */ |
| 418 | case 'w': rc = g.okWrTkt; break; |
| 419 | /* case 'x': */ |
| 420 | /* case 'y': */ |
| 421 | case 'z': rc = g.okZip; break; |
| 422 | default: rc = 0; break; |
| 423 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -336,10 +336,11 @@ | |
| 336 | /* |
| 337 | ** Set the global capability flags based on a capability string. |
| 338 | */ |
| 339 | void login_set_capabilities(const char *zCap){ |
| 340 | static char *zDev = 0; |
| 341 | static char *zUser = 0; |
| 342 | int i; |
| 343 | for(i=0; zCap[i]; i++){ |
| 344 | switch( zCap[i] ){ |
| 345 | case 's': g.okSetup = 1; /* Fall thru into Admin */ |
| 346 | case 'a': g.okAdmin = g.okRdTkt = g.okWrTkt = |
| @@ -366,10 +367,20 @@ | |
| 367 | case 'n': g.okNewTkt = 1; break; |
| 368 | case 'w': g.okWrTkt = g.okRdTkt = g.okNewTkt = |
| 369 | g.okApndTkt = 1; break; |
| 370 | case 'c': g.okApndTkt = 1; break; |
| 371 | case 't': g.okTktFmt = 1; break; |
| 372 | |
| 373 | /* The "u" privileges is a little different. It recursively |
| 374 | ** inherits all privileges of the user named "reader" */ |
| 375 | case 'u': { |
| 376 | if( zUser==0 ){ |
| 377 | zUser = db_text("", "SELECT cap FROM user WHERE login='reader'"); |
| 378 | login_set_capabilities(zUser); |
| 379 | } |
| 380 | break; |
| 381 | } |
| 382 | |
| 383 | /* The "v" privileges is a little different. It recursively |
| 384 | ** inherits all privileges of the user named "developer" */ |
| 385 | case 'v': { |
| 386 | if( zDev==0 ){ |
| @@ -411,12 +422,12 @@ | |
| 422 | case 'p': rc = g.okPassword; break; |
| 423 | /* case 'q': */ |
| 424 | case 'r': rc = g.okRdTkt; break; |
| 425 | case 's': rc = g.okSetup; break; |
| 426 | case 't': rc = g.okTktFmt; break; |
| 427 | /* case 'u': READER */ |
| 428 | /* case 'v': DEVELOPER */ |
| 429 | case 'w': rc = g.okWrTkt; break; |
| 430 | /* case 'x': */ |
| 431 | /* case 'y': */ |
| 432 | case 'z': rc = g.okZip; break; |
| 433 | default: rc = 0; break; |
| 434 |
+26
-3
| --- src/setup.c | ||
| +++ src/setup.c | ||
| @@ -172,10 +172,13 @@ | ||
| 172 | 172 | @ <td><i>Read-Tkt:</i> View tickets</td></tr> |
| 173 | 173 | @ <tr><td valign="top"><b>s</b></td> |
| 174 | 174 | @ <td><i>Setup/Super-user:</i> Setup and configure this website</td></tr> |
| 175 | 175 | @ <tr><td valign="top"><b>t</b></td> |
| 176 | 176 | @ <td><i>Tkt-Report:</i> Create new bug summary reports</td></tr> |
| 177 | + @ <tr><td valign="top"><b>u</b></td> | |
| 178 | + @ <td><i>Developer:</i> Inherit privileges of | |
| 179 | + @ user <tt>reader</tt></td></tr> | |
| 177 | 180 | @ <tr><td valign="top"><b>v</b></td> |
| 178 | 181 | @ <td><i>Developer:</i> Inherit privileges of |
| 179 | 182 | @ user <tt>developer</tt></td></tr> |
| 180 | 183 | @ <tr><td valign="top"><b>w</b></td> |
| 181 | 184 | @ <td><i>Write-Tkt:</i> Edit tickets</td></tr> |
| @@ -228,11 +231,11 @@ | ||
| 228 | 231 | */ |
| 229 | 232 | void user_edit(void){ |
| 230 | 233 | const char *zId, *zLogin, *zInfo, *zCap, *zPw; |
| 231 | 234 | char *oaa, *oas, *oar, *oaw, *oan, *oai, *oaj, *oao, *oap; |
| 232 | 235 | char *oak, *oad, *oac, *oaf, *oam, *oah, *oag, *oae; |
| 233 | - char *oat, *oav, *oaz; | |
| 236 | + char *oat, *oau, *oav, *oaz; | |
| 234 | 237 | const char *inherit[128]; |
| 235 | 238 | int doWrite; |
| 236 | 239 | int uid; |
| 237 | 240 | int higherUser = 0; /* True if user being edited is SETUP and the */ |
| 238 | 241 | /* user doing the editing is ADMIN. Disallow editing */ |
| @@ -282,10 +285,11 @@ | ||
| 282 | 285 | int af = P("af")!=0; |
| 283 | 286 | int am = P("am")!=0; |
| 284 | 287 | int ah = P("ah")!=0; |
| 285 | 288 | int ag = P("ag")!=0; |
| 286 | 289 | int at = P("at")!=0; |
| 290 | + int au = P("au")!=0; | |
| 287 | 291 | int av = P("av")!=0; |
| 288 | 292 | int az = P("az")!=0; |
| 289 | 293 | if( aa ){ zCap[i++] = 'a'; } |
| 290 | 294 | if( ac ){ zCap[i++] = 'c'; } |
| 291 | 295 | if( ad ){ zCap[i++] = 'd'; } |
| @@ -301,10 +305,11 @@ | ||
| 301 | 305 | if( ao ){ zCap[i++] = 'o'; } |
| 302 | 306 | if( ap ){ zCap[i++] = 'p'; } |
| 303 | 307 | if( ar ){ zCap[i++] = 'r'; } |
| 304 | 308 | if( as ){ zCap[i++] = 's'; } |
| 305 | 309 | if( at ){ zCap[i++] = 't'; } |
| 310 | + if( au ){ zCap[i++] = 'u'; } | |
| 306 | 311 | if( av ){ zCap[i++] = 'v'; } |
| 307 | 312 | if( aw ){ zCap[i++] = 'w'; } |
| 308 | 313 | if( az ){ zCap[i++] = 'z'; } |
| 309 | 314 | |
| 310 | 315 | zCap[i] = 0; |
| @@ -339,11 +344,11 @@ | ||
| 339 | 344 | zLogin = ""; |
| 340 | 345 | zInfo = ""; |
| 341 | 346 | zCap = ""; |
| 342 | 347 | zPw = ""; |
| 343 | 348 | oaa = oac = oad = oae = oaf = oag = oah = oai = oaj = oak = oam = |
| 344 | - oan = oao = oap = oar = oas = oat = oav = oaw = oaz = ""; | |
| 349 | + oan = oao = oap = oar = oas = oat = oau = oav = oaw = oaz = ""; | |
| 345 | 350 | if( uid ){ |
| 346 | 351 | zLogin = db_text("", "SELECT login FROM user WHERE uid=%d", uid); |
| 347 | 352 | zInfo = db_text("", "SELECT info FROM user WHERE uid=%d", uid); |
| 348 | 353 | zCap = db_text("", "SELECT cap FROM user WHERE uid=%d", uid); |
| 349 | 354 | zPw = db_text("", "SELECT pw FROM user WHERE uid=%d", uid); |
| @@ -362,10 +367,11 @@ | ||
| 362 | 367 | if( strchr(zCap, 'o') ) oao = " checked"; |
| 363 | 368 | if( strchr(zCap, 'p') ) oap = " checked"; |
| 364 | 369 | if( strchr(zCap, 'r') ) oar = " checked"; |
| 365 | 370 | if( strchr(zCap, 's') ) oas = " checked"; |
| 366 | 371 | if( strchr(zCap, 't') ) oat = " checked"; |
| 372 | + if( strchr(zCap, 'u') ) oau = " checked"; | |
| 367 | 373 | if( strchr(zCap, 'v') ) oav = " checked"; |
| 368 | 374 | if( strchr(zCap, 'w') ) oaw = " checked"; |
| 369 | 375 | if( strchr(zCap, 'z') ) oaz = " checked"; |
| 370 | 376 | } |
| 371 | 377 | |
| @@ -376,10 +382,18 @@ | ||
| 376 | 382 | z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='developer'"); |
| 377 | 383 | while( z1 && *z1 ){ |
| 378 | 384 | inherit[0x7f & *(z1++)] = "<font color=\"red\">•</font>"; |
| 379 | 385 | } |
| 380 | 386 | free(z2); |
| 387 | + } | |
| 388 | + if( strcmp(zLogin, "reader") ){ | |
| 389 | + char *z1, *z2; | |
| 390 | + z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='reader'"); | |
| 391 | + while( z1 && *z1 ){ | |
| 392 | + inherit[0x7f & *(z1++)] = "<font color=\"black\">•</font>"; | |
| 393 | + } | |
| 394 | + free(z2); | |
| 381 | 395 | } |
| 382 | 396 | if( strcmp(zLogin, "anonymous") ){ |
| 383 | 397 | char *z1, *z2; |
| 384 | 398 | z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='anonymous'"); |
| 385 | 399 | while( z1 && *z1 ){ |
| @@ -436,10 +450,11 @@ | ||
| 436 | 450 | @ <input type="checkbox" name="ae"%s(oae)>%s(B('e'))Email</input><br> |
| 437 | 451 | @ <input type="checkbox" name="ap"%s(oap)>%s(B('p'))Password</input><br> |
| 438 | 452 | @ <input type="checkbox" name="ai"%s(oai)>%s(B('i'))Check-In</input><br> |
| 439 | 453 | @ <input type="checkbox" name="ao"%s(oao)>%s(B('o'))Check-Out</input><br> |
| 440 | 454 | @ <input type="checkbox" name="ah"%s(oah)>%s(B('h'))History</input><br> |
| 455 | + @ <input type="checkbox" name="au"%s(oau)>%s(B('u'))Reader</input><br> | |
| 441 | 456 | @ <input type="checkbox" name="av"%s(oav)>%s(B('v'))Developer</input><br> |
| 442 | 457 | @ <input type="checkbox" name="ag"%s(oag)>%s(B('g'))Clone</input><br> |
| 443 | 458 | @ <input type="checkbox" name="aj"%s(oaj)>%s(B('j'))Read Wiki</input><br> |
| 444 | 459 | @ <input type="checkbox" name="af"%s(oaf)>%s(B('f'))New Wiki</input><br> |
| 445 | 460 | @ <input type="checkbox" name="am"%s(oam)>%s(B('m'))Append Wiki</input><br> |
| @@ -503,10 +518,16 @@ | ||
| 503 | 518 | @ The "<font color="red"><big>•</big></font>" mark indicates |
| 504 | 519 | @ the privileges of "developer" that are inherited by all users with |
| 505 | 520 | @ the <b>Developer</b> privilege. |
| 506 | 521 | @ </p></li> |
| 507 | 522 | @ |
| 523 | + @ <li><p> | |
| 524 | + @ The "<font color="black"><big>•</big></font>" mark indicates | |
| 525 | + @ the privileges of "reader" that are inherited by all users with | |
| 526 | + @ the <b>Reader</b> privilege. | |
| 527 | + @ </p></li> | |
| 528 | + @ | |
| 508 | 529 | @ <li><p> |
| 509 | 530 | @ The <b>Delete</b> privilege give the user the ability to erase |
| 510 | 531 | @ wiki, tickets, and attachments that have been added by anonymous |
| 511 | 532 | @ users. This capability is intended for deletion of spam. The |
| 512 | 533 | @ delete capability is only in effect for 24 hours after the item |
| @@ -590,11 +611,13 @@ | ||
| 590 | 611 | @ |
| 591 | 612 | @ <li><p> |
| 592 | 613 | @ The "<b>developer</b>" user is intended as a template for trusted users |
| 593 | 614 | @ with check-in privileges. When adding new trusted users, simply |
| 594 | 615 | @ select the <b>Developer</b> privilege to cause the new user to inherit |
| 595 | - @ all privileges of the "developer" user. | |
| 616 | + @ all privileges of the "developer" user. Similarly, the "<b>reader</b>" | |
| 617 | + @ user is a template for users who are allowed more access than anonymous, | |
| 618 | + @ but less than a developer. | |
| 596 | 619 | @ </li></p> |
| 597 | 620 | @ </ul> |
| 598 | 621 | @ </form> |
| 599 | 622 | style_footer(); |
| 600 | 623 | } |
| 601 | 624 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -172,10 +172,13 @@ | |
| 172 | @ <td><i>Read-Tkt:</i> View tickets</td></tr> |
| 173 | @ <tr><td valign="top"><b>s</b></td> |
| 174 | @ <td><i>Setup/Super-user:</i> Setup and configure this website</td></tr> |
| 175 | @ <tr><td valign="top"><b>t</b></td> |
| 176 | @ <td><i>Tkt-Report:</i> Create new bug summary reports</td></tr> |
| 177 | @ <tr><td valign="top"><b>v</b></td> |
| 178 | @ <td><i>Developer:</i> Inherit privileges of |
| 179 | @ user <tt>developer</tt></td></tr> |
| 180 | @ <tr><td valign="top"><b>w</b></td> |
| 181 | @ <td><i>Write-Tkt:</i> Edit tickets</td></tr> |
| @@ -228,11 +231,11 @@ | |
| 228 | */ |
| 229 | void user_edit(void){ |
| 230 | const char *zId, *zLogin, *zInfo, *zCap, *zPw; |
| 231 | char *oaa, *oas, *oar, *oaw, *oan, *oai, *oaj, *oao, *oap; |
| 232 | char *oak, *oad, *oac, *oaf, *oam, *oah, *oag, *oae; |
| 233 | char *oat, *oav, *oaz; |
| 234 | const char *inherit[128]; |
| 235 | int doWrite; |
| 236 | int uid; |
| 237 | int higherUser = 0; /* True if user being edited is SETUP and the */ |
| 238 | /* user doing the editing is ADMIN. Disallow editing */ |
| @@ -282,10 +285,11 @@ | |
| 282 | int af = P("af")!=0; |
| 283 | int am = P("am")!=0; |
| 284 | int ah = P("ah")!=0; |
| 285 | int ag = P("ag")!=0; |
| 286 | int at = P("at")!=0; |
| 287 | int av = P("av")!=0; |
| 288 | int az = P("az")!=0; |
| 289 | if( aa ){ zCap[i++] = 'a'; } |
| 290 | if( ac ){ zCap[i++] = 'c'; } |
| 291 | if( ad ){ zCap[i++] = 'd'; } |
| @@ -301,10 +305,11 @@ | |
| 301 | if( ao ){ zCap[i++] = 'o'; } |
| 302 | if( ap ){ zCap[i++] = 'p'; } |
| 303 | if( ar ){ zCap[i++] = 'r'; } |
| 304 | if( as ){ zCap[i++] = 's'; } |
| 305 | if( at ){ zCap[i++] = 't'; } |
| 306 | if( av ){ zCap[i++] = 'v'; } |
| 307 | if( aw ){ zCap[i++] = 'w'; } |
| 308 | if( az ){ zCap[i++] = 'z'; } |
| 309 | |
| 310 | zCap[i] = 0; |
| @@ -339,11 +344,11 @@ | |
| 339 | zLogin = ""; |
| 340 | zInfo = ""; |
| 341 | zCap = ""; |
| 342 | zPw = ""; |
| 343 | oaa = oac = oad = oae = oaf = oag = oah = oai = oaj = oak = oam = |
| 344 | oan = oao = oap = oar = oas = oat = oav = oaw = oaz = ""; |
| 345 | if( uid ){ |
| 346 | zLogin = db_text("", "SELECT login FROM user WHERE uid=%d", uid); |
| 347 | zInfo = db_text("", "SELECT info FROM user WHERE uid=%d", uid); |
| 348 | zCap = db_text("", "SELECT cap FROM user WHERE uid=%d", uid); |
| 349 | zPw = db_text("", "SELECT pw FROM user WHERE uid=%d", uid); |
| @@ -362,10 +367,11 @@ | |
| 362 | if( strchr(zCap, 'o') ) oao = " checked"; |
| 363 | if( strchr(zCap, 'p') ) oap = " checked"; |
| 364 | if( strchr(zCap, 'r') ) oar = " checked"; |
| 365 | if( strchr(zCap, 's') ) oas = " checked"; |
| 366 | if( strchr(zCap, 't') ) oat = " checked"; |
| 367 | if( strchr(zCap, 'v') ) oav = " checked"; |
| 368 | if( strchr(zCap, 'w') ) oaw = " checked"; |
| 369 | if( strchr(zCap, 'z') ) oaz = " checked"; |
| 370 | } |
| 371 | |
| @@ -376,10 +382,18 @@ | |
| 376 | z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='developer'"); |
| 377 | while( z1 && *z1 ){ |
| 378 | inherit[0x7f & *(z1++)] = "<font color=\"red\">•</font>"; |
| 379 | } |
| 380 | free(z2); |
| 381 | } |
| 382 | if( strcmp(zLogin, "anonymous") ){ |
| 383 | char *z1, *z2; |
| 384 | z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='anonymous'"); |
| 385 | while( z1 && *z1 ){ |
| @@ -436,10 +450,11 @@ | |
| 436 | @ <input type="checkbox" name="ae"%s(oae)>%s(B('e'))Email</input><br> |
| 437 | @ <input type="checkbox" name="ap"%s(oap)>%s(B('p'))Password</input><br> |
| 438 | @ <input type="checkbox" name="ai"%s(oai)>%s(B('i'))Check-In</input><br> |
| 439 | @ <input type="checkbox" name="ao"%s(oao)>%s(B('o'))Check-Out</input><br> |
| 440 | @ <input type="checkbox" name="ah"%s(oah)>%s(B('h'))History</input><br> |
| 441 | @ <input type="checkbox" name="av"%s(oav)>%s(B('v'))Developer</input><br> |
| 442 | @ <input type="checkbox" name="ag"%s(oag)>%s(B('g'))Clone</input><br> |
| 443 | @ <input type="checkbox" name="aj"%s(oaj)>%s(B('j'))Read Wiki</input><br> |
| 444 | @ <input type="checkbox" name="af"%s(oaf)>%s(B('f'))New Wiki</input><br> |
| 445 | @ <input type="checkbox" name="am"%s(oam)>%s(B('m'))Append Wiki</input><br> |
| @@ -503,10 +518,16 @@ | |
| 503 | @ The "<font color="red"><big>•</big></font>" mark indicates |
| 504 | @ the privileges of "developer" that are inherited by all users with |
| 505 | @ the <b>Developer</b> privilege. |
| 506 | @ </p></li> |
| 507 | @ |
| 508 | @ <li><p> |
| 509 | @ The <b>Delete</b> privilege give the user the ability to erase |
| 510 | @ wiki, tickets, and attachments that have been added by anonymous |
| 511 | @ users. This capability is intended for deletion of spam. The |
| 512 | @ delete capability is only in effect for 24 hours after the item |
| @@ -590,11 +611,13 @@ | |
| 590 | @ |
| 591 | @ <li><p> |
| 592 | @ The "<b>developer</b>" user is intended as a template for trusted users |
| 593 | @ with check-in privileges. When adding new trusted users, simply |
| 594 | @ select the <b>Developer</b> privilege to cause the new user to inherit |
| 595 | @ all privileges of the "developer" user. |
| 596 | @ </li></p> |
| 597 | @ </ul> |
| 598 | @ </form> |
| 599 | style_footer(); |
| 600 | } |
| 601 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -172,10 +172,13 @@ | |
| 172 | @ <td><i>Read-Tkt:</i> View tickets</td></tr> |
| 173 | @ <tr><td valign="top"><b>s</b></td> |
| 174 | @ <td><i>Setup/Super-user:</i> Setup and configure this website</td></tr> |
| 175 | @ <tr><td valign="top"><b>t</b></td> |
| 176 | @ <td><i>Tkt-Report:</i> Create new bug summary reports</td></tr> |
| 177 | @ <tr><td valign="top"><b>u</b></td> |
| 178 | @ <td><i>Developer:</i> Inherit privileges of |
| 179 | @ user <tt>reader</tt></td></tr> |
| 180 | @ <tr><td valign="top"><b>v</b></td> |
| 181 | @ <td><i>Developer:</i> Inherit privileges of |
| 182 | @ user <tt>developer</tt></td></tr> |
| 183 | @ <tr><td valign="top"><b>w</b></td> |
| 184 | @ <td><i>Write-Tkt:</i> Edit tickets</td></tr> |
| @@ -228,11 +231,11 @@ | |
| 231 | */ |
| 232 | void user_edit(void){ |
| 233 | const char *zId, *zLogin, *zInfo, *zCap, *zPw; |
| 234 | char *oaa, *oas, *oar, *oaw, *oan, *oai, *oaj, *oao, *oap; |
| 235 | char *oak, *oad, *oac, *oaf, *oam, *oah, *oag, *oae; |
| 236 | char *oat, *oau, *oav, *oaz; |
| 237 | const char *inherit[128]; |
| 238 | int doWrite; |
| 239 | int uid; |
| 240 | int higherUser = 0; /* True if user being edited is SETUP and the */ |
| 241 | /* user doing the editing is ADMIN. Disallow editing */ |
| @@ -282,10 +285,11 @@ | |
| 285 | int af = P("af")!=0; |
| 286 | int am = P("am")!=0; |
| 287 | int ah = P("ah")!=0; |
| 288 | int ag = P("ag")!=0; |
| 289 | int at = P("at")!=0; |
| 290 | int au = P("au")!=0; |
| 291 | int av = P("av")!=0; |
| 292 | int az = P("az")!=0; |
| 293 | if( aa ){ zCap[i++] = 'a'; } |
| 294 | if( ac ){ zCap[i++] = 'c'; } |
| 295 | if( ad ){ zCap[i++] = 'd'; } |
| @@ -301,10 +305,11 @@ | |
| 305 | if( ao ){ zCap[i++] = 'o'; } |
| 306 | if( ap ){ zCap[i++] = 'p'; } |
| 307 | if( ar ){ zCap[i++] = 'r'; } |
| 308 | if( as ){ zCap[i++] = 's'; } |
| 309 | if( at ){ zCap[i++] = 't'; } |
| 310 | if( au ){ zCap[i++] = 'u'; } |
| 311 | if( av ){ zCap[i++] = 'v'; } |
| 312 | if( aw ){ zCap[i++] = 'w'; } |
| 313 | if( az ){ zCap[i++] = 'z'; } |
| 314 | |
| 315 | zCap[i] = 0; |
| @@ -339,11 +344,11 @@ | |
| 344 | zLogin = ""; |
| 345 | zInfo = ""; |
| 346 | zCap = ""; |
| 347 | zPw = ""; |
| 348 | oaa = oac = oad = oae = oaf = oag = oah = oai = oaj = oak = oam = |
| 349 | oan = oao = oap = oar = oas = oat = oau = oav = oaw = oaz = ""; |
| 350 | if( uid ){ |
| 351 | zLogin = db_text("", "SELECT login FROM user WHERE uid=%d", uid); |
| 352 | zInfo = db_text("", "SELECT info FROM user WHERE uid=%d", uid); |
| 353 | zCap = db_text("", "SELECT cap FROM user WHERE uid=%d", uid); |
| 354 | zPw = db_text("", "SELECT pw FROM user WHERE uid=%d", uid); |
| @@ -362,10 +367,11 @@ | |
| 367 | if( strchr(zCap, 'o') ) oao = " checked"; |
| 368 | if( strchr(zCap, 'p') ) oap = " checked"; |
| 369 | if( strchr(zCap, 'r') ) oar = " checked"; |
| 370 | if( strchr(zCap, 's') ) oas = " checked"; |
| 371 | if( strchr(zCap, 't') ) oat = " checked"; |
| 372 | if( strchr(zCap, 'u') ) oau = " checked"; |
| 373 | if( strchr(zCap, 'v') ) oav = " checked"; |
| 374 | if( strchr(zCap, 'w') ) oaw = " checked"; |
| 375 | if( strchr(zCap, 'z') ) oaz = " checked"; |
| 376 | } |
| 377 | |
| @@ -376,10 +382,18 @@ | |
| 382 | z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='developer'"); |
| 383 | while( z1 && *z1 ){ |
| 384 | inherit[0x7f & *(z1++)] = "<font color=\"red\">•</font>"; |
| 385 | } |
| 386 | free(z2); |
| 387 | } |
| 388 | if( strcmp(zLogin, "reader") ){ |
| 389 | char *z1, *z2; |
| 390 | z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='reader'"); |
| 391 | while( z1 && *z1 ){ |
| 392 | inherit[0x7f & *(z1++)] = "<font color=\"black\">•</font>"; |
| 393 | } |
| 394 | free(z2); |
| 395 | } |
| 396 | if( strcmp(zLogin, "anonymous") ){ |
| 397 | char *z1, *z2; |
| 398 | z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='anonymous'"); |
| 399 | while( z1 && *z1 ){ |
| @@ -436,10 +450,11 @@ | |
| 450 | @ <input type="checkbox" name="ae"%s(oae)>%s(B('e'))Email</input><br> |
| 451 | @ <input type="checkbox" name="ap"%s(oap)>%s(B('p'))Password</input><br> |
| 452 | @ <input type="checkbox" name="ai"%s(oai)>%s(B('i'))Check-In</input><br> |
| 453 | @ <input type="checkbox" name="ao"%s(oao)>%s(B('o'))Check-Out</input><br> |
| 454 | @ <input type="checkbox" name="ah"%s(oah)>%s(B('h'))History</input><br> |
| 455 | @ <input type="checkbox" name="au"%s(oau)>%s(B('u'))Reader</input><br> |
| 456 | @ <input type="checkbox" name="av"%s(oav)>%s(B('v'))Developer</input><br> |
| 457 | @ <input type="checkbox" name="ag"%s(oag)>%s(B('g'))Clone</input><br> |
| 458 | @ <input type="checkbox" name="aj"%s(oaj)>%s(B('j'))Read Wiki</input><br> |
| 459 | @ <input type="checkbox" name="af"%s(oaf)>%s(B('f'))New Wiki</input><br> |
| 460 | @ <input type="checkbox" name="am"%s(oam)>%s(B('m'))Append Wiki</input><br> |
| @@ -503,10 +518,16 @@ | |
| 518 | @ The "<font color="red"><big>•</big></font>" mark indicates |
| 519 | @ the privileges of "developer" that are inherited by all users with |
| 520 | @ the <b>Developer</b> privilege. |
| 521 | @ </p></li> |
| 522 | @ |
| 523 | @ <li><p> |
| 524 | @ The "<font color="black"><big>•</big></font>" mark indicates |
| 525 | @ the privileges of "reader" that are inherited by all users with |
| 526 | @ the <b>Reader</b> privilege. |
| 527 | @ </p></li> |
| 528 | @ |
| 529 | @ <li><p> |
| 530 | @ The <b>Delete</b> privilege give the user the ability to erase |
| 531 | @ wiki, tickets, and attachments that have been added by anonymous |
| 532 | @ users. This capability is intended for deletion of spam. The |
| 533 | @ delete capability is only in effect for 24 hours after the item |
| @@ -590,11 +611,13 @@ | |
| 611 | @ |
| 612 | @ <li><p> |
| 613 | @ The "<b>developer</b>" user is intended as a template for trusted users |
| 614 | @ with check-in privileges. When adding new trusted users, simply |
| 615 | @ select the <b>Developer</b> privilege to cause the new user to inherit |
| 616 | @ all privileges of the "developer" user. Similarly, the "<b>reader</b>" |
| 617 | @ user is a template for users who are allowed more access than anonymous, |
| 618 | @ but less than a developer. |
| 619 | @ </li></p> |
| 620 | @ </ul> |
| 621 | @ </form> |
| 622 | style_footer(); |
| 623 | } |
| 624 |