Hex Artifact Content
Not logged in

Artifact edc2899316eacd69ee712e68b296bc1b2e2666a3:

File src/my_page.c part of check-in [334f8e6e2f] - Added rudimentary /my page. by stephan on 2008-02-03 22:07:24.

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 20 43 6f 70 79  ard Hipp.** Copy
0030: 72 69 67 68 74 20 28 63 29 20 32 30 30 38 20 53  right (c) 2008 S
0040: 74 65 70 68 61 6e 20 42 65 61 6c 0a 2a 2a 0a 2a  tephan Beal.**.*
0050: 2a 20 54 68 69 73 20 70 72 6f 67 72 61 6d 20 69  * This program i
0060: 73 20 66 72 65 65 20 73 6f 66 74 77 61 72 65 3b  s free software;
0070: 20 79 6f 75 20 63 61 6e 20 72 65 64 69 73 74 72   you can redistr
0080: 69 62 75 74 65 20 69 74 20 61 6e 64 2f 6f 72 0a  ibute it and/or.
0090: 2a 2a 20 6d 6f 64 69 66 79 20 69 74 20 75 6e 64  ** modify it und
00a0: 65 72 20 74 68 65 20 74 65 72 6d 73 20 6f 66 20  er the terms of 
00b0: 74 68 65 20 47 4e 55 20 47 65 6e 65 72 61 6c 20  the GNU General 
00c0: 50 75 62 6c 69 63 0a 2a 2a 20 4c 69 63 65 6e 73  Public.** Licens
00d0: 65 20 61 73 20 70 75 62 6c 69 73 68 65 64 20 62  e as published b
00e0: 79 20 74 68 65 20 46 72 65 65 20 53 6f 66 74 77  y the Free Softw
00f0: 61 72 65 20 46 6f 75 6e 64 61 74 69 6f 6e 3b 20  are Foundation; 
0100: 65 69 74 68 65 72 0a 2a 2a 20 76 65 72 73 69 6f  either.** versio
0110: 6e 20 32 20 6f 66 20 74 68 65 20 4c 69 63 65 6e  n 2 of the Licen
0120: 73 65 2c 20 6f 72 20 28 61 74 20 79 6f 75 72 20  se, or (at your 
0130: 6f 70 74 69 6f 6e 29 20 61 6e 79 20 6c 61 74 65  option) any late
0140: 72 20 76 65 72 73 69 6f 6e 2e 0a 2a 2a 0a 2a 2a  r version..**.**
0150: 20 54 68 69 73 20 70 72 6f 67 72 61 6d 20 69 73   This program is
0160: 20 64 69 73 74 72 69 62 75 74 65 64 20 69 6e 20   distributed in 
0170: 74 68 65 20 68 6f 70 65 20 74 68 61 74 20 69 74  the hope that it
0180: 20 77 69 6c 6c 20 62 65 20 75 73 65 66 75 6c 2c   will be useful,
0190: 0a 2a 2a 20 62 75 74 20 57 49 54 48 4f 55 54 20  .** but WITHOUT 
01a0: 41 4e 59 20 57 41 52 52 41 4e 54 59 3b 20 77 69  ANY WARRANTY; wi
01b0: 74 68 6f 75 74 20 65 76 65 6e 20 74 68 65 20 69  thout even the i
01c0: 6d 70 6c 69 65 64 20 77 61 72 72 61 6e 74 79 20  mplied warranty 
01d0: 6f 66 0a 2a 2a 20 4d 45 52 43 48 41 4e 54 41 42  of.** MERCHANTAB
01e0: 49 4c 49 54 59 20 6f 72 20 46 49 54 4e 45 53 53  ILITY or FITNESS
01f0: 20 46 4f 52 20 41 20 50 41 52 54 49 43 55 4c 41   FOR A PARTICULA
0200: 52 20 50 55 52 50 4f 53 45 2e 20 20 53 65 65 20  R PURPOSE.  See 
0210: 74 68 65 20 47 4e 55 0a 2a 2a 20 47 65 6e 65 72  the GNU.** Gener
0220: 61 6c 20 50 75 62 6c 69 63 20 4c 69 63 65 6e 73  al Public Licens
0230: 65 20 66 6f 72 20 6d 6f 72 65 20 64 65 74 61 69  e for more detai
0240: 6c 73 2e 0a 2a 2a 0a 2a 2a 20 59 6f 75 20 73 68  ls..**.** You sh
0250: 6f 75 6c 64 20 68 61 76 65 20 72 65 63 65 69 76  ould have receiv
0260: 65 64 20 61 20 63 6f 70 79 20 6f 66 20 74 68 65  ed a copy of the
0270: 20 47 4e 55 20 47 65 6e 65 72 61 6c 20 50 75 62   GNU General Pub
0280: 6c 69 63 0a 2a 2a 20 4c 69 63 65 6e 73 65 20 61  lic.** License a
0290: 6c 6f 6e 67 20 77 69 74 68 20 74 68 69 73 20 6c  long with this l
02a0: 69 62 72 61 72 79 3b 20 69 66 20 6e 6f 74 2c 20  ibrary; if not, 
02b0: 77 72 69 74 65 20 74 6f 20 74 68 65 0a 2a 2a 20  write to the.** 
02c0: 46 72 65 65 20 53 6f 66 74 77 61 72 65 20 46 6f  Free Software Fo
02d0: 75 6e 64 61 74 69 6f 6e 2c 20 49 6e 63 2e 2c 20  undation, Inc., 
02e0: 35 39 20 54 65 6d 70 6c 65 20 50 6c 61 63 65 20  59 Temple Place 
02f0: 2d 20 53 75 69 74 65 20 33 33 30 2c 0a 2a 2a 20  - Suite 330,.** 
0300: 42 6f 73 74 6f 6e 2c 20 4d 41 20 20 30 32 31 31  Boston, MA  0211
0310: 31 2d 31 33 30 37 2c 20 55 53 41 2e 0a 2a 2a 0a  1-1307, USA..**.
0320: 2a 2a 20 41 75 74 68 6f 72 20 63 6f 6e 74 61 63  ** Author contac
0330: 74 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 3a 0a 2a  t information:.*
0340: 2a 20 20 20 64 72 68 40 68 77 61 63 69 2e 63 6f  *   drh@hwaci.co
0350: 6d 0a 2a 2a 20 20 20 68 74 74 70 3a 2f 2f 77 77  m.**   http://ww
0360: 77 2e 68 77 61 63 69 2e 63 6f 6d 2f 64 72 68 2f  w.hwaci.com/drh/
0370: 0a 2a 2a 0a 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 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a  ****************
03b0: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a  ****************
03c0: 2a 2a 2a 0a 2a 2a 0a 2a 2a 20 49 6d 70 6c 65 6d  ***.**.** Implem
03d0: 65 6e 74 61 74 69 6f 6e 20 6f 66 20 74 68 65 20  entation of the 
03e0: 54 61 67 20 56 69 65 77 20 70 61 67 65 0a 2a 2f  Tag View page.*/
03f0: 0a 23 69 6e 63 6c 75 64 65 20 3c 61 73 73 65 72  .#include <asser
0400: 74 2e 68 3e 0a 23 69 6e 63 6c 75 64 65 20 22 63  t.h>.#include "c
0410: 6f 6e 66 69 67 2e 68 22 0a 23 69 6e 63 6c 75 64  onfig.h".#includ
0420: 65 20 22 6d 79 5f 70 61 67 65 2e 68 22 0a 0a 2f  e "my_page.h"../
0430: 2a 2a 0a 52 65 6e 64 65 72 73 20 61 20 6c 6f 67  **.Renders a log
0440: 6f 75 74 20 62 75 74 74 6f 6e 2e 0a 2a 2f 0a 73  out button..*/.s
0450: 74 61 74 69 63 20 76 6f 69 64 20 6d 79 70 61 67  tatic void mypag
0460: 65 5f 6c 6f 67 6f 75 74 5f 62 75 74 74 6f 6e 28  e_logout_button(
0470: 29 0a 7b 0a 20 20 69 66 28 20 67 2e 7a 4c 6f 67  ).{.  if( g.zLog
0480: 69 6e 20 29 7b 0a 20 20 20 20 40 20 3c 62 72 20  in ){.    @ <br 
0490: 63 6c 65 61 72 3d 22 62 6f 74 68 22 2f 3e 3c 68  clear="both"/><h
04a0: 72 2f 3e 0a 20 20 20 20 40 20 3c 73 74 72 6f 6e  r/>.    @ <stron
04b0: 67 3e 4c 6f 67 6f 75 74 20 28 6f 72 20 22 6c 6f  g>Logout (or "lo
04c0: 67 20 6f 75 74 22 2c 20 69 66 20 79 6f 75 20 70  g out", if you p
04d0: 72 65 66 65 72 29 3a 3c 2f 73 74 72 6f 6e 67 3e  refer):</strong>
04e0: 3c 62 72 2f 3e 0a 20 20 20 20 40 20 3c 66 6f 72  <br/>.    @ <for
04f0: 6d 20 61 63 74 69 6f 6e 3d 27 6c 6f 67 69 6e 27  m action='login'
0500: 20 6d 65 74 68 6f 64 3d 27 50 4f 53 54 27 3e 0a   method='POST'>.
0510: 20 20 20 20 40 20 3c 70 3e 54 6f 20 6c 6f 67 20      @ <p>To log 
0520: 6f 66 66 20 74 68 65 20 73 79 73 74 65 6d 20 28  off the system (
0530: 61 6e 64 20 64 65 6c 65 74 65 20 79 6f 75 72 20  and delete your 
0540: 6c 6f 67 69 6e 20 63 6f 6f 6b 69 65 29 0a 20 20  login cookie).  
0550: 20 20 40 20 20 70 72 65 73 73 20 74 68 65 20 66    @  press the f
0560: 6f 6c 6c 6f 77 69 6e 67 20 62 75 74 74 6f 6e 3a  ollowing button:
0570: 3c 62 72 3e 0a 20 20 20 20 40 20 3c 69 6e 70 75  <br>.    @ <inpu
0580: 74 20 74 79 70 65 3d 22 73 75 62 6d 69 74 22 20  t type="submit" 
0590: 6e 61 6d 65 3d 22 6f 75 74 22 20 76 61 6c 75 65  name="out" value
05a0: 3d 22 4c 6f 67 6f 75 74 22 2f 3e 3c 2f 70 3e 0a  ="Logout"/></p>.
05b0: 20 20 20 20 40 20 3c 2f 66 6f 72 6d 3e 0a 20 20      @ </form>.  
05c0: 7d 0a 7d 0a 0a 2f 2a 2a 0a 52 65 6e 64 65 72 73  }.}../**.Renders
05d0: 20 61 20 70 61 73 73 77 6f 72 64 20 63 68 61 6e   a password chan
05e0: 67 65 72 2e 0a 2a 2f 0a 73 74 61 74 69 63 20 76  ger..*/.static v
05f0: 6f 69 64 20 6d 79 70 61 67 65 5f 70 61 73 73 77  oid mypage_passw
0600: 6f 72 64 5f 63 68 61 6e 67 65 72 28 29 0a 7b 0a  ord_changer().{.
0610: 20 20 69 66 28 20 67 2e 6f 6b 50 61 73 73 77 6f    if( g.okPasswo
0620: 72 64 20 29 7b 0a 20 20 20 20 40 20 3c 62 72 20  rd ){.    @ <br 
0630: 63 6c 65 61 72 3d 22 62 6f 74 68 22 2f 3e 3c 68  clear="both"/><h
0640: 72 2f 3e 0a 20 20 20 20 40 20 3c 73 74 72 6f 6e  r/>.    @ <stron
0650: 67 3e 43 68 61 6e 67 65 20 50 61 73 73 77 6f 72  g>Change Passwor
0660: 64 3a 3c 2f 73 74 72 6f 6e 67 3e 3c 62 72 2f 3e  d:</strong><br/>
0670: 0a 20 20 20 20 40 20 3c 70 3e 54 6f 20 63 68 61  .    @ <p>To cha
0680: 6e 67 65 20 79 6f 75 72 20 70 61 73 73 77 6f 72  nge your passwor
0690: 64 2c 20 65 6e 74 65 72 20 79 6f 75 72 20 6f 6c  d, enter your ol
06a0: 64 20 70 61 73 73 77 6f 72 64 20 61 6e 64 20 79  d password and y
06b0: 6f 75 72 0a 20 20 20 20 40 20 6e 65 77 20 70 61  our.    @ new pa
06c0: 73 73 77 6f 72 64 20 74 77 69 63 65 20 62 65 6c  ssword twice bel
06d0: 6f 77 20 74 68 65 6e 20 70 72 65 73 73 20 74 68  ow then press th
06e0: 65 20 22 43 68 61 6e 67 65 20 50 61 73 73 77 6f  e "Change Passwo
06f0: 72 64 22 0a 20 20 20 20 40 20 62 75 74 74 6f 6e  rd".    @ button
0700: 2e 3c 2f 70 3e 0a 20 20 20 20 40 20 3c 66 6f 72  .</p>.    @ <for
0710: 6d 20 61 63 74 69 6f 6e 3d 22 6c 6f 67 69 6e 22  m action="login"
0720: 20 6d 65 74 68 6f 64 3d 22 50 4f 53 54 22 3e 0a   method="POST">.
0730: 20 20 20 20 40 20 3c 69 6e 70 75 74 20 74 79 70      @ <input typ
0740: 65 3d 27 68 69 64 64 65 6e 27 20 6e 61 6d 65 3d  e='hidden' name=
0750: 27 67 27 20 76 61 6c 75 65 3d 27 6d 79 27 2f 3e  'g' value='my'/>
0760: 0a 20 20 20 20 40 20 3c 74 61 62 6c 65 3e 3c 74  .    @ <table><t
0770: 62 6f 64 79 3e 0a 20 20 20 20 40 20 3c 74 72 3e  body>.    @ <tr>
0780: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74  <td align="right
0790: 22 3e 4f 6c 64 20 50 61 73 73 77 6f 72 64 3a 3c  ">Old Password:<
07a0: 2f 74 64 3e 0a 20 20 20 20 40 20 3c 74 64 3e 3c  /td>.    @ <td><
07b0: 69 6e 70 75 74 20 74 79 70 65 3d 22 70 61 73 73  input type="pass
07c0: 77 6f 72 64 22 20 6e 61 6d 65 3d 22 70 22 20 73  word" name="p" s
07d0: 69 7a 65 3d 33 30 3e 3c 2f 74 64 3e 3c 2f 74 72  ize=30></td></tr
07e0: 3e 0a 20 20 20 20 40 20 3c 74 72 3e 3c 74 64 20  >.    @ <tr><td 
07f0: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 4e 65  align="right">Ne
0800: 77 20 50 61 73 73 77 6f 72 64 3a 3c 2f 74 64 3e  w Password:</td>
0810: 0a 20 20 20 20 40 20 3c 74 64 3e 3c 69 6e 70 75  .    @ <td><inpu
0820: 74 20 74 79 70 65 3d 22 70 61 73 73 77 6f 72 64  t type="password
0830: 22 20 6e 61 6d 65 3d 22 6e 31 22 20 73 69 7a 65  " name="n1" size
0840: 3d 33 30 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 0a 20  =30></td></tr>. 
0850: 20 20 20 40 20 3c 74 72 3e 3c 74 64 20 61 6c 69     @ <tr><td ali
0860: 67 6e 3d 22 72 69 67 68 74 22 3e 52 65 70 65 61  gn="right">Repea
0870: 74 20 4e 65 77 20 50 61 73 73 77 6f 72 64 3a 3c  t New Password:<
0880: 2f 74 64 3e 0a 20 20 20 20 40 20 3c 74 64 3e 3c  /td>.    @ <td><
0890: 69 6e 70 75 74 20 74 79 70 65 3d 22 70 61 73 73  input type="pass
08a0: 77 6f 72 64 22 20 6e 61 6d 65 3d 22 6e 32 22 20  word" name="n2" 
08b0: 73 69 7a 65 3d 33 30 3e 3c 2f 74 64 3e 3c 2f 74  size=30></td></t
08c0: 72 3e 0a 20 20 20 20 40 20 3c 74 72 3e 3c 74 64  r>.    @ <tr><td
08d0: 3e 3c 2f 74 64 3e 0a 20 20 20 20 40 20 3c 74 64  ></td>.    @ <td
08e0: 3e 3c 69 6e 70 75 74 20 74 79 70 65 3d 22 73 75  ><input type="su
08f0: 62 6d 69 74 22 20 76 61 6c 75 65 3d 22 43 68 61  bmit" value="Cha
0900: 6e 67 65 20 50 61 73 73 77 6f 72 64 22 3e 3c 2f  nge Password"></
0910: 74 64 3e 3c 2f 74 72 3e 0a 20 20 20 20 40 20 3c  td></tr>.    @ <
0920: 2f 74 62 6f 64 79 3e 3c 2f 74 61 62 6c 65 3e 0a  /tbody></table>.
0930: 20 20 20 20 40 20 3c 2f 66 6f 72 6d 3e 0a 20 20      @ </form>.  
0940: 7d 0a 0a 7d 0a 0a 2f 2a 2a 0a 44 65 66 61 75 6c  }..}../**.Defaul
0950: 74 20 70 61 67 65 20 72 65 6e 64 65 72 65 64 20  t page rendered 
0960: 66 6f 72 20 2f 6d 79 2e 0a 2a 2f 0a 73 74 61 74  for /my..*/.stat
0970: 69 63 20 76 6f 69 64 20 6d 79 70 61 67 65 5f 70  ic void mypage_p
0980: 61 67 65 5f 64 65 66 61 75 6c 74 28 29 0a 7b 0a  age_default().{.
0990: 20 20 69 6e 74 20 75 69 64 20 3d 20 67 2e 75 73    int uid = g.us
09a0: 65 72 55 69 64 3b 0a 20 20 63 68 61 72 20 2a 20  erUid;.  char * 
09b0: 73 71 6c 20 3d 20 6d 70 72 69 6e 74 66 28 20 22  sql = mprintf( "
09c0: 53 45 4c 45 43 54 20 6c 6f 67 69 6e 2c 63 61 70  SELECT login,cap
09d0: 2c 69 6e 66 6f 20 46 52 4f 4d 20 75 73 65 72 20  ,info FROM user 
09e0: 57 48 45 52 45 20 75 69 64 3d 25 64 22 2c 0a 09  WHERE uid=%d",..
09f0: 09 09 75 69 64 20 29 3b 0a 20 20 53 74 6d 74 20  ..uid );.  Stmt 
0a00: 73 74 3b 0a 20 20 64 62 5f 70 72 65 70 61 72 65  st;.  db_prepare
0a10: 28 20 26 73 74 2c 20 73 71 6c 20 29 3b 0a 20 20  ( &st, sql );.  
0a20: 66 72 65 65 28 20 73 71 6c 20 29 3b 0a 20 20 64  free( sql );.  d
0a30: 62 5f 73 74 65 70 28 26 73 74 29 3b 0a 20 20 63  b_step(&st);.  c
0a40: 68 61 72 20 63 6f 6e 73 74 20 2a 20 75 6e 61 6d  har const * unam
0a50: 65 20 3d 20 64 62 5f 63 6f 6c 75 6d 6e 5f 74 65  e = db_column_te
0a60: 78 74 28 20 26 73 74 2c 20 30 20 29 3b 0a 20 20  xt( &st, 0 );.  
0a70: 63 68 61 72 20 63 6f 6e 73 74 20 2a 20 75 63 61  char const * uca
0a80: 70 20 3d 20 64 62 5f 63 6f 6c 75 6d 6e 5f 74 65  p = db_column_te
0a90: 78 74 28 20 26 73 74 2c 20 31 20 29 3b 0a 20 20  xt( &st, 1 );.  
0aa0: 63 68 61 72 20 63 6f 6e 73 74 20 2a 20 75 69 6e  char const * uin
0ab0: 66 6f 20 3d 20 64 62 5f 63 6f 6c 75 6d 6e 5f 74  fo = db_column_t
0ac0: 65 78 74 28 20 26 73 74 2c 20 32 20 29 3b 0a 0a  ext( &st, 2 );..
0ad0: 20 20 40 20 3c 68 32 3e 57 65 6c 63 6f 6d 65 2c    @ <h2>Welcome,
0ae0: 20 25 73 28 75 6e 61 6d 65 29 21 3c 2f 68 32 3e   %s(uname)!</h2>
0af0: 0a 20 20 40 20 59 6f 75 72 20 75 73 65 72 20 49  .  @ Your user I
0b00: 44 20 69 73 3a 20 25 64 28 75 69 64 29 3c 62 72  D is: %d(uid)<br
0b10: 2f 3e 0a 20 20 40 20 59 6f 75 72 20 46 6f 73 73  />.  @ Your Foss
0b20: 69 6c 20 70 65 72 6d 69 73 73 69 6f 6e 73 20 61  il permissions a
0b30: 72 65 3a 20 5b 25 73 28 75 63 61 70 29 5d 3c 62  re: [%s(ucap)]<b
0b40: 72 2f 3e 0a 20 20 40 20 59 6f 75 72 20 61 64 64  r/>.  @ Your add
0b50: 69 74 69 6f 6e 61 6c 20 69 6e 66 6f 3a 20 5b 25  itional info: [%
0b60: 73 28 75 69 6e 66 6f 29 5d 3c 62 72 2f 3e 0a 20  s(uinfo)]<br/>. 
0b70: 20 6d 79 70 61 67 65 5f 6c 6f 67 6f 75 74 5f 62   mypage_logout_b
0b80: 75 74 74 6f 6e 28 29 3b 0a 20 20 6d 79 70 61 67  utton();.  mypag
0b90: 65 5f 70 61 73 73 77 6f 72 64 5f 63 68 61 6e 67  e_password_chang
0ba0: 65 72 28 29 3b 0a 0a 20 20 40 20 3c 68 72 2f 3e  er();..  @ <hr/>
0bb0: 3c 68 32 3e 54 4f 44 4f 73 3a 3c 2f 68 32 3e 3c  <h2>TODOs:</h2><
0bc0: 75 6c 3e 0a 20 20 40 20 3c 6c 69 3e 43 68 61 6e  ul>.  @ <li>Chan
0bd0: 67 65 20 22 61 64 64 69 74 69 6f 6e 61 6c 20 69  ge "additional i
0be0: 6e 66 6f 22 20 66 69 65 6c 64 2e 3c 2f 6c 69 3e  nfo" field.</li>
0bf0: 0a 20 20 40 20 3c 6c 69 3e 53 65 61 72 63 68 20  .  @ <li>Search 
0c00: 66 6f 72 20 63 68 61 6e 67 65 73 20 6d 61 64 65  for changes made
0c10: 20 62 79 20 79 6f 75 2e 3c 2f 6c 69 3e 0a 20 20   by you.</li>.  
0c20: 40 20 3c 6c 69 3e 53 65 61 72 63 68 20 66 6f 72  @ <li>Search for
0c30: 20 66 69 6c 65 73 2f 77 69 6b 69 20 70 61 67 65   files/wiki page
0c40: 73 2f 74 69 63 6b 65 74 73 20 72 65 6c 61 74 65  s/tickets relate
0c50: 64 20 74 6f 20 79 6f 75 2e 3c 2f 6c 69 3e 0a 20  d to you.</li>. 
0c60: 20 40 20 3c 6c 69 3e 41 6c 6c 6f 77 20 70 65 72   @ <li>Allow per
0c70: 2d 75 73 65 72 20 73 65 74 75 70 20 6f 66 20 74  -user setup of t
0c80: 68 65 20 70 61 67 65 20 28 65 2e 67 2e 20 72 65  he page (e.g. re
0c90: 70 6f 72 74 73 29 2e 3c 2f 6c 69 3e 0a 20 20 40  ports).</li>.  @
0ca0: 20 3c 6c 69 3e 2e 2e 2e 20 74 68 65 20 6c 69 73   <li>... the lis
0cb0: 74 20 67 6f 65 73 20 6f 6e 20 2e 2e 2e 3c 2f 6c  t goes on ...</l
0cc0: 69 3e 0a 20 20 40 20 3c 2f 75 6c 3e 0a 0a 20 20  i>.  @ </ul>..  
0cd0: 64 62 5f 66 69 6e 61 6c 69 7a 65 28 20 26 73 74  db_finalize( &st
0ce0: 20 29 3b 0a 0a 7d 0a 0a 2f 2a 0a 2a 2a 20 57 45   );..}../*.** WE
0cf0: 42 50 41 47 45 3a 20 2f 6d 79 0a 2a 2f 0a 76 6f  BPAGE: /my.*/.vo
0d00: 69 64 20 6d 79 70 61 67 65 5f 70 61 67 65 28 76  id mypage_page(v
0d10: 6f 69 64 29 7b 0a 20 20 6c 6f 67 69 6e 5f 63 68  oid){.  login_ch
0d20: 65 63 6b 5f 63 72 65 64 65 6e 74 69 61 6c 73 28  eck_credentials(
0d30: 29 3b 0a 20 20 69 66 28 20 21 67 2e 6f 6b 52 64  );.  if( !g.okRd
0d40: 57 69 6b 69 20 29 7b 0a 20 20 20 20 6c 6f 67 69  Wiki ){.    logi
0d50: 6e 5f 6e 65 65 64 65 64 28 29 3b 0a 20 20 7d 0a  n_needed();.  }.
0d60: 20 20 73 74 79 6c 65 5f 68 65 61 64 65 72 28 22    style_header("
0d70: 59 6f 75 72 20 48 6f 6d 65 22 29 3b 0a 20 20 63  Your Home");.  c
0d80: 68 61 72 20 63 6f 6e 73 74 20 2a 20 6e 61 6d 65  har const * name
0d90: 20 3d 20 50 28 22 6e 61 6d 65 22 29 3b 0a 20 20   = P("name");.  
0da0: 69 66 28 20 6e 61 6d 65 20 29 0a 20 20 7b 0a 20  if( name ).  {. 
0db0: 20 20 20 69 66 28 20 30 20 3d 3d 20 73 74 72 63     if( 0 == strc
0dc0: 6d 70 28 6e 61 6d 65 2c 22 74 69 63 6b 65 74 73  mp(name,"tickets
0dd0: 22 29 20 29 0a 20 20 20 20 7b 0a 20 20 20 20 20  ") ).    {.     
0de0: 20 40 20 54 4f 44 4f 3a 20 54 69 63 6b 65 74 73   @ TODO: Tickets
0df0: 20 70 61 67 65 2e 0a 20 20 20 20 7d 0a 20 20 20   page..    }.   
0e00: 20 65 6c 73 65 0a 20 20 20 20 7b 0a 20 20 20 20   else.    {.    
0e10: 20 20 40 20 54 4f 44 4f 3a 20 68 61 6e 64 6c 65    @ TODO: handle
0e20: 20 2f 6d 79 2f 25 73 28 6e 61 6d 65 29 0a 20 20   /my/%s(name).  
0e30: 20 20 7d 0a 20 20 7d 0a 20 20 65 6c 73 65 0a 20    }.  }.  else. 
0e40: 20 7b 0a 20 20 20 20 6d 79 70 61 67 65 5f 70 61   {.    mypage_pa
0e50: 67 65 5f 64 65 66 61 75 6c 74 28 29 3b 0a 20 20  ge_default();.  
0e60: 7d 0a 20 20 73 74 79 6c 65 5f 66 6f 6f 74 65 72  }.  style_footer
0e70: 28 29 3b 0a 7d 0a                                ();.}.