Hex Artifact Content
Not logged in

Artifact f186580b82c2c19200a1114809865586f56659ad:

File src/setup.c part of check-in [13b7ac16e4] - Require history permission in order to clone. by drh on 2007-08-09 10:43:39.

0000: 2f 2a 0a 2a 2a 20 43 6f 70 79 72 69 67 68 74 20  /*.** Copyright 
0010: 28 63 29 20 32 30 30 37 20 44 2e 20 52 69 63 68  (c) 2007 D. Rich
0020: 61 72 64 20 48 69 70 70 0a 2a 2a 0a 2a 2a 20 54  ard Hipp.**.** T
0030: 68 69 73 20 70 72 6f 67 72 61 6d 20 69 73 20 66  his program is f
0040: 72 65 65 20 73 6f 66 74 77 61 72 65 3b 20 79 6f  ree software; yo
0050: 75 20 63 61 6e 20 72 65 64 69 73 74 72 69 62 75  u can redistribu
0060: 74 65 20 69 74 20 61 6e 64 2f 6f 72 0a 2a 2a 20  te it and/or.** 
0070: 6d 6f 64 69 66 79 20 69 74 20 75 6e 64 65 72 20  modify it under 
0080: 74 68 65 20 74 65 72 6d 73 20 6f 66 20 74 68 65  the terms of the
0090: 20 47 4e 55 20 47 65 6e 65 72 61 6c 20 50 75 62   GNU General Pub
00a0: 6c 69 63 0a 2a 2a 20 4c 69 63 65 6e 73 65 20 61  lic.** License a
00b0: 73 20 70 75 62 6c 69 73 68 65 64 20 62 79 20 74  s published by t
00c0: 68 65 20 46 72 65 65 20 53 6f 66 74 77 61 72 65  he Free Software
00d0: 20 46 6f 75 6e 64 61 74 69 6f 6e 3b 20 65 69 74   Foundation; eit
00e0: 68 65 72 0a 2a 2a 20 76 65 72 73 69 6f 6e 20 32  her.** version 2
00f0: 20 6f 66 20 74 68 65 20 4c 69 63 65 6e 73 65 2c   of the License,
0100: 20 6f 72 20 28 61 74 20 79 6f 75 72 20 6f 70 74   or (at your opt
0110: 69 6f 6e 29 20 61 6e 79 20 6c 61 74 65 72 20 76  ion) any later v
0120: 65 72 73 69 6f 6e 2e 0a 2a 2a 0a 2a 2a 20 54 68  ersion..**.** Th
0130: 69 73 20 70 72 6f 67 72 61 6d 20 69 73 20 64 69  is program is di
0140: 73 74 72 69 62 75 74 65 64 20 69 6e 20 74 68 65  stributed in the
0150: 20 68 6f 70 65 20 74 68 61 74 20 69 74 20 77 69   hope that it wi
0160: 6c 6c 20 62 65 20 75 73 65 66 75 6c 2c 0a 2a 2a  ll be useful,.**
0170: 20 62 75 74 20 57 49 54 48 4f 55 54 20 41 4e 59   but WITHOUT ANY
0180: 20 57 41 52 52 41 4e 54 59 3b 20 77 69 74 68 6f   WARRANTY; witho
0190: 75 74 20 65 76 65 6e 20 74 68 65 20 69 6d 70 6c  ut even the impl
01a0: 69 65 64 20 77 61 72 72 61 6e 74 79 20 6f 66 0a  ied warranty of.
01b0: 2a 2a 20 4d 45 52 43 48 41 4e 54 41 42 49 4c 49  ** MERCHANTABILI
01c0: 54 59 20 6f 72 20 46 49 54 4e 45 53 53 20 46 4f  TY or FITNESS FO
01d0: 52 20 41 20 50 41 52 54 49 43 55 4c 41 52 20 50  R A PARTICULAR P
01e0: 55 52 50 4f 53 45 2e 20 20 53 65 65 20 74 68 65  URPOSE.  See the
01f0: 20 47 4e 55 0a 2a 2a 20 47 65 6e 65 72 61 6c 20   GNU.** General 
0200: 50 75 62 6c 69 63 20 4c 69 63 65 6e 73 65 20 66  Public License f
0210: 6f 72 20 6d 6f 72 65 20 64 65 74 61 69 6c 73 2e  or more details.
0220: 0a 2a 2a 20 0a 2a 2a 20 59 6f 75 20 73 68 6f 75  .** .** You shou
0230: 6c 64 20 68 61 76 65 20 72 65 63 65 69 76 65 64  ld have received
0240: 20 61 20 63 6f 70 79 20 6f 66 20 74 68 65 20 47   a copy of the G
0250: 4e 55 20 47 65 6e 65 72 61 6c 20 50 75 62 6c 69  NU General Publi
0260: 63 0a 2a 2a 20 4c 69 63 65 6e 73 65 20 61 6c 6f  c.** License alo
0270: 6e 67 20 77 69 74 68 20 74 68 69 73 20 6c 69 62  ng with this lib
0280: 72 61 72 79 3b 20 69 66 20 6e 6f 74 2c 20 77 72  rary; if not, wr
0290: 69 74 65 20 74 6f 20 74 68 65 0a 2a 2a 20 46 72  ite to the.** Fr
02a0: 65 65 20 53 6f 66 74 77 61 72 65 20 46 6f 75 6e  ee Software Foun
02b0: 64 61 74 69 6f 6e 2c 20 49 6e 63 2e 2c 20 35 39  dation, Inc., 59
02c0: 20 54 65 6d 70 6c 65 20 50 6c 61 63 65 20 2d 20   Temple Place - 
02d0: 53 75 69 74 65 20 33 33 30 2c 0a 2a 2a 20 42 6f  Suite 330,.** Bo
02e0: 73 74 6f 6e 2c 20 4d 41 20 20 30 32 31 31 31 2d  ston, MA  02111-
02f0: 31 33 30 37 2c 20 55 53 41 2e 0a 2a 2a 0a 2a 2a  1307, USA..**.**
0300: 20 41 75 74 68 6f 72 20 63 6f 6e 74 61 63 74 20   Author contact 
0310: 69 6e 66 6f 72 6d 61 74 69 6f 6e 3a 0a 2a 2a 20  information:.** 
0320: 20 20 64 72 68 40 68 77 61 63 69 2e 63 6f 6d 0a    drh@hwaci.com.
0330: 2a 2a 20 20 20 68 74 74 70 3a 2f 2f 77 77 77 2e  **   http://www.
0340: 68 77 61 63 69 2e 63 6f 6d 2f 64 72 68 2f 0a 2a  hwaci.com/drh/.*
0350: 2a 0a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a  *.**************
0360: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a  ****************
0370: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a  ****************
0380: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a  ****************
0390: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a  ****************
03a0: 2a 0a 2a 2a 0a 2a 2a 20 49 6d 70 6c 65 6d 65 6e  *.**.** Implemen
03b0: 74 61 74 69 6f 6e 20 6f 66 20 74 68 65 20 53 65  tation of the Se
03c0: 74 75 70 20 70 61 67 65 0a 2a 2f 0a 23 69 6e 63  tup page.*/.#inc
03d0: 6c 75 64 65 20 3c 61 73 73 65 72 74 2e 68 3e 0a  lude <assert.h>.
03e0: 23 69 6e 63 6c 75 64 65 20 22 63 6f 6e 66 69 67  #include "config
03f0: 2e 68 22 0a 23 69 6e 63 6c 75 64 65 20 22 73 65  .h".#include "se
0400: 74 75 70 2e 68 22 0a 0a 0a 2f 2a 0a 2a 2a 20 4f  tup.h".../*.** O
0410: 75 74 70 75 74 20 61 20 73 69 6e 67 6c 65 20 65  utput a single e
0420: 6e 74 72 79 20 66 6f 72 20 61 20 6d 65 6e 75 20  ntry for a menu 
0430: 67 65 6e 65 72 61 74 65 64 20 75 73 69 6e 67 20  generated using 
0440: 61 6e 20 48 54 4d 4c 20 74 61 62 6c 65 2e 0a 2a  an HTML table..*
0450: 2a 20 49 66 20 7a 4c 69 6e 6b 20 69 73 20 6e 6f  * If zLink is no
0460: 74 20 4e 55 4c 4c 20 6f 72 20 61 6e 20 65 6d 70  t NULL or an emp
0470: 74 79 20 73 74 72 69 6e 67 2c 20 74 68 65 6e 20  ty string, then 
0480: 69 74 20 69 73 20 74 68 65 20 70 61 67 65 20 74  it is the page t
0490: 68 61 74 0a 2a 2a 20 74 68 65 20 6d 65 6e 75 20  hat.** the menu 
04a0: 65 6e 74 72 79 20 77 69 6c 6c 20 68 79 70 65 72  entry will hyper
04b0: 6c 69 6e 6b 20 74 6f 2e 20 20 49 66 20 7a 4c 69  link to.  If zLi
04c0: 6e 6b 20 69 73 20 4e 55 4c 4c 20 6f 72 20 22 22  nk is NULL or ""
04d0: 2c 20 74 68 65 6e 0a 2a 2a 20 74 68 65 20 6d 65  , then.** the me
04e0: 6e 75 20 65 6e 74 72 79 20 68 61 73 20 6e 6f 20  nu entry has no 
04f0: 68 79 70 65 72 6c 69 6e 6b 20 2d 20 69 74 20 69  hyperlink - it i
0500: 73 20 64 69 73 61 62 6c 65 64 2e 0a 2a 2f 0a 73  s disabled..*/.s
0510: 74 61 74 69 63 20 76 6f 69 64 20 6d 65 6e 75 5f  tatic void menu_
0520: 65 6e 74 72 79 28 0a 20 20 63 6f 6e 73 74 20 63  entry(.  const c
0530: 68 61 72 20 2a 7a 54 69 74 6c 65 2c 0a 20 20 63  har *zTitle,.  c
0540: 6f 6e 73 74 20 63 68 61 72 20 2a 7a 4c 69 6e 6b  onst char *zLink
0550: 2c 0a 20 20 63 6f 6e 73 74 20 63 68 61 72 20 2a  ,.  const char *
0560: 7a 44 65 73 63 0a 29 7b 0a 20 20 40 20 3c 64 74  zDesc.){.  @ <dt
0570: 3e 0a 20 20 69 66 28 20 7a 4c 69 6e 6b 20 26 26  >.  if( zLink &&
0580: 20 7a 4c 69 6e 6b 5b 30 5d 20 29 7b 0a 20 20 20   zLink[0] ){.   
0590: 20 40 20 3c 61 20 68 72 65 66 3d 22 25 73 28 7a   @ <a href="%s(z
05a0: 4c 69 6e 6b 29 22 3e 25 68 28 7a 54 69 74 6c 65  Link)">%h(zTitle
05b0: 29 3c 2f 61 3e 0a 20 20 7d 65 6c 73 65 7b 0a 20  )</a>.  }else{. 
05c0: 20 20 20 40 20 25 68 28 7a 54 69 74 6c 65 29 0a     @ %h(zTitle).
05d0: 20 20 7d 0a 20 20 40 20 3c 2f 64 74 3e 0a 20 20    }.  @ </dt>.  
05e0: 40 20 3c 64 64 3e 25 68 28 7a 44 65 73 63 29 3c  @ <dd>%h(zDesc)<
05f0: 2f 64 64 3e 0a 7d 0a 0a 2f 2a 0a 2a 2a 20 57 45  /dd>.}../*.** WE
0600: 42 50 41 47 45 3a 20 2f 73 65 74 75 70 0a 2a 2f  BPAGE: /setup.*/
0610: 0a 76 6f 69 64 20 73 65 74 75 70 5f 70 61 67 65  .void setup_page
0620: 28 76 6f 69 64 29 7b 0a 20 20 6c 6f 67 69 6e 5f  (void){.  login_
0630: 63 68 65 63 6b 5f 63 72 65 64 65 6e 74 69 61 6c  check_credential
0640: 73 28 29 3b 0a 20 20 69 66 28 20 21 67 2e 6f 6b  s();.  if( !g.ok
0650: 53 65 74 75 70 20 29 7b 0a 20 20 20 20 6c 6f 67  Setup ){.    log
0660: 69 6e 5f 6e 65 65 64 65 64 28 29 3b 0a 20 20 7d  in_needed();.  }
0670: 0a 0a 20 20 73 74 79 6c 65 5f 68 65 61 64 65 72  ..  style_header
0680: 28 22 53 65 74 75 70 22 29 3b 0a 20 20 40 20 3c  ("Setup");.  @ <
0690: 64 6c 20 69 64 3d 22 73 65 74 75 70 22 3e 0a 20  dl id="setup">. 
06a0: 20 6d 65 6e 75 5f 65 6e 74 72 79 28 22 55 73 65   menu_entry("Use
06b0: 72 73 22 2c 20 22 73 65 74 75 70 5f 75 6c 69 73  rs", "setup_ulis
06c0: 74 22 2c 0a 20 20 20 20 22 47 72 61 6e 74 20 70  t",.    "Grant p
06d0: 72 69 76 69 6c 65 67 65 73 20 74 6f 20 69 6e 64  rivileges to ind
06e0: 69 76 69 64 75 61 6c 20 75 73 65 72 73 2e 22 29  ividual users.")
06f0: 3b 0a 20 20 6d 65 6e 75 5f 65 6e 74 72 79 28 22  ;.  menu_entry("
0700: 41 63 63 65 73 73 22 2c 20 22 73 65 74 75 70 5f  Access", "setup_
0710: 61 63 63 65 73 73 22 2c 0a 20 20 20 20 22 43 6f  access",.    "Co
0720: 6e 74 72 6f 6c 20 61 63 63 65 73 73 20 73 65 74  ntrol access set
0730: 74 69 6e 67 73 2e 22 29 3b 0a 20 20 6d 65 6e 75  tings.");.  menu
0740: 5f 65 6e 74 72 79 28 22 43 6f 6e 66 69 67 75 72  _entry("Configur
0750: 61 74 69 6f 6e 22 2c 20 22 73 65 74 75 70 5f 63  ation", "setup_c
0760: 6f 6e 66 69 67 22 2c 0a 20 20 20 20 22 43 6f 6e  onfig",.    "Con
0770: 66 69 67 75 72 65 20 74 68 65 20 57 57 57 20 63  figure the WWW c
0780: 6f 6d 70 6f 6e 65 6e 74 73 20 6f 66 20 74 68 65  omponents of the
0790: 20 72 65 70 6f 73 69 74 6f 72 79 22 29 3b 0a 20   repository");. 
07a0: 20 40 20 3c 2f 64 6c 3e 0a 0a 20 20 73 74 79 6c   @ </dl>..  styl
07b0: 65 5f 66 6f 6f 74 65 72 28 29 3b 0a 7d 0a 0a 2f  e_footer();.}../
07c0: 2a 0a 2a 2a 20 57 45 42 50 41 47 45 3a 20 73 65  *.** WEBPAGE: se
07d0: 74 75 70 5f 75 6c 69 73 74 0a 2a 2a 0a 2a 2a 20  tup_ulist.**.** 
07e0: 53 68 6f 77 20 61 20 6c 69 73 74 20 6f 66 20 75  Show a list of u
07f0: 73 65 72 73 2e 20 20 43 6c 69 63 6b 69 6e 67 20  sers.  Clicking 
0800: 6f 6e 20 61 6e 79 20 75 73 65 72 20 6a 75 6d 70  on any user jump
0810: 73 20 74 6f 20 74 68 65 20 65 64 69 74 0a 2a 2a  s to the edit.**
0820: 20 73 63 72 65 65 6e 20 66 6f 72 20 74 68 61 74   screen for that
0830: 20 75 73 65 72 2e 0a 2a 2f 0a 76 6f 69 64 20 73   user..*/.void s
0840: 65 74 75 70 5f 75 6c 69 73 74 28 76 6f 69 64 29  etup_ulist(void)
0850: 7b 0a 20 20 53 74 6d 74 20 73 3b 0a 20 20 0a 20  {.  Stmt s;.  . 
0860: 20 73 74 79 6c 65 5f 66 6f 6f 74 65 72 28 29 3b   style_footer();
0870: 0a 20 20 6c 6f 67 69 6e 5f 63 68 65 63 6b 5f 63  .  login_check_c
0880: 72 65 64 65 6e 74 69 61 6c 73 28 29 3b 0a 20 20  redentials();.  
0890: 69 66 28 20 21 67 2e 6f 6b 53 65 74 75 70 20 29  if( !g.okSetup )
08a0: 7b 0a 20 20 20 20 6c 6f 67 69 6e 5f 6e 65 65 64  {.    login_need
08b0: 65 64 28 29 3b 0a 20 20 20 20 72 65 74 75 72 6e  ed();.    return
08c0: 3b 0a 20 20 7d 0a 0a 20 20 73 74 79 6c 65 5f 73  ;.  }..  style_s
08d0: 75 62 6d 65 6e 75 5f 65 6c 65 6d 65 6e 74 28 22  ubmenu_element("
08e0: 41 64 64 22 2c 20 22 41 64 64 20 55 73 65 72 22  Add", "Add User"
08f0: 2c 20 22 73 65 74 75 70 5f 75 65 64 69 74 22 29  , "setup_uedit")
0900: 3b 0a 20 20 73 74 79 6c 65 5f 68 65 61 64 65 72  ;.  style_header
0910: 28 22 55 73 65 72 20 4c 69 73 74 22 29 3b 0a 20  ("User List");. 
0920: 20 40 20 3c 74 61 62 6c 65 20 61 6c 69 67 6e 3d   @ <table align=
0930: 22 6c 65 66 74 22 20 68 73 70 61 63 65 3d 22 31  "left" hspace="1
0940: 30 22 20 62 6f 72 64 65 72 3d 22 31 22 20 63 65  0" border="1" ce
0950: 6c 6c 70 61 64 64 69 6e 67 3d 22 31 30 22 3e 3c  llpadding="10"><
0960: 74 72 3e 3c 74 64 3e 0a 20 20 40 20 3c 74 61 62  tr><td>.  @ <tab
0970: 6c 65 20 63 65 6c 6c 73 70 61 63 69 6e 67 3d 30  le cellspacing=0
0980: 20 63 65 6c 6c 70 61 64 64 69 6e 67 3d 30 20 62   cellpadding=0 b
0990: 6f 72 64 65 72 3d 30 3e 0a 20 20 40 20 3c 74 72  order=0>.  @ <tr
09a0: 3e 0a 20 20 40 20 20 20 3c 74 68 20 61 6c 69 67  >.  @   <th alig
09b0: 6e 3d 22 72 69 67 68 74 22 3e 55 73 65 72 26 6e  n="right">User&n
09c0: 62 73 70 3b 49 44 3c 2f 74 68 3e 0a 20 20 40 20  bsp;ID</th>.  @ 
09d0: 20 20 3c 74 68 3e 26 6e 62 73 70 3b 26 6e 62 73    <th>&nbsp;&nbs
09e0: 70 3b 26 6e 62 73 70 3b 43 61 70 61 62 69 6c 69  p;&nbsp;Capabili
09f0: 74 69 65 73 26 6e 62 73 70 3b 26 6e 62 73 70 3b  ties&nbsp;&nbsp;
0a00: 26 6e 62 73 70 3b 3c 2f 74 68 3e 0a 20 20 40 20  &nbsp;</th>.  @ 
0a10: 20 20 3c 74 68 3e 43 6f 6e 74 61 63 74 26 6e 62    <th>Contact&nb
0a20: 73 70 3b 49 6e 66 6f 3c 2f 74 68 3e 0a 20 20 40  sp;Info</th>.  @
0a30: 20 3c 2f 74 72 3e 0a 20 20 64 62 5f 70 72 65 70   </tr>.  db_prep
0a40: 61 72 65 28 26 73 2c 20 22 53 45 4c 45 43 54 20  are(&s, "SELECT 
0a50: 75 69 64 2c 20 6c 6f 67 69 6e 2c 20 63 61 70 2c  uid, login, cap,
0a60: 20 69 6e 66 6f 20 46 52 4f 4d 20 75 73 65 72 20   info FROM user 
0a70: 4f 52 44 45 52 20 42 59 20 6c 6f 67 69 6e 22 29  ORDER BY login")
0a80: 3b 0a 20 20 77 68 69 6c 65 28 20 64 62 5f 73 74  ;.  while( db_st
0a90: 65 70 28 26 73 29 3d 3d 53 51 4c 49 54 45 5f 52  ep(&s)==SQLITE_R
0aa0: 4f 57 20 29 7b 0a 20 20 20 20 40 20 3c 74 72 3e  OW ){.    @ <tr>
0ab0: 0a 20 20 20 20 40 20 3c 74 64 20 61 6c 69 67 6e  .    @ <td align
0ac0: 3d 22 72 69 67 68 74 22 3e 0a 20 20 20 20 69 66  ="right">.    if
0ad0: 28 20 67 2e 6f 6b 41 64 6d 69 6e 20 29 7b 0a 20  ( g.okAdmin ){. 
0ae0: 20 20 20 20 20 40 20 3c 61 20 68 72 65 66 3d 22       @ <a href="
0af0: 73 65 74 75 70 5f 75 65 64 69 74 3f 69 64 3d 25  setup_uedit?id=%
0b00: 64 28 64 62 5f 63 6f 6c 75 6d 6e 5f 69 6e 74 28  d(db_column_int(
0b10: 26 73 2c 30 29 29 22 3e 0a 20 20 20 20 7d 0a 20  &s,0))">.    }. 
0b20: 20 20 20 40 20 3c 6e 6f 62 72 3e 25 68 28 64 62     @ <nobr>%h(db
0b30: 5f 63 6f 6c 75 6d 6e 5f 74 65 78 74 28 26 73 2c  _column_text(&s,
0b40: 31 29 29 3c 2f 6e 6f 62 72 3e 0a 20 20 20 20 69  1))</nobr>.    i
0b50: 66 28 20 67 2e 6f 6b 41 64 6d 69 6e 20 29 7b 0a  f( g.okAdmin ){.
0b60: 20 20 20 20 20 20 40 20 3c 2f 61 3e 0a 20 20 20        @ </a>.   
0b70: 20 7d 0a 20 20 20 20 40 20 3c 2f 74 64 3e 0a 20   }.    @ </td>. 
0b80: 20 20 20 40 20 3c 74 64 20 61 6c 69 67 6e 3d 22     @ <td align="
0b90: 63 65 6e 74 65 72 22 3e 25 73 28 64 62 5f 63 6f  center">%s(db_co
0ba0: 6c 75 6d 6e 5f 74 65 78 74 28 26 73 2c 32 29 29  lumn_text(&s,2))
0bb0: 3c 2f 74 64 3e 0a 20 20 20 20 40 20 3c 74 64 20  </td>.    @ <td 
0bc0: 61 6c 69 67 6e 3d 22 6c 65 66 74 22 3e 25 73 28  align="left">%s(
0bd0: 64 62 5f 63 6f 6c 75 6d 6e 5f 74 65 78 74 28 26  db_column_text(&
0be0: 73 2c 33 29 29 3c 2f 74 64 3e 0a 20 20 20 20 40  s,3))</td>.    @
0bf0: 20 3c 2f 74 72 3e 0a 20 20 7d 0a 20 20 40 20 3c   </tr>.  }.  @ <
0c00: 2f 74 61 62 6c 65 3e 3c 2f 74 64 3e 3c 2f 74 72  /table></td></tr
0c10: 3e 3c 2f 74 61 62 6c 65 3e 0a 20 20 40 20 3c 70  ></table>.  @ <p
0c20: 20 73 74 79 6c 65 3d 22 63 6c 65 61 72 3a 62 6f   style="clear:bo
0c30: 74 68 22 3e 0a 20 20 40 20 3c 62 3e 4e 6f 74 65  th">.  @ <b>Note
0c40: 73 3a 3c 2f 62 3e 0a 20 20 40 20 3c 6f 6c 3e 0a  s:</b>.  @ <ol>.
0c50: 20 20 40 20 3c 6c 69 3e 3c 70 3e 54 68 65 20 70    @ <li><p>The p
0c60: 65 72 6d 69 73 73 69 6f 6e 20 66 6c 61 67 73 20  ermission flags 
0c70: 61 72 65 20 61 73 20 66 6f 6c 6c 6f 77 73 3a 3c  are as follows:<
0c80: 2f 70 3e 0a 20 20 40 20 3c 74 61 62 6c 65 3e 0a  /p>.  @ <table>.
0c90: 20 20 40 20 3c 74 72 3e 3c 74 64 3e 61 3c 2f 74    @ <tr><td>a</t
0ca0: 64 3e 3c 74 64 20 77 69 64 74 68 3d 22 31 30 22  d><td width="10"
0cb0: 3e 3c 2f 74 64 3e 0a 20 20 40 20 20 20 20 20 3c  ></td>.  @     <
0cc0: 74 64 3e 41 64 6d 69 6e 3a 20 43 72 65 61 74 65  td>Admin: Create
0cd0: 20 6f 72 20 64 65 6c 65 74 65 20 75 73 65 72 73   or delete users
0ce0: 20 61 6e 64 20 74 69 63 6b 65 74 20 72 65 70 6f   and ticket repo
0cf0: 72 74 20 66 6f 72 6d 61 74 73 3c 2f 74 64 3e 3c  rt formats</td><
0d00: 2f 74 72 3e 0a 20 20 40 20 3c 74 72 3e 3c 74 64  /tr>.  @ <tr><td
0d10: 3e 64 3c 2f 74 64 3e 3c 74 64 3e 3c 2f 74 64 3e  >d</td><td></td>
0d20: 0a 20 20 40 20 20 20 20 20 3c 74 64 3e 44 65 6c  .  @     <td>Del
0d30: 65 74 65 3a 20 45 72 61 73 65 20 61 6e 6f 6e 79  ete: Erase anony
0d40: 6d 6f 75 73 20 77 69 6b 69 2c 20 74 69 63 6b 65  mous wiki, ticke
0d50: 74 73 2c 20 61 6e 64 20 61 74 74 61 63 68 6d 65  ts, and attachme
0d60: 6e 74 73 3c 2f 74 64 3e 3c 2f 74 72 3e 0a 20 20  nts</td></tr>.  
0d70: 40 20 3c 74 72 3e 3c 74 64 3e 68 3c 2f 74 64 3e  @ <tr><td>h</td>
0d80: 3c 74 64 3e 3c 2f 74 64 3e 0a 20 20 40 20 20 20  <td></td>.  @   
0d90: 20 20 3c 74 64 3e 48 69 73 74 6f 72 79 3a 20 41    <td>History: A
0da0: 63 63 65 73 73 20 6f 6c 64 65 72 20 76 65 72 73  ccess older vers
0db0: 69 6f 6e 20 6f 66 20 63 6f 64 65 2c 20 74 69 63  ion of code, tic
0dc0: 6b 65 74 73 2c 20 6f 72 20 77 69 6b 69 3c 2f 74  kets, or wiki</t
0dd0: 64 3e 3c 2f 74 72 3e 0a 20 20 40 20 3c 74 72 3e  d></tr>.  @ <tr>
0de0: 3c 74 64 3e 69 3c 2f 74 64 3e 3c 74 64 3e 3c 2f  <td>i</td><td></
0df0: 74 64 3e 0a 20 20 40 20 20 20 20 20 3c 74 64 3e  td>.  @     <td>
0e00: 43 68 65 63 6b 2d 69 6e 3a 20 41 64 64 20 6e 65  Check-in: Add ne
0e10: 77 20 63 6f 64 65 20 74 6f 20 74 68 65 20 72 65  w code to the re
0e20: 70 6f 73 69 74 6f 72 79 3c 2f 74 64 3e 3c 2f 74  pository</td></t
0e30: 72 3e 0a 20 20 40 20 3c 74 72 3e 3c 74 64 3e 6a  r>.  @ <tr><td>j
0e40: 3c 2f 74 64 3e 3c 74 64 3e 3c 2f 74 64 3e 3c 74  </td><td></td><t
0e50: 64 3e 52 65 61 64 2d 57 69 6b 69 3a 20 56 69 65  d>Read-Wiki: Vie
0e60: 77 20 77 69 6b 69 20 70 61 67 65 73 3c 2f 74 64  w wiki pages</td
0e70: 3e 3c 2f 74 72 3e 0a 20 20 40 20 3c 74 72 3e 3c  ></tr>.  @ <tr><
0e80: 74 64 3e 6b 3c 2f 74 64 3e 3c 74 64 3e 3c 2f 74  td>k</td><td></t
0e90: 64 3e 3c 74 64 3e 57 69 6b 69 3a 20 43 72 65 61  d><td>Wiki: Crea
0ea0: 74 65 20 6f 72 20 6d 6f 64 69 66 79 20 77 69 6b  te or modify wik
0eb0: 69 20 70 61 67 65 73 3c 2f 74 64 3e 3c 2f 74 72  i pages</td></tr
0ec0: 3e 0a 20 20 40 20 3c 74 72 3e 3c 74 64 3e 6e 3c  >.  @ <tr><td>n<
0ed0: 2f 74 64 3e 3c 74 64 3e 3c 2f 74 64 3e 3c 74 64  /td><td></td><td
0ee0: 3e 4e 65 77 3a 20 43 72 65 61 74 65 20 6e 65 77  >New: Create new
0ef0: 20 74 69 63 6b 65 74 73 3c 2f 74 64 3e 3c 2f 74   tickets</td></t
0f00: 72 3e 0a 20 20 40 20 3c 74 72 3e 3c 74 64 3e 6f  r>.  @ <tr><td>o
0f10: 3c 2f 74 64 3e 3c 74 64 3e 3c 2f 74 64 3e 0a 20  </td><td></td>. 
0f20: 20 40 20 20 20 20 20 3c 74 64 3e 43 68 65 63 6b   @     <td>Check
0f30: 2d 6f 75 74 3a 20 52 65 61 64 20 63 6f 64 65 20  -out: Read code 
0f40: 6f 75 74 20 6f 66 20 74 68 65 20 72 65 70 6f 73  out of the repos
0f50: 69 74 6f 72 79 3c 2f 74 64 3e 3c 2f 74 72 3e 0a  itory</td></tr>.
0f60: 20 20 40 20 3c 74 72 3e 3c 74 64 3e 70 3c 2f 74    @ <tr><td>p</t
0f70: 64 3e 3c 74 64 3e 3c 2f 74 64 3e 3c 74 64 3e 50  d><td></td><td>P
0f80: 61 73 73 77 6f 72 64 3a 20 43 68 61 6e 67 65 20  assword: Change 
0f90: 70 61 73 73 77 6f 72 64 3c 2f 74 64 3e 3c 2f 74  password</td></t
0fa0: 72 3e 0a 20 20 40 20 3c 74 72 3e 3c 74 64 3e 71  r>.  @ <tr><td>q
0fb0: 3c 2f 74 64 3e 3c 74 64 3e 3c 2f 74 64 3e 3c 74  </td><td></td><t
0fc0: 64 3e 51 75 65 72 79 3a 20 43 72 65 61 74 65 20  d>Query: Create 
0fd0: 6f 72 20 65 64 69 74 20 72 65 70 6f 72 74 20 66  or edit report f
0fe0: 6f 72 6d 61 74 73 3c 2f 74 64 3e 3c 2f 74 72 3e  ormats</td></tr>
0ff0: 0a 20 20 40 20 3c 74 72 3e 3c 74 64 3e 72 3c 2f  .  @ <tr><td>r</
1000: 74 64 3e 3c 74 64 3e 3c 2f 74 64 3e 3c 74 64 3e  td><td></td><td>
1010: 52 65 61 64 3a 20 56 69 65 77 20 74 69 63 6b 65  Read: View ticke
1020: 74 73 20 61 6e 64 20 63 68 61 6e 67 65 20 68 69  ts and change hi
1030: 73 74 6f 72 69 65 73 3c 2f 74 64 3e 3c 2f 74 72  stories</td></tr
1040: 3e 0a 20 20 40 20 3c 74 72 3e 3c 74 64 3e 73 3c  >.  @ <tr><td>s<
1050: 2f 74 64 3e 3c 74 64 3e 3c 2f 74 64 3e 3c 74 64  /td><td></td><td
1060: 3e 53 65 74 75 70 3a 20 43 68 61 6e 67 65 20 43  >Setup: Change C
1070: 56 53 54 72 61 63 20 6f 70 74 69 6f 6e 73 3c 2f  VSTrac options</
1080: 74 64 3e 3c 2f 74 72 3e 0a 20 20 40 20 3c 74 72  td></tr>.  @ <tr
1090: 3e 3c 74 64 3e 77 3c 2f 74 64 3e 3c 74 64 3e 3c  ><td>w</td><td><
10a0: 2f 74 64 3e 3c 74 64 3e 57 72 69 74 65 3a 20 45  /td><td>Write: E
10b0: 64 69 74 20 74 69 63 6b 65 74 73 3c 2f 74 64 3e  dit tickets</td>
10c0: 3c 2f 74 72 3e 0a 20 20 40 20 3c 2f 74 61 62 6c  </tr>.  @ </tabl
10d0: 65 3e 0a 20 20 40 20 3c 2f 70 3e 3c 2f 6c 69 3e  e>.  @ </p></li>
10e0: 0a 20 20 40 0a 20 20 40 20 3c 6c 69 3e 3c 70 3e  .  @.  @ <li><p>
10f0: 0a 20 20 40 20 49 66 20 61 20 75 73 65 72 20 6e  .  @ If a user n
1100: 61 6d 65 64 20 22 3c 62 3e 61 6e 6f 6e 79 6d 6f  amed "<b>anonymo
1110: 75 73 3c 2f 62 3e 22 20 65 78 69 73 74 73 2c 20  us</b>" exists, 
1120: 74 68 65 6e 20 61 6e 79 6f 6e 65 20 63 61 6e 20  then anyone can 
1130: 61 63 63 65 73 73 0a 20 20 40 20 74 68 65 20 73  access.  @ the s
1140: 65 72 76 65 72 20 77 69 74 68 6f 75 74 20 68 61  erver without ha
1150: 76 69 6e 67 20 74 6f 20 6c 6f 67 20 69 6e 2e 20  ving to log in. 
1160: 20 54 68 65 20 70 65 72 6d 69 73 73 69 6f 6e 73   The permissions
1170: 20 6f 6e 20 74 68 65 0a 20 20 40 20 61 6e 6f 6e   on the.  @ anon
1180: 79 6d 6f 75 73 20 75 73 65 72 20 64 65 74 65 72  ymous user deter
1190: 6d 69 6e 65 20 74 68 65 20 61 63 63 65 73 73 20  mine the access 
11a0: 72 69 67 68 74 73 20 66 6f 72 20 61 6e 79 6f 6e  rights for anyon
11b0: 65 20 77 68 6f 20 69 73 20 6e 6f 74 0a 20 20 40  e who is not.  @
11c0: 20 6c 6f 67 67 65 64 20 69 6e 2e 0a 20 20 40 20   logged in..  @ 
11d0: 3c 2f 70 3e 3c 2f 6c 69 3e 0a 20 20 40 0a 20 20  </p></li>.  @.  
11e0: 40 20 3c 2f 6f 6c 3e 0a 20 20 73 74 79 6c 65 5f  @ </ol>.  style_
11f0: 66 6f 6f 74 65 72 28 29 3b 0a 7d 0a 0a 2f 2a 0a  footer();.}../*.
1200: 2a 2a 20 57 45 42 50 41 47 45 3a 20 2f 73 65 74  ** WEBPAGE: /set
1210: 75 70 5f 75 65 64 69 74 0a 2a 2f 0a 76 6f 69 64  up_uedit.*/.void
1220: 20 75 73 65 72 5f 65 64 69 74 28 76 6f 69 64 29   user_edit(void)
1230: 7b 0a 20 20 63 6f 6e 73 74 20 63 68 61 72 20 2a  {.  const char *
1240: 7a 49 64 2c 20 2a 7a 4c 6f 67 69 6e 2c 20 2a 7a  zId, *zLogin, *z
1250: 49 6e 66 6f 2c 20 2a 7a 43 61 70 3b 0a 20 20 63  Info, *zCap;.  c
1260: 68 61 72 20 2a 6f 61 61 2c 20 2a 6f 61 73 2c 20  har *oaa, *oas, 
1270: 2a 6f 61 72 2c 20 2a 6f 61 77 2c 20 2a 6f 61 6e  *oar, *oaw, *oan
1280: 2c 20 2a 6f 61 69 2c 20 2a 6f 61 6a 2c 20 2a 6f  , *oai, *oaj, *o
1290: 61 6f 2c 20 2a 6f 61 70 20 3b 0a 20 20 63 68 61  ao, *oap ;.  cha
12a0: 72 20 2a 6f 61 6b 2c 20 2a 6f 61 64 2c 20 2a 6f  r *oak, *oad, *o
12b0: 61 71 2c 20 2a 6f 61 63 2c 20 2a 6f 61 66 2c 20  aq, *oac, *oaf, 
12c0: 2a 6f 61 6d 2c 20 2a 6f 61 68 3b 0a 20 20 69 6e  *oam, *oah;.  in
12d0: 74 20 64 6f 57 72 69 74 65 3b 0a 20 20 69 6e 74  t doWrite;.  int
12e0: 20 75 69 64 3b 0a 20 20 69 6e 74 20 68 69 67 68   uid;.  int high
12f0: 65 72 55 73 65 72 20 3d 20 30 3b 20 20 2f 2a 20  erUser = 0;  /* 
1300: 54 72 75 65 20 69 66 20 75 73 65 72 20 62 65 69  True if user bei
1310: 6e 67 20 65 64 69 74 65 64 20 69 73 20 53 45 54  ng edited is SET
1320: 55 50 20 61 6e 64 20 74 68 65 20 2a 2f 0a 20 20  UP and the */.  
1330: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1340: 20 20 20 20 20 2f 2a 20 75 73 65 72 20 64 6f 69       /* user doi
1350: 6e 67 20 74 68 65 20 65 64 69 74 69 6e 67 20 69  ng the editing i
1360: 73 20 41 44 4d 49 4e 2e 20 20 44 69 73 61 6c 6c  s ADMIN.  Disall
1370: 6f 77 20 65 64 69 74 69 6e 67 20 2a 2f 0a 0a 20  ow editing */.. 
1380: 20 2f 2a 20 4d 75 73 74 20 68 61 76 65 20 41 44   /* Must have AD
1390: 4d 49 4e 20 70 72 69 76 6c 65 67 65 73 20 74 6f  MIN privleges to
13a0: 20 61 63 63 65 73 73 20 74 68 69 73 20 70 61 67   access this pag
13b0: 65 0a 20 20 2a 2f 0a 20 20 6c 6f 67 69 6e 5f 63  e.  */.  login_c
13c0: 68 65 63 6b 5f 63 72 65 64 65 6e 74 69 61 6c 73  heck_credentials
13d0: 28 29 3b 0a 20 20 69 66 28 20 21 67 2e 6f 6b 41  ();.  if( !g.okA
13e0: 64 6d 69 6e 20 29 7b 20 6c 6f 67 69 6e 5f 6e 65  dmin ){ login_ne
13f0: 65 64 65 64 28 29 3b 20 72 65 74 75 72 6e 3b 20  eded(); return; 
1400: 7d 0a 0a 20 20 2f 2a 20 43 68 65 63 6b 20 74 6f  }..  /* Check to
1410: 20 73 65 65 20 69 66 20 61 6e 20 41 44 4d 49 4e   see if an ADMIN
1420: 20 75 73 65 72 20 69 73 20 74 72 79 69 6e 67 20   user is trying 
1430: 74 6f 20 65 64 69 74 20 61 20 53 45 54 55 50 20  to edit a SETUP 
1440: 61 63 63 6f 75 6e 74 2e 0a 20 20 2a 2a 20 44 6f  account..  ** Do
1450: 6e 27 74 20 61 6c 6c 6f 77 20 74 68 61 74 2e 0a  n't allow that..
1460: 20 20 2a 2f 0a 20 20 7a 49 64 20 3d 20 50 44 28    */.  zId = PD(
1470: 22 69 64 22 2c 20 22 30 22 29 3b 0a 20 20 75 69  "id", "0");.  ui
1480: 64 20 3d 20 61 74 6f 69 28 7a 49 64 29 3b 0a 20  d = atoi(zId);. 
1490: 20 69 66 28 20 7a 49 64 20 26 26 20 21 67 2e 6f   if( zId && !g.o
14a0: 6b 53 65 74 75 70 20 26 26 20 75 69 64 3e 30 20  kSetup && uid>0 
14b0: 29 7b 0a 20 20 20 20 63 68 61 72 20 2a 7a 4f 6c  ){.    char *zOl
14c0: 64 43 61 70 73 3b 0a 20 20 20 20 7a 4f 6c 64 43  dCaps;.    zOldC
14d0: 61 70 73 20 3d 20 64 62 5f 74 65 78 74 28 30 2c  aps = db_text(0,
14e0: 20 22 53 45 4c 45 43 54 20 63 61 70 73 20 46 52   "SELECT caps FR
14f0: 4f 4d 20 75 73 65 72 20 57 48 45 52 45 20 75 69  OM user WHERE ui
1500: 64 3d 25 64 22 2c 75 69 64 29 3b 0a 20 20 20 20  d=%d",uid);.    
1510: 68 69 67 68 65 72 55 73 65 72 20 3d 20 7a 4f 6c  higherUser = zOl
1520: 64 43 61 70 73 20 26 26 20 73 74 72 63 68 72 28  dCaps && strchr(
1530: 7a 4f 6c 64 43 61 70 73 2c 27 73 27 29 3b 0a 20  zOldCaps,'s');. 
1540: 20 7d 0a 0a 20 20 69 66 28 20 50 28 22 63 61 6e   }..  if( P("can
1550: 22 29 20 29 7b 0a 20 20 20 20 63 67 69 5f 72 65  ") ){.    cgi_re
1560: 64 69 72 65 63 74 28 22 73 65 74 75 70 5f 75 6c  direct("setup_ul
1570: 69 73 74 22 29 3b 0a 20 20 20 20 72 65 74 75 72  ist");.    retur
1580: 6e 3b 0a 20 20 7d 0a 0a 20 20 2f 2a 20 49 66 20  n;.  }..  /* If 
1590: 77 65 20 68 61 76 65 20 61 6c 6c 20 74 68 65 20  we have all the 
15a0: 6e 65 63 65 73 73 61 72 79 20 69 6e 66 6f 72 6d  necessary inform
15b0: 61 74 69 6f 6e 2c 20 77 72 69 74 65 20 74 68 65  ation, write the
15c0: 20 6e 65 77 20 6f 72 0a 20 20 2a 2a 20 6d 6f 64   new or.  ** mod
15d0: 69 66 69 65 64 20 75 73 65 72 20 72 65 63 6f 72  ified user recor
15e0: 64 2e 20 20 41 66 74 65 72 20 77 72 69 74 69 6e  d.  After writin
15f0: 67 20 74 68 65 20 75 73 65 72 20 72 65 63 6f 72  g the user recor
1600: 64 2c 20 72 65 64 69 72 65 63 74 0a 20 20 2a 2a  d, redirect.  **
1610: 20 74 6f 20 74 68 65 20 70 61 67 65 20 74 68 61   to the page tha
1620: 74 20 64 69 73 70 6c 61 79 73 20 61 20 6c 69 73  t displays a lis
1630: 74 20 6f 66 20 75 73 65 72 73 2e 0a 20 20 2a 2f  t of users..  */
1640: 0a 20 20 64 6f 57 72 69 74 65 20 3d 20 63 67 69  .  doWrite = cgi
1650: 5f 61 6c 6c 28 22 6c 6f 67 69 6e 22 2c 22 69 6e  _all("login","in
1660: 66 6f 22 2c 22 70 77 22 29 20 26 26 20 21 68 69  fo","pw") && !hi
1670: 67 68 65 72 55 73 65 72 3b 0a 20 20 69 66 28 20  gherUser;.  if( 
1680: 64 6f 57 72 69 74 65 20 29 7b 0a 20 20 20 20 63  doWrite ){.    c
1690: 6f 6e 73 74 20 63 68 61 72 20 2a 7a 50 77 3b 0a  onst char *zPw;.
16a0: 20 20 20 20 63 6f 6e 73 74 20 63 68 61 72 20 2a      const char *
16b0: 7a 4c 6f 67 69 6e 3b 0a 20 20 20 20 63 68 61 72  zLogin;.    char
16c0: 20 7a 43 61 70 5b 33 30 5d 3b 0a 20 20 20 20 69   zCap[30];.    i
16d0: 6e 74 20 69 20 3d 20 30 3b 0a 20 20 20 20 69 6e  nt i = 0;.    in
16e0: 74 20 61 61 20 3d 20 50 28 22 61 61 22 29 21 3d  t aa = P("aa")!=
16f0: 30 3b 0a 20 20 20 20 69 6e 74 20 61 64 20 3d 20  0;.    int ad = 
1700: 50 28 22 61 64 22 29 21 3d 30 3b 0a 20 20 20 20  P("ad")!=0;.    
1710: 69 6e 74 20 61 69 20 3d 20 50 28 22 61 69 22 29  int ai = P("ai")
1720: 21 3d 30 3b 0a 20 20 20 20 69 6e 74 20 61 6a 20  !=0;.    int aj 
1730: 3d 20 50 28 22 61 6a 22 29 21 3d 30 3b 0a 20 20  = P("aj")!=0;.  
1740: 20 20 69 6e 74 20 61 6b 20 3d 20 50 28 22 61 6b    int ak = P("ak
1750: 22 29 21 3d 30 3b 0a 20 20 20 20 69 6e 74 20 61  ")!=0;.    int a
1760: 6e 20 3d 20 50 28 22 61 6e 22 29 21 3d 30 3b 0a  n = P("an")!=0;.
1770: 20 20 20 20 69 6e 74 20 61 6f 20 3d 20 50 28 22      int ao = P("
1780: 61 6f 22 29 21 3d 30 3b 0a 20 20 20 20 69 6e 74  ao")!=0;.    int
1790: 20 61 70 20 3d 20 50 28 22 61 70 22 29 21 3d 30   ap = P("ap")!=0
17a0: 3b 0a 20 20 20 20 69 6e 74 20 61 71 20 3d 20 50  ;.    int aq = P
17b0: 28 22 61 71 22 29 21 3d 30 3b 0a 20 20 20 20 69  ("aq")!=0;.    i
17c0: 6e 74 20 61 72 20 3d 20 50 28 22 61 72 22 29 21  nt ar = P("ar")!
17d0: 3d 30 3b 0a 20 20 20 20 69 6e 74 20 61 73 20 3d  =0;.    int as =
17e0: 20 67 2e 6f 6b 53 65 74 75 70 20 26 26 20 50 28   g.okSetup && P(
17f0: 22 61 73 22 29 21 3d 30 3b 0a 20 20 20 20 69 6e  "as")!=0;.    in
1800: 74 20 61 77 20 3d 20 50 28 22 61 77 22 29 21 3d  t aw = P("aw")!=
1810: 30 3b 0a 20 20 20 20 69 6e 74 20 61 63 20 3d 20  0;.    int ac = 
1820: 50 28 22 61 63 22 29 21 3d 30 3b 0a 20 20 20 20  P("ac")!=0;.    
1830: 69 6e 74 20 61 66 20 3d 20 50 28 22 61 66 22 29  int af = P("af")
1840: 21 3d 30 3b 0a 20 20 20 20 69 6e 74 20 61 6d 20  !=0;.    int am 
1850: 3d 20 50 28 22 61 6d 22 29 21 3d 30 3b 0a 20 20  = P("am")!=0;.  
1860: 20 20 69 6e 74 20 61 68 20 3d 20 50 28 22 61 68    int ah = P("ah
1870: 22 29 21 3d 30 3b 0a 20 20 20 20 69 66 28 20 61  ")!=0;.    if( a
1880: 61 20 29 7b 20 7a 43 61 70 5b 69 2b 2b 5d 20 3d  a ){ zCap[i++] =
1890: 20 27 61 27 3b 20 7d 0a 20 20 20 20 69 66 28 20   'a'; }.    if( 
18a0: 61 63 20 29 7b 20 7a 43 61 70 5b 69 2b 2b 5d 20  ac ){ zCap[i++] 
18b0: 3d 20 27 63 27 3b 20 7d 0a 20 20 20 20 69 66 28  = 'c'; }.    if(
18c0: 20 61 64 20 29 7b 20 7a 43 61 70 5b 69 2b 2b 5d   ad ){ zCap[i++]
18d0: 20 3d 20 27 64 27 3b 20 7d 0a 20 20 20 20 69 66   = 'd'; }.    if
18e0: 28 20 61 66 20 29 7b 20 7a 43 61 70 5b 69 2b 2b  ( af ){ zCap[i++
18f0: 5d 20 3d 20 27 66 27 3b 20 7d 0a 20 20 20 20 69  ] = 'f'; }.    i
1900: 66 28 20 61 68 20 29 7b 20 7a 43 61 70 5b 69 2b  f( ah ){ zCap[i+
1910: 2b 5d 20 3d 20 27 68 27 3b 20 7d 0a 20 20 20 20  +] = 'h'; }.    
1920: 69 66 28 20 61 69 20 29 7b 20 7a 43 61 70 5b 69  if( ai ){ zCap[i
1930: 2b 2b 5d 20 3d 20 27 69 27 3b 20 7d 0a 20 20 20  ++] = 'i'; }.   
1940: 20 69 66 28 20 61 6a 20 29 7b 20 7a 43 61 70 5b   if( aj ){ zCap[
1950: 69 2b 2b 5d 20 3d 20 27 6a 27 3b 20 7d 0a 20 20  i++] = 'j'; }.  
1960: 20 20 69 66 28 20 61 6b 20 29 7b 20 7a 43 61 70    if( ak ){ zCap
1970: 5b 69 2b 2b 5d 20 3d 20 27 6b 27 3b 20 7d 0a 20  [i++] = 'k'; }. 
1980: 20 20 20 69 66 28 20 61 6d 20 29 7b 20 7a 43 61     if( am ){ zCa
1990: 70 5b 69 2b 2b 5d 20 3d 20 27 6d 27 3b 20 7d 0a  p[i++] = 'm'; }.
19a0: 20 20 20 20 69 66 28 20 61 6e 20 29 7b 20 7a 43      if( an ){ zC
19b0: 61 70 5b 69 2b 2b 5d 20 3d 20 27 6e 27 3b 20 7d  ap[i++] = 'n'; }
19c0: 0a 20 20 20 20 69 66 28 20 61 6f 20 29 7b 20 7a  .    if( ao ){ z
19d0: 43 61 70 5b 69 2b 2b 5d 20 3d 20 27 6f 27 3b 20  Cap[i++] = 'o'; 
19e0: 7d 0a 20 20 20 20 69 66 28 20 61 70 20 29 7b 20  }.    if( ap ){ 
19f0: 7a 43 61 70 5b 69 2b 2b 5d 20 3d 20 27 70 27 3b  zCap[i++] = 'p';
1a00: 20 7d 0a 20 20 20 20 69 66 28 20 61 71 20 29 7b   }.    if( aq ){
1a10: 20 7a 43 61 70 5b 69 2b 2b 5d 20 3d 20 27 71 27   zCap[i++] = 'q'
1a20: 3b 20 7d 0a 20 20 20 20 69 66 28 20 61 72 20 29  ; }.    if( ar )
1a30: 7b 20 7a 43 61 70 5b 69 2b 2b 5d 20 3d 20 27 72  { zCap[i++] = 'r
1a40: 27 3b 20 7d 0a 20 20 20 20 69 66 28 20 61 73 20  '; }.    if( as 
1a50: 29 7b 20 7a 43 61 70 5b 69 2b 2b 5d 20 3d 20 27  ){ zCap[i++] = '
1a60: 73 27 3b 20 7d 0a 20 20 20 20 69 66 28 20 61 77  s'; }.    if( aw
1a70: 20 29 7b 20 7a 43 61 70 5b 69 2b 2b 5d 20 3d 20   ){ zCap[i++] = 
1a80: 27 77 27 3b 20 7d 0a 0a 20 20 20 20 7a 43 61 70  'w'; }..    zCap
1a90: 5b 69 5d 20 3d 20 30 3b 0a 20 20 20 20 7a 50 77  [i] = 0;.    zPw
1aa0: 20 3d 20 50 28 22 70 77 22 29 3b 0a 20 20 20 20   = P("pw");.    
1ab0: 69 66 28 20 7a 50 77 3d 3d 30 20 7c 7c 20 7a 50  if( zPw==0 || zP
1ac0: 77 5b 30 5d 3d 3d 30 20 29 7b 0a 20 20 20 20 20  w[0]==0 ){.     
1ad0: 20 7a 50 77 20 3d 20 64 62 5f 74 65 78 74 28 30   zPw = db_text(0
1ae0: 2c 20 22 53 45 4c 45 43 54 20 70 77 20 46 52 4f  , "SELECT pw FRO
1af0: 4d 20 75 73 65 72 20 57 48 45 52 45 20 75 69 64  M user WHERE uid
1b00: 3d 25 64 22 2c 20 75 69 64 29 3b 0a 20 20 20 20  =%d", uid);.    
1b10: 7d 0a 20 20 20 20 7a 4c 6f 67 69 6e 20 3d 20 50  }.    zLogin = P
1b20: 28 22 6c 6f 67 69 6e 22 29 3b 0a 20 20 20 20 69  ("login");.    i
1b30: 66 28 20 75 69 64 3e 30 20 26 26 20 0a 20 20 20  f( uid>0 && .   
1b40: 20 20 20 20 20 64 62 5f 65 78 69 73 74 73 28 22       db_exists("
1b50: 53 45 4c 45 43 54 20 31 20 46 52 4f 4d 20 75 73  SELECT 1 FROM us
1b60: 65 72 20 57 48 45 52 45 20 6c 6f 67 69 6e 3d 25  er WHERE login=%
1b70: 51 20 41 4e 44 20 75 69 64 21 3d 25 64 22 2c 20  Q AND uid!=%d", 
1b80: 7a 4c 6f 67 69 6e 2c 20 75 69 64 29 0a 20 20 20  zLogin, uid).   
1b90: 20 29 7b 0a 20 20 20 20 20 20 73 74 79 6c 65 5f   ){.      style_
1ba0: 68 65 61 64 65 72 28 22 55 73 65 72 20 43 72 65  header("User Cre
1bb0: 61 74 69 6f 6e 20 45 72 72 6f 72 22 29 3b 0a 20  ation Error");. 
1bc0: 20 20 20 20 20 40 20 3c 66 6f 6e 74 20 63 6f 6c       @ <font col
1bd0: 6f 72 3d 22 72 65 64 22 3e 4c 6f 67 69 6e 20 22  or="red">Login "
1be0: 25 68 28 7a 4c 6f 67 69 6e 29 22 20 69 73 20 61  %h(zLogin)" is a
1bf0: 6c 72 65 61 64 79 20 75 73 65 64 20 62 79 20 61  lready used by a
1c00: 20 64 69 66 66 65 72 65 6e 74 0a 20 20 20 20 20   different.     
1c10: 20 40 20 75 73 65 72 2e 3c 2f 66 6f 6e 74 3e 0a   @ user.</font>.
1c20: 20 20 20 20 20 20 40 0a 20 20 20 20 20 20 40 20        @.      @ 
1c30: 3c 70 3e 3c 61 20 68 72 65 66 3d 22 73 65 74 75  <p><a href="setu
1c40: 70 5f 75 65 64 69 74 3f 69 64 3d 25 64 28 75 69  p_uedit?id=%d(ui
1c50: 64 29 29 3e 5b 42 75 6d 6d 65 72 5d 3c 2f 61 3e  d))>[Bummer]</a>
1c60: 3c 2f 70 3e 0a 20 20 20 20 20 20 73 74 79 6c 65  </p>.      style
1c70: 5f 66 6f 6f 74 65 72 28 29 3b 0a 20 20 20 20 20  _footer();.     
1c80: 20 72 65 74 75 72 6e 3b 0a 20 20 20 20 7d 0a 20   return;.    }. 
1c90: 20 20 20 64 62 5f 6d 75 6c 74 69 5f 65 78 65 63     db_multi_exec
1ca0: 28 0a 20 20 20 20 20 20 20 22 52 45 50 4c 41 43  (.       "REPLAC
1cb0: 45 20 49 4e 54 4f 20 75 73 65 72 28 75 69 64 2c  E INTO user(uid,
1cc0: 6c 6f 67 69 6e 2c 69 6e 66 6f 2c 70 77 2c 63 61  login,info,pw,ca
1cd0: 70 29 20 22 0a 20 20 20 20 20 20 20 22 56 41 4c  p) ".       "VAL
1ce0: 55 45 53 28 6e 75 6c 6c 69 66 28 25 64 2c 30 29  UES(nullif(%d,0)
1cf0: 2c 25 51 2c 25 51 2c 25 51 2c 27 25 73 27 29 22  ,%Q,%Q,%Q,'%s')"
1d00: 2c 0a 20 20 20 20 20 20 75 69 64 2c 20 50 28 22  ,.      uid, P("
1d10: 6c 6f 67 69 6e 22 29 2c 20 50 28 22 69 6e 66 6f  login"), P("info
1d20: 22 29 2c 20 7a 50 77 2c 20 7a 43 61 70 0a 20 20  "), zPw, zCap.  
1d30: 20 20 29 3b 0a 20 20 20 20 63 67 69 5f 72 65 64    );.    cgi_red
1d40: 69 72 65 63 74 28 22 73 65 74 75 70 5f 75 6c 69  irect("setup_uli
1d50: 73 74 22 29 3b 0a 20 20 20 20 72 65 74 75 72 6e  st");.    return
1d60: 3b 0a 20 20 7d 0a 0a 20 20 2f 2a 20 4c 6f 61 64  ;.  }..  /* Load
1d70: 20 74 68 65 20 65 78 69 73 74 69 6e 67 20 69 6e   the existing in
1d80: 66 6f 72 6d 61 74 69 6f 6e 20 61 62 6f 75 74 20  formation about 
1d90: 74 68 65 20 75 73 65 72 2c 20 69 66 20 61 6e 79  the user, if any
1da0: 0a 20 20 2a 2f 0a 20 20 7a 4c 6f 67 69 6e 20 3d  .  */.  zLogin =
1db0: 20 22 22 3b 0a 20 20 7a 49 6e 66 6f 20 3d 20 22   "";.  zInfo = "
1dc0: 22 3b 0a 20 20 7a 43 61 70 20 3d 20 22 22 3b 0a  ";.  zCap = "";.
1dd0: 20 20 6f 61 61 20 3d 20 6f 61 63 20 3d 20 6f 61    oaa = oac = oa
1de0: 64 20 3d 20 6f 61 66 20 3d 20 6f 61 68 20 3d 20  d = oaf = oah = 
1df0: 6f 61 69 20 3d 20 6f 61 6a 20 3d 20 6f 61 6b 20  oai = oaj = oak 
1e00: 3d 20 6f 61 6d 20 3d 0a 20 20 20 20 20 20 20 20  = oam =.        
1e10: 6f 61 6e 20 3d 20 6f 61 6f 20 3d 20 6f 61 70 20  oan = oao = oap 
1e20: 3d 20 6f 61 71 20 3d 20 6f 61 72 20 3d 20 6f 61  = oaq = oar = oa
1e30: 73 20 3d 20 6f 61 77 20 3d 20 22 22 3b 0a 20 20  s = oaw = "";.  
1e40: 69 66 28 20 75 69 64 20 29 7b 0a 20 20 20 20 7a  if( uid ){.    z
1e50: 4c 6f 67 69 6e 20 3d 20 64 62 5f 74 65 78 74 28  Login = db_text(
1e60: 22 22 2c 20 22 53 45 4c 45 43 54 20 6c 6f 67 69  "", "SELECT logi
1e70: 6e 20 46 52 4f 4d 20 75 73 65 72 20 57 48 45 52  n FROM user WHER
1e80: 45 20 75 69 64 3d 25 64 22 2c 20 75 69 64 29 3b  E uid=%d", uid);
1e90: 0a 20 20 20 20 7a 49 6e 66 6f 20 3d 20 64 62 5f  .    zInfo = db_
1ea0: 74 65 78 74 28 22 22 2c 20 22 53 45 4c 45 43 54  text("", "SELECT
1eb0: 20 69 6e 66 6f 20 46 52 4f 4d 20 75 73 65 72 20   info FROM user 
1ec0: 57 48 45 52 45 20 75 69 64 3d 25 64 22 2c 20 75  WHERE uid=%d", u
1ed0: 69 64 29 3b 0a 20 20 20 20 7a 43 61 70 20 3d 20  id);.    zCap = 
1ee0: 64 62 5f 74 65 78 74 28 22 22 2c 20 22 53 45 4c  db_text("", "SEL
1ef0: 45 43 54 20 63 61 70 20 46 52 4f 4d 20 75 73 65  ECT cap FROM use
1f00: 72 20 57 48 45 52 45 20 75 69 64 3d 25 64 22 2c  r WHERE uid=%d",
1f10: 20 75 69 64 29 3b 0a 20 20 20 20 69 66 28 20 73   uid);.    if( s
1f20: 74 72 63 68 72 28 7a 43 61 70 2c 20 27 61 27 29  trchr(zCap, 'a')
1f30: 20 29 20 6f 61 61 20 3d 20 22 20 63 68 65 63 6b   ) oaa = " check
1f40: 65 64 22 3b 0a 20 20 20 20 69 66 28 20 73 74 72  ed";.    if( str
1f50: 63 68 72 28 7a 43 61 70 2c 20 27 63 27 29 20 29  chr(zCap, 'c') )
1f60: 20 6f 61 63 20 3d 20 22 20 63 68 65 63 6b 65 64   oac = " checked
1f70: 22 3b 0a 20 20 20 20 69 66 28 20 73 74 72 63 68  ";.    if( strch
1f80: 72 28 7a 43 61 70 2c 20 27 64 27 29 20 29 20 6f  r(zCap, 'd') ) o
1f90: 61 64 20 3d 20 22 20 63 68 65 63 6b 65 64 22 3b  ad = " checked";
1fa0: 0a 20 20 20 20 69 66 28 20 73 74 72 63 68 72 28  .    if( strchr(
1fb0: 7a 43 61 70 2c 20 27 66 27 29 20 29 20 6f 61 66  zCap, 'f') ) oaf
1fc0: 20 3d 20 22 20 63 68 65 63 6b 65 64 22 3b 0a 20   = " checked";. 
1fd0: 20 20 20 69 66 28 20 73 74 72 63 68 72 28 7a 43     if( strchr(zC
1fe0: 61 70 2c 20 27 68 27 29 20 29 20 6f 61 68 20 3d  ap, 'h') ) oah =
1ff0: 20 22 20 63 68 65 63 6b 65 64 22 3b 0a 20 20 20   " checked";.   
2000: 20 69 66 28 20 73 74 72 63 68 72 28 7a 43 61 70   if( strchr(zCap
2010: 2c 20 27 69 27 29 20 29 20 6f 61 69 20 3d 20 22  , 'i') ) oai = "
2020: 20 63 68 65 63 6b 65 64 22 3b 0a 20 20 20 20 69   checked";.    i
2030: 66 28 20 73 74 72 63 68 72 28 7a 43 61 70 2c 20  f( strchr(zCap, 
2040: 27 6a 27 29 20 29 20 6f 61 6a 20 3d 20 22 20 63  'j') ) oaj = " c
2050: 68 65 63 6b 65 64 22 3b 0a 20 20 20 20 69 66 28  hecked";.    if(
2060: 20 73 74 72 63 68 72 28 7a 43 61 70 2c 20 27 6b   strchr(zCap, 'k
2070: 27 29 20 29 20 6f 61 6b 20 3d 20 22 20 63 68 65  ') ) oak = " che
2080: 63 6b 65 64 22 3b 0a 20 20 20 20 69 66 28 20 73  cked";.    if( s
2090: 74 72 63 68 72 28 7a 43 61 70 2c 20 27 6d 27 29  trchr(zCap, 'm')
20a0: 20 29 20 6f 61 6d 20 3d 20 22 20 63 68 65 63 6b   ) oam = " check
20b0: 65 64 22 3b 0a 20 20 20 20 69 66 28 20 73 74 72  ed";.    if( str
20c0: 63 68 72 28 7a 43 61 70 2c 20 27 6e 27 29 20 29  chr(zCap, 'n') )
20d0: 20 6f 61 6e 20 3d 20 22 20 63 68 65 63 6b 65 64   oan = " checked
20e0: 22 3b 0a 20 20 20 20 69 66 28 20 73 74 72 63 68  ";.    if( strch
20f0: 72 28 7a 43 61 70 2c 20 27 6f 27 29 20 29 20 6f  r(zCap, 'o') ) o
2100: 61 6f 20 3d 20 22 20 63 68 65 63 6b 65 64 22 3b  ao = " checked";
2110: 0a 20 20 20 20 69 66 28 20 73 74 72 63 68 72 28  .    if( strchr(
2120: 7a 43 61 70 2c 20 27 70 27 29 20 29 20 6f 61 70  zCap, 'p') ) oap
2130: 20 3d 20 22 20 63 68 65 63 6b 65 64 22 3b 0a 20   = " checked";. 
2140: 20 20 20 69 66 28 20 73 74 72 63 68 72 28 7a 43     if( strchr(zC
2150: 61 70 2c 20 27 71 27 29 20 29 20 6f 61 71 20 3d  ap, 'q') ) oaq =
2160: 20 22 20 63 68 65 63 6b 65 64 22 3b 0a 20 20 20   " checked";.   
2170: 20 69 66 28 20 73 74 72 63 68 72 28 7a 43 61 70   if( strchr(zCap
2180: 2c 20 27 72 27 29 20 29 20 6f 61 72 20 3d 20 22  , 'r') ) oar = "
2190: 20 63 68 65 63 6b 65 64 22 3b 0a 20 20 20 20 69   checked";.    i
21a0: 66 28 20 73 74 72 63 68 72 28 7a 43 61 70 2c 20  f( strchr(zCap, 
21b0: 27 73 27 29 20 29 20 6f 61 73 20 3d 20 22 20 63  's') ) oas = " c
21c0: 68 65 63 6b 65 64 22 3b 0a 20 20 20 20 69 66 28  hecked";.    if(
21d0: 20 73 74 72 63 68 72 28 7a 43 61 70 2c 20 27 77   strchr(zCap, 'w
21e0: 27 29 20 29 20 6f 61 77 20 3d 20 22 20 63 68 65  ') ) oaw = " che
21f0: 63 6b 65 64 22 3b 0a 20 20 7d 0a 0a 20 20 2f 2a  cked";.  }..  /*
2200: 20 42 65 67 69 6e 20 67 65 6e 65 72 61 74 69 6e   Begin generatin
2210: 67 20 74 68 65 20 70 61 67 65 0a 20 20 2a 2f 0a  g the page.  */.
2220: 20 20 73 74 79 6c 65 5f 73 75 62 6d 65 6e 75 5f    style_submenu_
2230: 65 6c 65 6d 65 6e 74 28 22 43 61 6e 63 65 6c 22  element("Cancel"
2240: 2c 20 22 43 61 6e 63 65 6c 22 2c 20 22 73 65 74  , "Cancel", "set
2250: 75 70 5f 75 6c 69 73 74 22 29 3b 0a 20 20 69 66  up_ulist");.  if
2260: 28 20 75 69 64 20 29 7b 0a 20 20 20 20 73 74 79  ( uid ){.    sty
2270: 6c 65 5f 68 65 61 64 65 72 28 6d 70 72 69 6e 74  le_header(mprint
2280: 66 28 22 45 64 69 74 20 55 73 65 72 20 25 68 22  f("Edit User %h"
2290: 2c 20 7a 4c 6f 67 69 6e 29 29 3b 0a 20 20 7d 65  , zLogin));.  }e
22a0: 6c 73 65 7b 0a 20 20 20 20 73 74 79 6c 65 5f 68  lse{.    style_h
22b0: 65 61 64 65 72 28 22 41 64 64 20 41 20 4e 65 77  eader("Add A New
22c0: 20 55 73 65 72 22 29 3b 0a 20 20 7d 0a 20 20 40   User");.  }.  @
22d0: 20 3c 74 61 62 6c 65 20 61 6c 69 67 6e 3d 22 6c   <table align="l
22e0: 65 66 74 22 20 68 73 70 61 63 65 3d 22 32 30 22  eft" hspace="20"
22f0: 20 76 73 70 61 63 65 3d 22 31 30 22 3e 3c 74 72   vspace="10"><tr
2300: 3e 3c 74 64 3e 0a 20 20 40 20 3c 66 6f 72 6d 20  ><td>.  @ <form 
2310: 61 63 74 69 6f 6e 3d 22 25 73 28 67 2e 7a 50 61  action="%s(g.zPa
2320: 74 68 29 22 20 6d 65 74 68 6f 64 3d 22 50 4f 53  th)" method="POS
2330: 54 22 3e 0a 20 20 40 20 3c 74 61 62 6c 65 3e 0a  T">.  @ <table>.
2340: 20 20 40 20 3c 74 72 3e 0a 20 20 40 20 20 20 3c    @ <tr>.  @   <
2350: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22  td align="right"
2360: 3e 3c 6e 6f 62 72 3e 55 73 65 72 20 49 44 3a 3c  ><nobr>User ID:<
2370: 2f 6e 6f 62 72 3e 3c 2f 74 64 3e 0a 20 20 69 66  /nobr></td>.  if
2380: 28 20 75 69 64 20 29 7b 0a 20 20 20 20 40 20 20  ( uid ){.    @  
2390: 20 3c 74 64 3e 25 64 28 75 69 64 29 20 3c 69 6e   <td>%d(uid) <in
23a0: 70 75 74 20 74 79 70 65 3d 22 68 69 64 64 65 6e  put type="hidden
23b0: 22 20 6e 61 6d 65 3d 22 69 64 22 20 76 61 6c 75  " name="id" valu
23c0: 65 3d 22 25 64 28 75 69 64 29 22 3e 3c 2f 74 64  e="%d(uid)"></td
23d0: 3e 0a 20 20 7d 65 6c 73 65 7b 0a 20 20 20 20 40  >.  }else{.    @
23e0: 20 20 20 3c 74 64 3e 28 6e 65 77 20 75 73 65 72     <td>(new user
23f0: 29 3c 69 6e 70 75 74 20 74 79 70 65 3d 22 68 69  )<input type="hi
2400: 64 64 65 6e 22 20 6e 61 6d 65 3d 22 69 64 22 20  dden" name="id" 
2410: 76 61 6c 75 65 3d 30 3e 3c 2f 74 64 3e 0a 20 20  value=0></td>.  
2420: 7d 0a 20 20 40 20 3c 2f 74 72 3e 0a 20 20 40 20  }.  @ </tr>.  @ 
2430: 3c 74 72 3e 0a 20 20 40 20 20 20 3c 74 64 20 61  <tr>.  @   <td a
2440: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 3c 6e 6f  lign="right"><no
2450: 62 72 3e 4c 6f 67 69 6e 3a 3c 2f 6e 6f 62 72 3e  br>Login:</nobr>
2460: 3c 2f 74 64 3e 0a 20 20 40 20 20 20 3c 74 64 3e  </td>.  @   <td>
2470: 3c 69 6e 70 75 74 20 74 79 70 65 3d 22 74 65 78  <input type="tex
2480: 74 22 20 6e 61 6d 65 3d 22 6c 6f 67 69 6e 22 20  t" name="login" 
2490: 76 61 6c 75 65 3d 22 25 68 28 7a 4c 6f 67 69 6e  value="%h(zLogin
24a0: 29 22 3e 3c 2f 74 64 3e 0a 20 20 40 20 3c 2f 74  )"></td>.  @ </t
24b0: 72 3e 0a 20 20 40 20 3c 74 72 3e 0a 20 20 40 20  r>.  @ <tr>.  @ 
24c0: 20 20 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67    <td align="rig
24d0: 68 74 22 3e 3c 6e 6f 62 72 3e 43 6f 6e 74 61 63  ht"><nobr>Contac
24e0: 74 26 6e 62 73 70 3b 49 6e 66 6f 3a 3c 2f 6e 6f  t&nbsp;Info:</no
24f0: 62 72 3e 3c 2f 74 64 3e 0a 20 20 40 20 20 20 3c  br></td>.  @   <
2500: 74 64 3e 3c 69 6e 70 75 74 20 74 79 70 65 3d 22  td><input type="
2510: 74 65 78 74 22 20 6e 61 6d 65 3d 22 69 6e 66 6f  text" name="info
2520: 22 20 73 69 7a 65 3d 34 30 20 76 61 6c 75 65 3d  " size=40 value=
2530: 22 25 68 28 7a 49 6e 66 6f 29 22 3e 3c 2f 74 64  "%h(zInfo)"></td
2540: 3e 0a 20 20 40 20 3c 2f 74 72 3e 0a 20 20 40 20  >.  @ </tr>.  @ 
2550: 3c 74 72 3e 0a 20 20 40 20 20 20 3c 74 64 20 61  <tr>.  @   <td a
2560: 6c 69 67 6e 3d 22 72 69 67 68 74 22 20 76 61 6c  lign="right" val
2570: 69 67 6e 3d 22 74 6f 70 22 3e 43 61 70 61 62 69  ign="top">Capabi
2580: 6c 69 74 69 65 73 3a 3c 2f 74 64 3e 0a 20 20 40  lities:</td>.  @
2590: 20 20 20 3c 74 64 3e 0a 20 20 69 66 28 20 67 2e     <td>.  if( g.
25a0: 6f 6b 53 65 74 75 70 20 29 7b 0a 20 20 20 20 40  okSetup ){.    @
25b0: 20 20 20 20 20 3c 69 6e 70 75 74 20 74 79 70 65       <input type
25c0: 3d 22 63 68 65 63 6b 62 6f 78 22 20 6e 61 6d 65  ="checkbox" name
25d0: 3d 22 61 73 22 25 73 28 6f 61 73 29 3e 53 65 74  ="as"%s(oas)>Set
25e0: 75 70 3c 2f 69 6e 70 75 74 3e 3c 62 72 3e 0a 20  up</input><br>. 
25f0: 20 7d 0a 20 20 40 20 20 20 20 20 3c 69 6e 70 75   }.  @     <inpu
2600: 74 20 74 79 70 65 3d 22 63 68 65 63 6b 62 6f 78  t type="checkbox
2610: 22 20 6e 61 6d 65 3d 22 61 61 22 25 73 28 6f 61  " name="aa"%s(oa
2620: 61 29 3e 41 64 6d 69 6e 3c 2f 69 6e 70 75 74 3e  a)>Admin</input>
2630: 3c 62 72 3e 0a 20 20 40 20 20 20 20 20 3c 69 6e  <br>.  @     <in
2640: 70 75 74 20 74 79 70 65 3d 22 63 68 65 63 6b 62  put type="checkb
2650: 6f 78 22 20 6e 61 6d 65 3d 22 61 64 22 25 73 28  ox" name="ad"%s(
2660: 6f 61 64 29 3e 44 65 6c 65 74 65 3c 2f 69 6e 70  oad)>Delete</inp
2670: 75 74 3e 3c 62 72 3e 0a 20 20 40 20 20 20 20 20  ut><br>.  @     
2680: 3c 69 6e 70 75 74 20 74 79 70 65 3d 22 63 68 65  <input type="che
2690: 63 6b 62 6f 78 22 20 6e 61 6d 65 3d 22 61 70 22  ckbox" name="ap"
26a0: 25 73 28 6f 61 70 29 3e 50 61 73 73 77 6f 72 64  %s(oap)>Password
26b0: 3c 2f 69 6e 70 75 74 3e 3c 62 72 3e 0a 20 20 40  </input><br>.  @
26c0: 20 20 20 20 20 3c 69 6e 70 75 74 20 74 79 70 65       <input type
26d0: 3d 22 63 68 65 63 6b 62 6f 78 22 20 6e 61 6d 65  ="checkbox" name
26e0: 3d 22 61 71 22 25 73 28 6f 61 71 29 3e 51 75 65  ="aq"%s(oaq)>Que
26f0: 72 79 3c 2f 69 6e 70 75 74 3e 3c 62 72 3e 0a 20  ry</input><br>. 
2700: 20 40 20 20 20 20 20 3c 69 6e 70 75 74 20 74 79   @     <input ty
2710: 70 65 3d 22 63 68 65 63 6b 62 6f 78 22 20 6e 61  pe="checkbox" na
2720: 6d 65 3d 22 61 69 22 25 73 28 6f 61 69 29 3e 43  me="ai"%s(oai)>C
2730: 68 65 63 6b 2d 49 6e 3c 2f 69 6e 70 75 74 3e 3c  heck-In</input><
2740: 62 72 3e 0a 20 20 40 20 20 20 20 20 3c 69 6e 70  br>.  @     <inp
2750: 75 74 20 74 79 70 65 3d 22 63 68 65 63 6b 62 6f  ut type="checkbo
2760: 78 22 20 6e 61 6d 65 3d 22 61 6f 22 25 73 28 6f  x" name="ao"%s(o
2770: 61 6f 29 3e 43 68 65 63 6b 2d 4f 75 74 3c 2f 69  ao)>Check-Out</i
2780: 6e 70 75 74 3e 3c 62 72 3e 0a 20 20 40 20 20 20  nput><br>.  @   
2790: 20 20 3c 69 6e 70 75 74 20 74 79 70 65 3d 22 63    <input type="c
27a0: 68 65 63 6b 62 6f 78 22 20 6e 61 6d 65 3d 22 61  heckbox" name="a
27b0: 68 22 25 73 28 6f 61 68 29 3e 48 69 73 74 6f 72  h"%s(oah)>Histor
27c0: 79 3c 2f 69 6e 70 75 74 3e 3c 62 72 3e 0a 20 20  y</input><br>.  
27d0: 40 20 20 20 20 20 3c 69 6e 70 75 74 20 74 79 70  @     <input typ
27e0: 65 3d 22 63 68 65 63 6b 62 6f 78 22 20 6e 61 6d  e="checkbox" nam
27f0: 65 3d 22 61 6a 22 25 73 28 6f 61 6a 29 3e 52 65  e="aj"%s(oaj)>Re
2800: 61 64 20 57 69 6b 69 3c 2f 69 6e 70 75 74 3e 3c  ad Wiki</input><
2810: 62 72 3e 0a 20 20 40 20 20 20 20 20 3c 69 6e 70  br>.  @     <inp
2820: 75 74 20 74 79 70 65 3d 22 63 68 65 63 6b 62 6f  ut type="checkbo
2830: 78 22 20 6e 61 6d 65 3d 22 61 66 22 25 73 28 6f  x" name="af"%s(o
2840: 61 66 29 3e 4e 65 77 20 57 69 6b 69 3c 2f 69 6e  af)>New Wiki</in
2850: 70 75 74 3e 3c 62 72 3e 0a 20 20 40 20 20 20 20  put><br>.  @    
2860: 20 3c 69 6e 70 75 74 20 74 79 70 65 3d 22 63 68   <input type="ch
2870: 65 63 6b 62 6f 78 22 20 6e 61 6d 65 3d 22 61 6d  eckbox" name="am
2880: 22 25 73 28 6f 61 6d 29 3e 41 70 70 65 6e 64 20  "%s(oam)>Append 
2890: 57 69 6b 69 3c 2f 69 6e 70 75 74 3e 3c 62 72 3e  Wiki</input><br>
28a0: 0a 20 20 40 20 20 20 20 20 3c 69 6e 70 75 74 20  .  @     <input 
28b0: 74 79 70 65 3d 22 63 68 65 63 6b 62 6f 78 22 20  type="checkbox" 
28c0: 6e 61 6d 65 3d 22 61 6b 22 25 73 28 6f 61 6b 29  name="ak"%s(oak)
28d0: 3e 57 72 69 74 65 20 57 69 6b 69 3c 2f 69 6e 70  >Write Wiki</inp
28e0: 75 74 3e 3c 62 72 3e 0a 20 20 40 20 20 20 20 20  ut><br>.  @     
28f0: 3c 69 6e 70 75 74 20 74 79 70 65 3d 22 63 68 65  <input type="che
2900: 63 6b 62 6f 78 22 20 6e 61 6d 65 3d 22 61 72 22  ckbox" name="ar"
2910: 25 73 28 6f 61 72 29 3e 52 65 61 64 20 54 6b 74  %s(oar)>Read Tkt
2920: 3c 2f 69 6e 70 75 74 3e 3c 62 72 3e 0a 20 20 40  </input><br>.  @
2930: 20 20 20 20 20 3c 69 6e 70 75 74 20 74 79 70 65       <input type
2940: 3d 22 63 68 65 63 6b 62 6f 78 22 20 6e 61 6d 65  ="checkbox" name
2950: 3d 22 61 6e 22 25 73 28 6f 61 6e 29 3e 4e 65 77  ="an"%s(oan)>New
2960: 20 54 6b 74 3c 2f 69 6e 70 75 74 3e 3c 62 72 3e   Tkt</input><br>
2970: 0a 20 20 40 20 20 20 20 20 3c 69 6e 70 75 74 20  .  @     <input 
2980: 74 79 70 65 3d 22 63 68 65 63 6b 62 6f 78 22 20  type="checkbox" 
2990: 6e 61 6d 65 3d 22 61 63 22 25 73 28 6f 61 63 29  name="ac"%s(oac)
29a0: 3e 41 70 70 65 6e 64 20 54 6b 74 3c 2f 69 6e 70  >Append Tkt</inp
29b0: 75 74 3e 3c 62 72 3e 0a 20 20 40 20 20 20 20 20  ut><br>.  @     
29c0: 3c 69 6e 70 75 74 20 74 79 70 65 3d 22 63 68 65  <input type="che
29d0: 63 6b 62 6f 78 22 20 6e 61 6d 65 3d 22 61 77 22  ckbox" name="aw"
29e0: 25 73 28 6f 61 77 29 3e 57 72 69 74 65 20 54 6b  %s(oaw)>Write Tk
29f0: 74 3c 2f 69 6e 70 75 74 3e 0a 20 20 40 20 20 20  t</input>.  @   
2a00: 3c 2f 74 64 3e 0a 20 20 40 20 3c 2f 74 72 3e 0a  </td>.  @ </tr>.
2a10: 20 20 40 20 3c 74 72 3e 0a 20 20 40 20 20 20 3c    @ <tr>.  @   <
2a20: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22  td align="right"
2a30: 3e 50 61 73 73 77 6f 72 64 3a 3c 2f 74 64 3e 0a  >Password:</td>.
2a40: 20 20 40 20 20 20 3c 74 64 3e 3c 69 6e 70 75 74    @   <td><input
2a50: 20 74 79 70 65 3d 22 70 61 73 73 77 6f 72 64 22   type="password"
2a60: 20 6e 61 6d 65 3d 22 70 77 22 20 76 61 6c 75 65   name="pw" value
2a70: 3d 22 22 3e 3c 2f 74 64 3e 0a 20 20 40 20 3c 2f  =""></td>.  @ </
2a80: 74 72 3e 0a 20 20 69 66 28 20 21 68 69 67 68 65  tr>.  if( !highe
2a90: 72 55 73 65 72 20 29 7b 0a 20 20 20 20 40 20 3c  rUser ){.    @ <
2aa0: 74 72 3e 0a 20 20 20 20 40 20 20 20 3c 74 64 3e  tr>.    @   <td>
2ab0: 26 6e 62 73 70 3c 2f 74 64 3e 0a 20 20 20 20 40  &nbsp</td>.    @
2ac0: 20 20 20 3c 74 64 3e 3c 69 6e 70 75 74 20 74 79     <td><input ty
2ad0: 70 65 3d 22 73 75 62 6d 69 74 22 20 6e 61 6d 65  pe="submit" name
2ae0: 3d 22 73 75 62 6d 69 74 22 20 76 61 6c 75 65 3d  ="submit" value=
2af0: 22 41 70 70 6c 79 20 43 68 61 6e 67 65 73 22 3e  "Apply Changes">
2b00: 0a 20 20 20 20 40 20 3c 2f 74 72 3e 0a 20 20 7d  .    @ </tr>.  }
2b10: 0a 20 20 40 20 3c 2f 74 61 62 6c 65 3e 3c 2f 74  .  @ </table></t
2b20: 64 3e 3c 2f 74 72 3e 3c 2f 74 61 62 6c 65 3e 0a  d></tr></table>.
2b30: 20 20 40 20 3c 70 3e 3c 62 3e 4e 6f 74 65 73 3a    @ <p><b>Notes:
2b40: 3c 2f 62 3e 3c 2f 70 3e 0a 20 20 40 20 3c 6f 6c  </b></p>.  @ <ol
2b50: 3e 0a 20 20 69 66 28 20 68 69 67 68 65 72 55 73  >.  if( higherUs
2b60: 65 72 20 29 7b 0a 20 20 20 20 40 20 3c 6c 69 3e  er ){.    @ <li>
2b70: 3c 70 3e 0a 20 20 20 20 40 20 55 73 65 72 20 25  <p>.    @ User %
2b80: 68 28 7a 49 64 29 20 68 61 73 20 53 65 74 75 70  h(zId) has Setup
2b90: 20 70 72 69 76 69 6c 65 67 65 73 20 61 6e 64 20   privileges and 
2ba0: 79 6f 75 20 6f 6e 6c 79 20 68 61 76 65 20 41 64  you only have Ad
2bb0: 6d 69 6e 20 70 72 69 76 69 6c 65 67 65 73 0a 20  min privileges. 
2bc0: 20 20 20 40 20 73 6f 20 79 6f 75 20 61 72 65 20     @ so you are 
2bd0: 6e 6f 74 20 70 65 72 6d 69 74 74 65 64 20 74 6f  not permitted to
2be0: 20 6d 61 6b 65 20 63 68 61 6e 67 65 73 20 74 6f   make changes to
2bf0: 20 25 68 28 7a 49 64 29 2e 0a 20 20 20 20 40 20   %h(zId)..    @ 
2c00: 3c 2f 70 3e 3c 2f 6c 69 3e 0a 20 20 20 20 40 0a  </p></li>.    @.
2c10: 20 20 7d 0a 20 20 40 0a 20 20 40 20 3c 6c 69 3e    }.  @.  @ <li>
2c20: 3c 70 3e 0a 20 20 40 20 54 68 65 20 3c 62 3e 44  <p>.  @ The <b>D
2c30: 65 6c 65 74 65 3c 2f 62 3e 20 70 72 69 76 69 6c  elete</b> privil
2c40: 65 67 65 20 67 69 76 65 20 74 68 65 20 75 73 65  ege give the use
2c50: 72 20 74 68 65 20 61 62 69 6c 69 74 79 20 74 6f  r the ability to
2c60: 20 65 72 61 73 65 0a 20 20 40 20 77 69 6b 69 2c   erase.  @ wiki,
2c70: 20 74 69 63 6b 65 74 73 2c 20 61 6e 64 20 61 74   tickets, and at
2c80: 74 74 61 63 68 6d 65 6e 74 73 20 74 68 61 74 20  ttachments that 
2c90: 68 61 76 65 20 62 65 65 6e 20 61 64 64 65 64 20  have been added 
2ca0: 62 79 20 61 6e 6f 6e 79 6d 6f 75 73 0a 20 20 40  by anonymous.  @
2cb0: 20 75 73 65 72 73 2e 20 20 54 68 69 73 20 63 61   users.  This ca
2cc0: 70 61 62 69 6c 69 74 79 20 69 73 20 69 6e 74 65  pability is inte
2cd0: 6e 64 65 64 20 66 6f 72 20 64 65 6c 65 74 69 6f  nded for deletio
2ce0: 6e 20 6f 66 20 73 70 61 6d 2e 0a 20 20 40 20 3c  n of spam..  @ <
2cf0: 2f 70 3e 3c 2f 6c 69 3e 0a 20 20 40 0a 20 20 40  /p></li>.  @.  @
2d00: 20 3c 6c 69 3e 3c 70 3e 0a 20 20 40 20 54 68 65   <li><p>.  @ The
2d10: 20 3c 62 3e 51 75 65 72 79 3c 2f 62 3e 20 70 72   <b>Query</b> pr
2d20: 69 76 69 6c 65 67 65 20 61 6c 6c 6f 77 73 20 74  ivilege allows t
2d30: 68 65 20 75 73 65 72 20 74 6f 20 63 72 65 61 74  he user to creat
2d40: 65 20 6f 72 20 65 64 69 74 0a 20 20 40 20 72 65  e or edit.  @ re
2d50: 70 6f 72 74 20 66 6f 72 6d 61 74 73 20 62 79 20  port formats by 
2d60: 73 70 65 63 69 66 79 69 6e 67 20 61 70 70 72 6f  specifying appro
2d70: 70 72 69 61 74 65 20 53 51 4c 2e 20 20 55 73 65  priate SQL.  Use
2d80: 72 73 20 63 61 6e 20 72 75 6e 20 0a 20 20 40 20  rs can run .  @ 
2d90: 65 78 69 73 74 69 6e 67 20 72 65 70 6f 72 74 73  existing reports
2da0: 20 77 69 74 68 6f 75 74 20 74 68 65 20 51 75 65   without the Que
2db0: 72 79 20 70 72 69 76 69 6c 65 67 65 2e 0a 20 20  ry privilege..  
2dc0: 40 20 3c 2f 70 3e 3c 2f 6c 69 3e 0a 20 20 40 0a  @ </p></li>.  @.
2dd0: 20 20 40 20 3c 6c 69 3e 3c 70 3e 0a 20 20 40 20    @ <li><p>.  @ 
2de0: 41 6e 20 3c 62 3e 41 64 6d 69 6e 3c 2f 62 3e 20  An <b>Admin</b> 
2df0: 75 73 65 72 20 63 61 6e 20 61 64 64 20 6f 74 68  user can add oth
2e00: 65 72 20 75 73 65 72 73 2c 20 63 72 65 61 74 65  er users, create
2e10: 20 6e 65 77 20 74 69 63 6b 65 74 20 72 65 70 6f   new ticket repo
2e20: 72 74 0a 20 20 40 20 66 6f 72 6d 61 74 73 2c 20  rt.  @ formats, 
2e30: 61 6e 64 20 63 68 61 6e 67 65 20 73 79 73 74 65  and change syste
2e40: 6d 20 64 65 66 61 75 6c 74 73 2e 20 20 42 75 74  m defaults.  But
2e50: 20 6f 6e 6c 79 20 74 68 65 20 3c 62 3e 53 65 74   only the <b>Set
2e60: 75 70 3c 2f 62 3e 20 75 73 65 72 0a 20 20 40 20  up</b> user.  @ 
2e70: 69 73 20 61 62 6c 65 20 74 6f 20 63 68 61 6e 67  is able to chang
2e80: 65 20 74 68 65 20 72 65 70 6f 73 69 74 6f 72 79  e the repository
2e90: 20 74 6f 0a 20 20 40 20 77 68 69 63 68 20 74 68   to.  @ which th
2ea0: 69 73 20 70 72 6f 67 72 61 6d 20 69 73 20 6c 69  is program is li
2eb0: 6e 6b 65 64 2e 0a 20 20 40 20 3c 2f 70 3e 3c 2f  nked..  @ </p></
2ec0: 6c 69 3e 0a 20 20 40 0a 20 20 40 20 3c 6c 69 3e  li>.  @.  @ <li>
2ed0: 3c 70 3e 0a 20 20 40 20 54 68 65 20 3c 62 3e 48  <p>.  @ The <b>H
2ee0: 69 73 74 6f 72 79 3c 2f 62 3e 20 70 72 69 76 69  istory</b> privi
2ef0: 6c 65 67 65 20 61 6c 6c 6f 77 73 20 61 20 75 73  lege allows a us
2f00: 65 72 20 74 6f 20 73 65 65 20 61 20 74 69 6d 65  er to see a time
2f10: 6c 69 6e 65 0a 20 20 40 20 77 69 74 68 20 68 79  line.  @ with hy
2f20: 70 65 72 6c 69 6e 6b 73 20 74 6f 20 76 65 72 73  perlinks to vers
2f30: 69 6f 6e 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 2c  ion information,
2f40: 20 74 6f 20 64 6f 77 6e 6c 6f 61 64 20 5a 49 50   to download ZIP
2f50: 20 61 72 63 68 69 76 65 73 0a 20 20 40 20 6f 66   archives.  @ of
2f60: 20 69 6e 64 69 76 69 64 75 61 6c 20 76 65 72 73   individual vers
2f70: 69 6f 6e 73 2c 20 61 6e 64 20 74 6f 20 63 6c 6f  ions, and to clo
2f80: 6e 65 20 74 68 65 20 72 65 70 6f 73 69 74 6f 72  ne the repositor
2f90: 79 2e 0a 20 20 40 20 3c 2f 70 3e 3c 2f 6c 69 3e  y..  @ </p></li>
2fa0: 0a 20 20 40 0a 20 20 40 20 3c 6c 69 3e 3c 70 3e  .  @.  @ <li><p>
2fb0: 0a 20 20 40 20 4e 6f 20 6c 6f 67 69 6e 20 69 73  .  @ No login is
2fc0: 20 72 65 71 75 69 72 65 64 20 66 6f 72 20 75 73   required for us
2fd0: 65 72 20 22 3c 62 3e 6e 6f 62 6f 64 79 3c 2f 62  er "<b>nobody</b
2fe0: 3e 22 2e 20 20 54 68 65 20 63 61 70 61 62 69 6c  >".  The capabil
2ff0: 69 74 69 65 73 0a 20 20 40 20 6f 66 20 74 68 69  ities.  @ of thi
3000: 73 20 75 73 65 72 20 61 72 65 20 61 76 61 69 6c  s user are avail
3010: 61 62 6c 65 20 74 6f 20 61 6e 79 6f 6e 65 20 77  able to anyone w
3020: 69 74 68 6f 75 74 20 73 75 70 70 6c 79 69 6e 67  ithout supplying
3030: 20 61 20 75 73 65 72 6e 61 6d 65 20 6f 72 0a 20   a username or. 
3040: 20 40 20 70 61 73 73 77 6f 72 64 2e 20 20 54 6f   @ password.  To
3050: 20 64 69 73 61 62 6c 65 20 6e 6f 62 6f 64 79 20   disable nobody 
3060: 61 63 63 65 73 73 2c 20 6d 61 6b 65 20 73 75 72  access, make sur
3070: 65 20 74 68 65 72 65 20 69 73 20 6e 6f 20 75 73  e there is no us
3080: 65 72 0a 20 20 40 20 77 69 74 68 20 61 6e 20 49  er.  @ with an I
3090: 44 20 6f 66 20 3c 62 3e 6e 6f 62 6f 64 79 3c 2f  D of <b>nobody</
30a0: 62 3e 20 6f 72 20 74 68 61 74 20 74 68 65 20 6e  b> or that the n
30b0: 6f 62 6f 64 79 20 75 73 65 72 20 68 61 73 20 6e  obody user has n
30c0: 6f 0a 20 20 40 20 63 61 70 61 62 69 6c 69 74 69  o.  @ capabiliti
30d0: 65 73 20 65 6e 61 62 6c 65 64 2e 20 20 54 68 65  es enabled.  The
30e0: 20 70 61 73 73 77 6f 72 64 20 66 6f 72 20 6e 6f   password for no
30f0: 62 6f 64 79 20 69 73 20 69 67 6e 6f 72 65 2e 20  body is ignore. 
3100: 20 54 6f 0a 20 20 40 20 61 76 6f 69 64 20 70 72   To.  @ avoid pr
3110: 6f 62 6c 65 6d 73 20 77 69 74 68 20 73 70 69 64  oblems with spid
3120: 65 72 73 20 6f 76 65 72 6c 6f 61 64 69 6e 67 20  ers overloading 
3130: 74 68 65 20 73 65 72 76 65 72 2c 20 69 74 20 69  the server, it i
3140: 73 20 73 75 67 67 65 73 74 65 64 0a 20 20 40 20  s suggested.  @ 
3150: 74 68 61 74 20 74 68 65 20 27 68 27 20 28 48 69  that the 'h' (Hi
3160: 73 74 6f 72 79 29 20 63 61 70 61 62 69 6c 69 74  story) capabilit
3170: 79 20 62 65 20 74 75 72 6e 65 64 20 6f 66 66 20  y be turned off 
3180: 66 6f 72 20 75 73 65 72 20 6e 6f 62 6f 64 79 2e  for user nobody.
3190: 0a 20 20 40 20 3c 2f 70 3e 3c 2f 6c 69 3e 0a 20  .  @ </p></li>. 
31a0: 20 40 0a 20 20 40 20 3c 6c 69 3e 3c 70 3e 0a 20   @.  @ <li><p>. 
31b0: 20 40 20 4c 6f 67 69 6e 20 69 73 20 72 65 71 75   @ Login is requ
31c0: 69 72 65 64 20 66 6f 72 20 75 73 65 72 20 22 3c  ired for user "<
31d0: 62 3e 61 6e 6f 6e 79 6d 6f 75 73 3c 2f 62 3e 22  b>anonymous</b>"
31e0: 20 62 75 74 20 74 68 65 20 70 61 73 73 77 6f 72   but the passwor
31f0: 64 0a 20 20 40 20 69 73 20 64 69 73 70 6c 61 79  d.  @ is display
3200: 65 64 20 6f 6e 20 74 68 65 20 6c 6f 67 69 6e 20  ed on the login 
3210: 73 63 72 65 65 6e 20 62 65 73 69 64 65 20 74 68  screen beside th
3220: 65 20 70 61 73 73 77 6f 72 64 20 65 6e 74 72 79  e password entry
3230: 20 62 6f 78 0a 20 20 40 20 73 6f 20 61 6e 79 62   box.  @ so anyb
3240: 6f 64 79 20 77 68 6f 20 63 61 6e 20 72 65 61 64  ody who can read
3250: 20 73 68 6f 75 6c 64 20 62 65 20 61 62 6c 65 20   should be able 
3260: 74 6f 20 6c 6f 67 69 6e 20 61 73 20 61 6e 6f 6e  to login as anon
3270: 79 6d 6f 75 73 2e 0a 20 20 40 20 4f 6e 20 74 68  ymous..  @ On th
3280: 65 20 6f 74 68 65 72 20 68 61 6e 64 2c 20 73 70  e other hand, sp
3290: 69 64 65 72 73 20 61 6e 64 20 77 65 62 2d 63 72  iders and web-cr
32a0: 61 77 6c 65 72 73 20 77 69 6c 6c 20 74 79 70 69  awlers will typi
32b0: 63 61 6c 6c 79 20 6e 6f 74 0a 20 20 40 20 62 65  cally not.  @ be
32c0: 20 61 62 6c 65 20 74 6f 20 6c 6f 67 69 6e 2e 20   able to login. 
32d0: 20 53 65 74 20 74 68 65 20 63 61 70 61 62 69 6c   Set the capabil
32e0: 69 74 69 65 73 20 6f 66 20 74 68 65 20 61 6e 6f  ities of the ano
32f0: 6e 79 6d 6f 75 73 20 75 73 65 72 0a 20 20 40 20  nymous user.  @ 
3300: 74 6f 20 74 68 69 6e 67 73 20 74 68 61 74 20 79  to things that y
3310: 6f 75 20 77 61 6e 74 20 61 6e 79 20 68 75 6d 61  ou want any huma
3320: 6e 20 74 6f 20 62 65 20 61 62 6c 65 20 74 6f 20  n to be able to 
3330: 64 6f 2c 20 62 75 74 20 6e 6f 20 61 6e 79 0a 20  do, but no any. 
3340: 20 40 20 73 70 69 64 65 72 2e 0a 20 20 40 20 3c   @ spider..  @ <
3350: 2f 70 3e 3c 2f 6c 69 3e 0a 20 20 40 20 3c 2f 66  /p></li>.  @ </f
3360: 6f 72 6d 3e 0a 20 20 73 74 79 6c 65 5f 66 6f 6f  orm>.  style_foo
3370: 74 65 72 28 29 3b 0a 7d 0a 0a 0a 2f 2a 0a 2a 2a  ter();.}.../*.**
3380: 20 47 65 6e 65 72 61 74 65 20 61 20 63 68 65 63   Generate a chec
3390: 6b 62 6f 78 20 66 6f 72 20 61 6e 20 61 74 74 72  kbox for an attr
33a0: 69 62 75 74 65 2e 0a 2a 2f 0a 73 74 61 74 69 63  ibute..*/.static
33b0: 20 76 6f 69 64 20 6f 6e 6f 66 66 5f 61 74 74 72   void onoff_attr
33c0: 69 62 75 74 65 28 0a 20 20 63 6f 6e 73 74 20 63  ibute(.  const c
33d0: 68 61 72 20 2a 7a 4c 61 62 65 6c 2c 20 20 20 2f  har *zLabel,   /
33e0: 2a 20 54 68 65 20 74 65 78 74 20 6c 61 62 65 6c  * The text label
33f0: 20 6f 6e 20 74 68 65 20 63 68 65 63 6b 62 6f 78   on the checkbox
3400: 20 2a 2f 0a 20 20 63 6f 6e 73 74 20 63 68 61 72   */.  const char
3410: 20 2a 7a 56 61 72 2c 20 20 20 20 20 2f 2a 20 54   *zVar,     /* T
3420: 68 65 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67  he corresponding
3430: 20 72 6f 77 20 69 6e 20 74 68 65 20 56 41 52 20   row in the VAR 
3440: 74 61 62 6c 65 20 2a 2f 0a 20 20 63 6f 6e 73 74  table */.  const
3450: 20 63 68 61 72 20 2a 7a 51 50 61 72 6d 2c 20 20   char *zQParm,  
3460: 20 2f 2a 20 54 68 65 20 71 75 65 72 79 20 70 61   /* The query pa
3470: 72 61 6d 65 74 65 72 20 2a 2f 0a 20 20 69 6e 74  rameter */.  int
3480: 20 64 66 6c 74 56 61 6c 20 20 20 20 20 20 20 20   dfltVal        
3490: 20 20 20 2f 2a 20 44 65 66 61 75 6c 74 20 76 61     /* Default va
34a0: 6c 75 65 20 69 66 20 56 41 52 20 74 61 62 6c 65  lue if VAR table
34b0: 20 65 6e 74 72 79 20 64 6f 65 73 20 6e 6f 74 20   entry does not 
34c0: 65 78 69 73 74 20 2a 2f 0a 29 7b 0a 20 20 63 6f  exist */.){.  co
34d0: 6e 73 74 20 63 68 61 72 20 2a 7a 56 61 6c 20 3d  nst char *zVal =
34e0: 20 64 62 5f 67 65 74 28 7a 56 61 72 2c 20 30 29   db_get(zVar, 0)
34f0: 3b 0a 20 20 63 6f 6e 73 74 20 63 68 61 72 20 2a  ;.  const char *
3500: 7a 51 20 3d 20 50 28 7a 51 50 61 72 6d 29 3b 0a  zQ = P(zQParm);.
3510: 20 20 69 6e 74 20 69 56 61 6c 3b 0a 20 20 69 66    int iVal;.  if
3520: 28 20 7a 56 61 6c 20 29 7b 0a 20 20 20 20 69 56  ( zVal ){.    iV
3530: 61 6c 20 3d 20 61 74 6f 69 28 7a 56 61 6c 29 3b  al = atoi(zVal);
3540: 0a 20 20 7d 65 6c 73 65 7b 0a 20 20 20 20 69 56  .  }else{.    iV
3550: 61 6c 20 3d 20 64 66 6c 74 56 61 6c 3b 0a 20 20  al = dfltVal;.  
3560: 7d 0a 20 20 69 66 28 20 7a 51 3d 3d 30 20 26 26  }.  if( zQ==0 &&
3570: 20 50 28 22 73 75 62 6d 69 74 22 29 20 29 7b 0a   P("submit") ){.
3580: 20 20 20 20 7a 51 20 3d 20 22 6f 66 66 22 3b 0a      zQ = "off";.
3590: 20 20 7d 0a 20 20 69 66 28 20 7a 51 20 29 7b 0a    }.  if( zQ ){.
35a0: 20 20 20 20 69 6e 74 20 69 51 20 3d 20 73 74 72      int iQ = str
35b0: 63 6d 70 28 7a 51 2c 22 6f 6e 22 29 3d 3d 30 20  cmp(zQ,"on")==0 
35c0: 7c 7c 20 61 74 6f 69 28 7a 51 29 3b 0a 20 20 20  || atoi(zQ);.   
35d0: 20 69 66 28 20 69 51 21 3d 69 56 61 6c 20 29 7b   if( iQ!=iVal ){
35e0: 0a 20 20 20 20 20 20 64 62 5f 73 65 74 28 7a 56  .      db_set(zV
35f0: 61 72 2c 20 69 51 20 3f 20 22 31 22 20 3a 20 22  ar, iQ ? "1" : "
3600: 30 22 29 3b 0a 20 20 20 20 20 20 69 56 61 6c 20  0");.      iVal 
3610: 3d 20 69 51 3b 0a 20 20 20 20 7d 0a 20 20 7d 0a  = iQ;.    }.  }.
3620: 20 20 69 66 28 20 69 56 61 6c 20 29 7b 0a 20 20    if( iVal ){.  
3630: 20 20 40 20 3c 69 6e 70 75 74 20 74 79 70 65 3d    @ <input type=
3640: 22 63 68 65 63 6b 62 6f 78 22 20 6e 61 6d 65 3d  "checkbox" name=
3650: 22 25 73 28 7a 51 50 61 72 6d 29 22 20 63 68 65  "%s(zQParm)" che
3660: 63 6b 65 64 3e 25 73 28 7a 4c 61 62 65 6c 29 3c  cked>%s(zLabel)<
3670: 2f 69 6e 70 75 74 3e 0a 20 20 7d 65 6c 73 65 7b  /input>.  }else{
3680: 0a 20 20 20 20 40 20 3c 69 6e 70 75 74 20 74 79  .    @ <input ty
3690: 70 65 3d 22 63 68 65 63 6b 62 6f 78 22 20 6e 61  pe="checkbox" na
36a0: 6d 65 3d 22 25 73 28 7a 51 50 61 72 6d 29 22 3e  me="%s(zQParm)">
36b0: 25 73 28 7a 4c 61 62 65 6c 29 3c 2f 69 6e 70 75  %s(zLabel)</inpu
36c0: 74 3e 0a 20 20 7d 0a 7d 0a 0a 2f 2a 0a 2a 2a 20  t>.  }.}../*.** 
36d0: 47 65 6e 65 72 61 74 65 20 61 6e 20 65 6e 74 72  Generate an entr
36e0: 79 20 62 6f 78 20 66 6f 72 20 61 6e 20 61 74 74  y box for an att
36f0: 72 69 62 75 74 65 2e 0a 2a 2f 0a 73 74 61 74 69  ribute..*/.stati
3700: 63 20 76 6f 69 64 20 65 6e 74 72 79 5f 61 74 74  c void entry_att
3710: 72 69 62 75 74 65 28 0a 20 20 63 6f 6e 73 74 20  ribute(.  const 
3720: 63 68 61 72 20 2a 7a 4c 61 62 65 6c 2c 20 20 20  char *zLabel,   
3730: 2f 2a 20 54 68 65 20 74 65 78 74 20 6c 61 62 65  /* The text labe
3740: 6c 20 6f 6e 20 74 68 65 20 65 6e 74 72 79 20 62  l on the entry b
3750: 6f 78 20 2a 2f 0a 20 20 69 6e 74 20 77 69 64 74  ox */.  int widt
3760: 68 2c 20 20 20 20 20 20 20 20 20 20 20 20 2f 2a  h,            /*
3770: 20 57 69 64 74 68 20 6f 66 20 74 68 65 20 65 6e   Width of the en
3780: 74 72 79 20 62 6f 78 20 2a 2f 0a 20 20 63 6f 6e  try box */.  con
3790: 73 74 20 63 68 61 72 20 2a 7a 56 61 72 2c 20 20  st char *zVar,  
37a0: 20 20 20 2f 2a 20 54 68 65 20 63 6f 72 72 65 73     /* The corres
37b0: 70 6f 6e 64 69 6e 67 20 72 6f 77 20 69 6e 20 74  ponding row in t
37c0: 68 65 20 56 41 52 20 74 61 62 6c 65 20 2a 2f 0a  he VAR table */.
37d0: 20 20 63 6f 6e 73 74 20 63 68 61 72 20 2a 7a 51    const char *zQ
37e0: 50 61 72 6d 2c 20 20 20 2f 2a 20 54 68 65 20 71  Parm,   /* The q
37f0: 75 65 72 79 20 70 61 72 61 6d 65 74 65 72 20 2a  uery parameter *
3800: 2f 0a 20 20 63 6f 6e 73 74 20 63 68 61 72 20 2a  /.  const char *
3810: 7a 44 66 6c 74 20 20 20 20 20 2f 2a 20 44 65 66  zDflt     /* Def
3820: 61 75 6c 74 20 76 61 6c 75 65 20 69 66 20 56 41  ault value if VA
3830: 52 20 74 61 62 6c 65 20 65 6e 74 72 79 20 64 6f  R table entry do
3840: 65 73 20 6e 6f 74 20 65 78 69 73 74 20 2a 2f 0a  es not exist */.
3850: 29 7b 0a 20 20 63 6f 6e 73 74 20 63 68 61 72 20  ){.  const char 
3860: 2a 7a 56 61 6c 20 3d 20 64 62 5f 67 65 74 28 7a  *zVal = db_get(z
3870: 56 61 72 2c 20 7a 44 66 6c 74 29 3b 0a 20 20 63  Var, zDflt);.  c
3880: 6f 6e 73 74 20 63 68 61 72 20 2a 7a 51 20 3d 20  onst char *zQ = 
3890: 50 28 7a 51 50 61 72 6d 29 3b 0a 20 20 69 66 28  P(zQParm);.  if(
38a0: 20 7a 51 20 26 26 20 73 74 72 63 6d 70 28 7a 51   zQ && strcmp(zQ
38b0: 2c 7a 56 61 6c 29 21 3d 30 20 29 7b 0a 20 20 20  ,zVal)!=0 ){.   
38c0: 20 64 62 5f 73 65 74 28 7a 56 61 72 2c 20 7a 51   db_set(zVar, zQ
38d0: 29 3b 0a 20 20 20 20 7a 56 61 6c 20 3d 20 7a 51  );.    zVal = zQ
38e0: 3b 0a 20 20 7d 0a 20 20 40 20 3c 69 6e 70 75 74  ;.  }.  @ <input
38f0: 20 74 79 70 65 3d 22 74 65 78 74 22 20 6e 61 6d   type="text" nam
3900: 65 3d 22 25 73 28 7a 51 50 61 72 6d 29 22 20 76  e="%s(zQParm)" v
3910: 61 6c 75 65 3d 22 25 68 28 7a 56 61 6c 29 22 20  alue="%h(zVal)" 
3920: 73 69 7a 65 3d 22 25 64 28 77 69 64 74 68 29 22  size="%d(width)"
3930: 3e 0a 20 20 40 20 25 73 28 7a 4c 61 62 65 6c 29  >.  @ %s(zLabel)
3940: 0a 7d 0a 0a 0a 0a 2f 2a 0a 2a 2a 20 57 45 42 50  .}..../*.** WEBP
3950: 41 47 45 3a 20 73 65 74 75 70 5f 61 63 63 65 73  AGE: setup_acces
3960: 73 0a 2a 2f 0a 76 6f 69 64 20 73 65 74 75 70 5f  s.*/.void setup_
3970: 61 63 63 65 73 73 28 76 6f 69 64 29 7b 0a 20 20  access(void){.  
3980: 6c 6f 67 69 6e 5f 63 68 65 63 6b 5f 63 72 65 64  login_check_cred
3990: 65 6e 74 69 61 6c 73 28 29 3b 0a 20 20 69 66 28  entials();.  if(
39a0: 20 21 67 2e 6f 6b 53 65 74 75 70 20 29 7b 0a 20   !g.okSetup ){. 
39b0: 20 20 20 6c 6f 67 69 6e 5f 6e 65 65 64 65 64 28     login_needed(
39c0: 29 3b 0a 20 20 7d 0a 0a 20 20 73 74 79 6c 65 5f  );.  }..  style_
39d0: 68 65 61 64 65 72 28 22 41 63 63 65 73 73 20 43  header("Access C
39e0: 6f 6e 74 72 6f 6c 20 53 65 74 74 69 6e 67 73 22  ontrol Settings"
39f0: 29 3b 0a 20 20 64 62 5f 62 65 67 69 6e 5f 74 72  );.  db_begin_tr
3a00: 61 6e 73 61 63 74 69 6f 6e 28 29 3b 0a 20 20 40  ansaction();.  @
3a10: 20 3c 66 6f 72 6d 20 61 63 74 69 6f 6e 3d 22 25   <form action="%
3a20: 73 28 67 2e 7a 42 61 73 65 55 52 4c 29 2f 73 65  s(g.zBaseURL)/se
3a30: 74 75 70 5f 61 63 63 65 73 73 22 20 6d 65 74 68  tup_access" meth
3a40: 6f 64 3d 22 50 4f 53 54 22 3e 0a 0a 20 20 40 20  od="POST">..  @ 
3a50: 3c 68 72 3e 0a 20 20 6f 6e 6f 66 66 5f 61 74 74  <hr>.  onoff_att
3a60: 72 69 62 75 74 65 28 22 52 65 71 75 69 72 65 20  ribute("Require 
3a70: 70 61 73 73 77 6f 72 64 20 66 6f 72 20 6c 6f 63  password for loc
3a80: 61 6c 20 61 63 63 65 73 73 22 2c 0a 20 20 20 20  al access",.    
3a90: 20 22 61 75 74 68 65 6e 74 69 63 61 74 65 2d 6c   "authenticate-l
3aa0: 6f 63 61 6c 68 6f 73 74 22 2c 20 22 6c 6f 63 61  ocalhost", "loca
3ab0: 6c 61 75 74 68 22 2c 20 31 29 3b 0a 20 20 40 20  lauth", 1);.  @ 
3ac0: 3c 70 3e 57 68 65 6e 20 65 6e 61 62 6c 65 64 2c  <p>When enabled,
3ad0: 20 74 68 65 20 70 61 73 73 77 6f 72 64 20 73 69   the password si
3ae0: 67 6e 2d 69 6e 20 69 73 20 72 65 71 75 69 72 65  gn-in is require
3af0: 64 20 66 6f 72 0a 20 20 40 20 77 65 62 20 61 63  d for.  @ web ac
3b00: 63 65 73 73 20 63 6f 6d 69 6e 67 20 66 72 6f 6d  cess coming from
3b10: 20 31 32 37 2e 30 2e 30 2e 31 2e 20 20 57 68 65   127.0.0.1.  Whe
3b20: 6e 20 64 69 73 61 62 6c 65 64 2c 20 77 65 62 20  n disabled, web 
3b30: 61 63 63 65 73 73 0a 20 20 40 20 66 72 6f 6d 20  access.  @ from 
3b40: 31 32 37 2e 30 2e 30 2e 31 20 69 73 20 61 6c 6c  127.0.0.1 is all
3b50: 6f 77 73 20 77 69 74 68 6f 75 74 20 61 6e 79 20  ows without any 
3b60: 6c 6f 67 69 6e 20 2d 20 74 68 65 20 75 73 65 72  login - the user
3b70: 20 69 64 20 69 73 20 73 65 6c 65 63 74 65 64 0a   id is selected.
3b80: 20 20 40 20 66 72 6f 6d 20 74 68 65 20 7e 2f 2e    @ from the ~/.
3b90: 66 6f 73 73 69 6c 20 64 61 74 61 62 61 73 65 2e  fossil database.
3ba0: 20 50 61 73 73 77 6f 72 64 20 6c 6f 67 69 6e 20   Password login 
3bb0: 69 73 20 61 6c 77 61 79 73 20 72 65 71 75 69 72  is always requir
3bc0: 65 64 0a 20 20 40 20 66 6f 72 20 69 6e 63 6f 6d  ed.  @ for incom
3bd0: 69 6e 67 20 77 65 62 20 63 6f 6e 6e 65 63 74 69  ing web connecti
3be0: 6f 6e 73 20 6f 6e 20 69 6e 74 65 72 6e 65 74 20  ons on internet 
3bf0: 61 64 64 72 65 73 73 65 73 20 6f 74 68 65 72 20  addresses other 
3c00: 74 68 61 6e 0a 20 20 40 20 31 32 37 2e 30 2e 30  than.  @ 127.0.0
3c10: 2e 31 2e 3c 2f 70 3e 3c 2f 6c 69 3e 0a 0a 20 20  .1.</p></li>..  
3c20: 40 20 3c 68 72 3e 0a 20 20 65 6e 74 72 79 5f 61  @ <hr>.  entry_a
3c30: 74 74 72 69 62 75 74 65 28 22 4c 6f 67 69 6e 20  ttribute("Login 
3c40: 65 78 70 69 72 61 74 69 6f 6e 20 74 69 6d 65 22  expiration time"
3c50: 2c 20 36 2c 20 22 63 6f 6f 6b 69 65 2d 65 78 70  , 6, "cookie-exp
3c60: 69 72 65 22 2c 20 22 63 65 78 22 2c 20 22 38 37  ire", "cex", "87
3c70: 36 36 22 29 3b 0a 20 20 40 20 3c 70 3e 54 68 65  66");.  @ <p>The
3c80: 20 6e 75 6d 62 65 72 20 6f 66 20 68 6f 75 72 73   number of hours
3c90: 20 66 6f 72 20 77 68 69 63 68 20 61 20 6c 6f 67   for which a log
3ca0: 69 6e 20 69 73 20 76 61 6c 69 64 2e 20 20 54 68  in is valid.  Th
3cb0: 69 73 20 6d 75 73 74 20 62 65 20 61 0a 20 20 40  is must be a.  @
3cc0: 20 70 6f 73 69 74 69 76 65 20 6e 75 6d 62 65 72   positive number
3cd0: 2e 20 20 54 68 65 20 64 65 66 61 75 6c 74 20 69  .  The default i
3ce0: 73 20 38 37 36 30 20 68 6f 75 72 73 20 77 68 69  s 8760 hours whi
3cf0: 63 68 20 69 73 20 61 70 70 72 6f 78 69 6d 61 74  ch is approximat
3d00: 65 6c 79 20 65 71 75 61 6c 0a 20 20 40 20 74 6f  ely equal.  @ to
3d10: 20 61 20 79 65 61 72 2e 3c 2f 70 3e 0a 20 20 20   a year.</p>.   
3d20: 0a 20 20 40 20 3c 68 72 3e 0a 20 20 6f 6e 6f 66  .  @ <hr>.  onof
3d30: 66 5f 61 74 74 72 69 62 75 74 65 28 22 41 6c 6c  f_attribute("All
3d40: 6f 77 20 61 6e 6f 6e 79 6d 6f 75 73 20 73 69 67  ow anonymous sig
3d50: 6e 75 70 22 2c 20 22 61 6e 6f 6e 2d 73 69 67 6e  nup", "anon-sign
3d60: 75 70 22 2c 20 22 61 73 75 22 2c 20 30 29 3b 0a  up", "asu", 0);.
3d70: 20 20 40 20 3c 70 3e 41 6c 6c 6f 77 20 75 73 65    @ <p>Allow use
3d80: 72 73 20 74 6f 20 63 72 65 61 74 65 20 74 68 65  rs to create the
3d90: 69 72 20 6f 77 6e 20 61 63 63 6f 75 6e 74 73 3c  ir own accounts<
3da0: 2f 70 3e 0a 20 20 20 0a 20 20 40 20 3c 68 72 3e  /p>.   .  @ <hr>
3db0: 0a 20 20 40 20 3c 70 3e 3c 69 6e 70 75 74 20 74  .  @ <p><input t
3dc0: 79 70 65 3d 22 73 75 62 6d 69 74 22 20 20 6e 61  ype="submit"  na
3dd0: 6d 65 3d 22 73 75 62 6d 69 74 22 20 76 61 6c 75  me="submit" valu
3de0: 65 3d 22 41 70 70 6c 79 20 43 68 61 6e 67 65 73  e="Apply Changes
3df0: 22 3e 3c 2f 70 3e 0a 20 20 40 20 3c 2f 66 6f 72  "></p>.  @ </for
3e00: 6d 3e 0a 20 20 64 62 5f 65 6e 64 5f 74 72 61 6e  m>.  db_end_tran
3e10: 73 61 63 74 69 6f 6e 28 30 29 3b 0a 20 20 73 74  saction(0);.  st
3e20: 79 6c 65 5f 66 6f 6f 74 65 72 28 29 3b 0a 7d 0a  yle_footer();.}.
3e30: 0a 2f 2a 0a 2a 2a 20 57 45 42 50 41 47 45 3a 20  ./*.** WEBPAGE: 
3e40: 73 65 74 75 70 5f 63 6f 6e 66 69 67 0a 2a 2f 0a  setup_config.*/.
3e50: 76 6f 69 64 20 73 65 74 75 70 5f 63 6f 6e 66 69  void setup_confi
3e60: 67 28 76 6f 69 64 29 7b 0a 20 20 6c 6f 67 69 6e  g(void){.  login
3e70: 5f 63 68 65 63 6b 5f 63 72 65 64 65 6e 74 69 61  _check_credentia
3e80: 6c 73 28 29 3b 0a 20 20 69 66 28 20 21 67 2e 6f  ls();.  if( !g.o
3e90: 6b 53 65 74 75 70 20 29 7b 0a 20 20 20 20 6c 6f  kSetup ){.    lo
3ea0: 67 69 6e 5f 6e 65 65 64 65 64 28 29 3b 0a 20 20  gin_needed();.  
3eb0: 7d 0a 0a 20 20 73 74 79 6c 65 5f 68 65 61 64 65  }..  style_heade
3ec0: 72 28 22 57 57 57 20 43 6f 6e 66 69 67 75 72 61  r("WWW Configura
3ed0: 74 69 6f 6e 22 29 3b 0a 20 20 64 62 5f 62 65 67  tion");.  db_beg
3ee0: 69 6e 5f 74 72 61 6e 73 61 63 74 69 6f 6e 28 29  in_transaction()
3ef0: 3b 0a 20 20 40 20 3c 66 6f 72 6d 20 61 63 74 69  ;.  @ <form acti
3f00: 6f 6e 3d 22 25 73 28 67 2e 7a 42 61 73 65 55 52  on="%s(g.zBaseUR
3f10: 4c 29 2f 73 65 74 75 70 5f 63 6f 6e 66 69 67 22  L)/setup_config"
3f20: 20 6d 65 74 68 6f 64 3d 22 50 4f 53 54 22 3e 0a   method="POST">.
3f30: 0a 20 20 40 20 3c 68 72 3e 0a 20 20 65 6e 74 72  .  @ <hr>.  entr
3f40: 79 5f 61 74 74 72 69 62 75 74 65 28 22 48 6f 6d  y_attribute("Hom
3f50: 65 20 70 61 67 65 22 2c 20 36 30 2c 20 22 68 6f  e page", 60, "ho
3f60: 6d 65 70 61 67 65 22 2c 20 22 68 70 22 2c 20 22  mepage", "hp", "
3f70: 22 29 3b 0a 20 20 40 20 3c 70 3e 54 68 65 20 6e  ");.  @ <p>The n
3f80: 61 6d 65 20 6f 66 20 61 20 77 69 6b 69 20 66 69  ame of a wiki fi
3f90: 6c 65 20 74 68 61 74 20 69 73 20 74 68 65 20 68  le that is the h
3fa0: 6f 6d 65 70 61 67 65 20 66 6f 72 20 74 68 65 20  omepage for the 
3fb0: 77 65 62 73 69 74 65 2e 0a 20 20 40 20 54 68 65  website..  @ The
3fc0: 20 68 6f 6d 65 20 70 61 67 65 20 69 73 20 74 68   home page is th
3fd0: 65 20 70 61 67 65 20 74 68 61 74 20 69 73 20 64  e page that is d
3fe0: 69 73 70 6c 61 79 65 64 20 62 79 20 74 68 65 20  isplayed by the 
3ff0: 22 48 6f 6d 65 22 20 6c 69 6e 6b 0a 20 20 40 20  "Home" link.  @ 
4000: 61 74 20 74 68 65 20 74 6f 70 20 6f 66 20 74 68  at the top of th
4010: 69 73 20 73 63 72 65 65 6e 2e 3c 2f 70 3e 0a 0a  is screen.</p>..
4020: 20 20 65 6e 74 72 79 5f 61 74 74 72 69 62 75 74    entry_attribut
4030: 65 28 22 54 69 63 6b 65 74 20 73 75 62 64 69 72  e("Ticket subdir
4040: 65 63 74 6f 72 79 22 2c 20 36 30 2c 20 22 74 69  ectory", 60, "ti
4050: 63 6b 65 74 2d 73 75 62 64 69 72 22 2c 20 22 74  cket-subdir", "t
4060: 73 64 22 2c 20 22 22 29 3b 0a 20 20 40 20 3c 70  sd", "");.  @ <p
4070: 3e 41 20 73 75 62 64 69 72 65 63 74 6f 72 79 20  >A subdirectory 
4080: 69 6e 20 74 68 65 20 66 69 6c 65 20 68 69 65 72  in the file hier
4090: 61 72 63 68 79 20 74 68 61 74 20 63 6f 6e 74 61  archy that conta
40a0: 69 6e 73 20 61 6c 6c 20 74 72 6f 75 62 6c 65 0a  ins all trouble.
40b0: 20 20 40 20 74 69 63 6b 65 74 73 2e 20 20 4c 65    @ tickets.  Le
40c0: 61 76 65 20 74 68 69 73 20 62 6c 61 6e 6b 20 74  ave this blank t
40d0: 6f 20 64 69 73 61 62 6c 65 20 74 69 63 6b 65 74  o disable ticket
40e0: 69 6e 67 2e 20 20 54 69 63 6b 65 74 73 20 74 65  ing.  Tickets te
40f0: 78 74 0a 20 20 40 20 66 69 6c 65 73 20 77 69 74  xt.  @ files wit
4100: 68 69 6e 20 74 68 69 73 20 73 75 62 64 69 72 65  hin this subdire
4110: 63 74 6f 72 79 20 63 6f 6e 74 61 69 6e 69 6e 67  ctory containing
4120: 20 61 20 70 61 72 74 69 63 75 6c 61 72 20 66 6f   a particular fo
4130: 72 6d 61 74 0a 20 20 40 20 28 64 6f 63 75 6d 65  rmat.  @ (docume
4140: 6e 74 65 64 20 73 65 70 61 72 61 74 65 6c 79 29  nted separately)
4150: 20 61 6e 64 20 77 69 74 68 20 74 68 65 20 22 2e   and with the ".
4160: 74 6b 74 22 20 73 75 66 66 69 78 2e 3c 2f 70 3e  tkt" suffix.</p>
4170: 0a 0a 20 20 65 6e 74 72 79 5f 61 74 74 72 69 62  ..  entry_attrib
4180: 75 74 65 28 22 57 69 6b 69 20 73 75 62 64 69 72  ute("Wiki subdir
4190: 65 63 74 6f 72 79 22 2c 20 36 30 2c 20 22 77 69  ectory", 60, "wi
41a0: 6b 69 2d 73 75 62 64 69 72 22 2c 20 22 77 73 64  ki-subdir", "wsd
41b0: 22 2c 20 22 22 29 3b 0a 20 20 40 20 3c 70 3e 41  ", "");.  @ <p>A
41c0: 20 73 75 62 64 69 72 65 63 74 6f 72 79 20 69 6e   subdirectory in
41d0: 20 74 68 65 20 66 69 6c 65 20 68 69 65 72 61 72   the file hierar
41e0: 63 68 79 20 74 68 61 74 20 63 6f 6e 74 61 69 6e  chy that contain
41f0: 73 20 77 69 6b 69 20 70 61 67 65 73 2e 0a 20 20  s wiki pages..  
4200: 40 20 4c 65 61 76 65 20 74 68 69 73 20 62 6c 61  @ Leave this bla
4210: 6e 6b 20 74 6f 20 64 69 73 61 62 6c 65 20 77 69  nk to disable wi
4220: 6b 69 2e 20 20 57 69 6b 69 20 70 61 67 65 73 20  ki.  Wiki pages 
4230: 61 72 65 0a 20 20 40 20 66 69 6c 65 73 20 77 69  are.  @ files wi
4240: 74 68 69 6e 20 74 68 69 73 20 73 75 62 64 69 72  thin this subdir
4250: 65 63 74 6f 72 79 20 77 68 6f 73 65 20 6e 61 6d  ectory whose nam
4260: 65 20 69 73 20 68 65 20 77 69 6b 69 20 70 61 67  e is he wiki pag
4270: 65 20 74 69 74 6c 65 0a 20 20 40 20 61 6e 64 20  e title.  @ and 
4280: 77 69 74 68 20 74 68 65 20 73 75 66 66 69 78 20  with the suffix 
4290: 22 2e 77 69 6b 69 22 2e 3c 2f 70 3e 0a 0a 20 20  ".wiki".</p>..  
42a0: 20 0a 20 20 40 20 3c 68 72 3e 0a 20 20 40 20 3c   .  @ <hr>.  @ <
42b0: 70 3e 3c 69 6e 70 75 74 20 74 79 70 65 3d 22 73  p><input type="s
42c0: 75 62 6d 69 74 22 20 20 6e 61 6d 65 3d 22 73 75  ubmit"  name="su
42d0: 62 6d 69 74 22 20 76 61 6c 75 65 3d 22 41 70 70  bmit" value="App
42e0: 6c 79 20 43 68 61 6e 67 65 73 22 3e 3c 2f 70 3e  ly Changes"></p>
42f0: 0a 20 20 40 20 3c 2f 66 6f 72 6d 3e 0a 20 20 64  .  @ </form>.  d
4300: 62 5f 65 6e 64 5f 74 72 61 6e 73 61 63 74 69 6f  b_end_transactio
4310: 6e 28 30 29 3b 0a 20 20 73 74 79 6c 65 5f 66 6f  n(0);.  style_fo
4320: 6f 74 65 72 28 29 3b 0a 7d 0a                    oter();.}.