Artifact 98c94677766c794cf6d1d22bc2a33995de3154de:
File
src/my_page.c
part of check-in
[1f1d96529c]
- Users unconditionally inherit capabilities of "anonymous". New capability
"v" means to inherit capabilities of user "developer". Login is prohibited
if the password is empty.
by
drh on
2008-08-03 16:47:43.
Also file
src/my_page.c
part of check-in
[5fb14b9a0f]
- Include non-sym- tags in tagview web page. Also merge mainline into tagview branch.
by
eric on
2008-08-21 20:59:01.
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 0a 2a 2a 20 52 65 6e 64 65 72 73 20 61 20 6c *.** Renders a l
0440: 6f 67 6f 75 74 20 62 75 74 74 6f 6e 2e 0a 2a 2f ogout button..*/
0450: 0a 73 74 61 74 69 63 20 76 6f 69 64 20 6d 79 70 .static void myp
0460: 61 67 65 5f 6c 6f 67 6f 75 74 5f 62 75 74 74 6f age_logout_butto
0470: 6e 28 29 0a 7b 0a 20 20 69 66 28 20 67 2e 7a 4c n().{. if( g.zL
0480: 6f 67 69 6e 20 29 7b 0a 20 20 20 20 40 20 3c 62 ogin ){. @ <b
0490: 72 20 63 6c 65 61 72 3d 22 62 6f 74 68 22 2f 3e r clear="both"/>
04a0: 3c 68 72 2f 3e 0a 20 20 20 20 40 20 3c 73 74 72 <hr/>. @ <str
04b0: 6f 6e 67 3e 4c 6f 67 6f 75 74 20 28 6f 72 20 22 ong>Logout (or "
04c0: 6c 6f 67 20 6f 75 74 22 2c 20 69 66 20 79 6f 75 log out", if you
04d0: 20 70 72 65 66 65 72 29 3a 3c 2f 73 74 72 6f 6e prefer):</stron
04e0: 67 3e 3c 62 72 2f 3e 0a 20 20 20 20 40 20 3c 66 g><br/>. @ <f
04f0: 6f 72 6d 20 61 63 74 69 6f 6e 3d 27 6c 6f 67 69 orm action='logi
0500: 6e 27 20 6d 65 74 68 6f 64 3d 27 50 4f 53 54 27 n' method='POST'
0510: 3e 0a 20 20 20 20 40 20 3c 70 3e 54 6f 20 6c 6f >. @ <p>To lo
0520: 67 20 6f 66 66 20 74 68 65 20 73 79 73 74 65 6d g off the system
0530: 20 28 61 6e 64 20 64 65 6c 65 74 65 20 79 6f 75 (and delete you
0540: 72 20 6c 6f 67 69 6e 20 63 6f 6f 6b 69 65 29 0a r login cookie).
0550: 20 20 20 20 40 20 20 70 72 65 73 73 20 74 68 65 @ press the
0560: 20 66 6f 6c 6c 6f 77 69 6e 67 20 62 75 74 74 6f following butto
0570: 6e 3a 3c 62 72 3e 0a 20 20 20 20 40 20 3c 69 6e n:<br>. @ <in
0580: 70 75 74 20 74 79 70 65 3d 22 73 75 62 6d 69 74 put type="submit
0590: 22 20 6e 61 6d 65 3d 22 6f 75 74 22 20 76 61 6c " name="out" val
05a0: 75 65 3d 22 4c 6f 67 6f 75 74 22 2f 3e 3c 2f 70 ue="Logout"/></p
05b0: 3e 0a 20 20 20 20 40 20 3c 2f 66 6f 72 6d 3e 0a >. @ </form>.
05c0: 20 20 7d 0a 7d 0a 0a 2f 2a 0a 2a 2a 20 52 65 6e }.}../*.** Ren
05d0: 64 65 72 73 20 61 20 70 61 73 73 77 6f 72 64 20 ders a password
05e0: 63 68 61 6e 67 65 72 2e 0a 2a 2f 0a 73 74 61 74 changer..*/.stat
05f0: 69 63 20 76 6f 69 64 20 6d 79 70 61 67 65 5f 70 ic void mypage_p
0600: 61 73 73 77 6f 72 64 5f 63 68 61 6e 67 65 72 28 assword_changer(
0610: 29 0a 7b 0a 20 20 69 66 28 20 67 2e 6f 6b 50 61 ).{. if( g.okPa
0620: 73 73 77 6f 72 64 20 29 7b 0a 20 20 20 20 40 20 ssword ){. @
0630: 3c 62 72 20 63 6c 65 61 72 3d 22 62 6f 74 68 22 <br clear="both"
0640: 2f 3e 3c 68 72 2f 3e 0a 20 20 20 20 40 20 3c 73 /><hr/>. @ <s
0650: 74 72 6f 6e 67 3e 43 68 61 6e 67 65 20 50 61 73 trong>Change Pas
0660: 73 77 6f 72 64 3a 3c 2f 73 74 72 6f 6e 67 3e 3c sword:</strong><
0670: 62 72 2f 3e 0a 20 20 20 20 40 20 3c 70 3e 54 6f br/>. @ <p>To
0680: 20 63 68 61 6e 67 65 20 79 6f 75 72 20 70 61 73 change your pas
0690: 73 77 6f 72 64 2c 20 65 6e 74 65 72 20 79 6f 75 sword, enter you
06a0: 72 20 6f 6c 64 20 70 61 73 73 77 6f 72 64 20 61 r old password a
06b0: 6e 64 20 79 6f 75 72 0a 20 20 20 20 40 20 6e 65 nd your. @ ne
06c0: 77 20 70 61 73 73 77 6f 72 64 20 74 77 69 63 65 w password twice
06d0: 20 62 65 6c 6f 77 20 74 68 65 6e 20 70 72 65 73 below then pres
06e0: 73 20 74 68 65 20 22 43 68 61 6e 67 65 20 50 61 s the "Change Pa
06f0: 73 73 77 6f 72 64 22 0a 20 20 20 20 40 20 62 75 ssword". @ bu
0700: 74 74 6f 6e 2e 3c 2f 70 3e 0a 20 20 20 20 40 20 tton.</p>. @
0710: 3c 66 6f 72 6d 20 61 63 74 69 6f 6e 3d 22 6c 6f <form action="lo
0720: 67 69 6e 22 20 6d 65 74 68 6f 64 3d 22 50 4f 53 gin" method="POS
0730: 54 22 3e 0a 20 20 20 20 40 20 3c 69 6e 70 75 74 T">. @ <input
0740: 20 74 79 70 65 3d 27 68 69 64 64 65 6e 27 20 6e type='hidden' n
0750: 61 6d 65 3d 27 67 27 20 76 61 6c 75 65 3d 27 6d ame='g' value='m
0760: 79 27 2f 3e 0a 20 20 20 20 40 20 3c 74 61 62 6c y'/>. @ <tabl
0770: 65 3e 3c 74 62 6f 64 79 3e 0a 20 20 20 20 40 20 e><tbody>. @
0780: 3c 74 72 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 <tr><td align="r
0790: 69 67 68 74 22 3e 4f 6c 64 20 50 61 73 73 77 6f ight">Old Passwo
07a0: 72 64 3a 3c 2f 74 64 3e 0a 20 20 20 20 40 20 3c rd:</td>. @ <
07b0: 74 64 3e 3c 69 6e 70 75 74 20 74 79 70 65 3d 22 td><input type="
07c0: 70 61 73 73 77 6f 72 64 22 20 6e 61 6d 65 3d 22 password" name="
07d0: 70 22 20 73 69 7a 65 3d 33 30 3e 3c 2f 74 64 3e p" size=30></td>
07e0: 3c 2f 74 72 3e 0a 20 20 20 20 40 20 3c 74 72 3e </tr>. @ <tr>
07f0: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 <td align="right
0800: 22 3e 4e 65 77 20 50 61 73 73 77 6f 72 64 3a 3c ">New Password:<
0810: 2f 74 64 3e 0a 20 20 20 20 40 20 3c 74 64 3e 3c /td>. @ <td><
0820: 69 6e 70 75 74 20 74 79 70 65 3d 22 70 61 73 73 input type="pass
0830: 77 6f 72 64 22 20 6e 61 6d 65 3d 22 6e 31 22 20 word" name="n1"
0840: 73 69 7a 65 3d 33 30 3e 3c 2f 74 64 3e 3c 2f 74 size=30></td></t
0850: 72 3e 0a 20 20 20 20 40 20 3c 74 72 3e 3c 74 64 r>. @ <tr><td
0860: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 52 align="right">R
0870: 65 70 65 61 74 20 4e 65 77 20 50 61 73 73 77 6f epeat New Passwo
0880: 72 64 3a 3c 2f 74 64 3e 0a 20 20 20 20 40 20 3c rd:</td>. @ <
0890: 74 64 3e 3c 69 6e 70 75 74 20 74 79 70 65 3d 22 td><input type="
08a0: 70 61 73 73 77 6f 72 64 22 20 6e 61 6d 65 3d 22 password" name="
08b0: 6e 32 22 20 73 69 7a 65 3d 33 30 3e 3c 2f 74 64 n2" size=30></td
08c0: 3e 3c 2f 74 72 3e 0a 20 20 20 20 40 20 3c 74 72 ></tr>. @ <tr
08d0: 3e 3c 74 64 3e 3c 2f 74 64 3e 0a 20 20 20 20 40 ><td></td>. @
08e0: 20 3c 74 64 3e 3c 69 6e 70 75 74 20 74 79 70 65 <td><input type
08f0: 3d 22 73 75 62 6d 69 74 22 20 76 61 6c 75 65 3d ="submit" value=
0900: 22 43 68 61 6e 67 65 20 50 61 73 73 77 6f 72 64 "Change Password
0910: 22 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 0a 20 20 20 "></td></tr>.
0920: 20 40 20 3c 2f 74 62 6f 64 79 3e 3c 2f 74 61 62 @ </tbody></tab
0930: 6c 65 3e 0a 20 20 20 20 40 20 3c 2f 66 6f 72 6d le>. @ </form
0940: 3e 0a 20 20 7d 0a 0a 7d 0a 0a 2f 2a 0a 2a 2a 20 >. }..}../*.**
0950: 44 65 66 61 75 6c 74 20 70 61 67 65 20 72 65 6e Default page ren
0960: 64 65 72 65 64 20 66 6f 72 20 2f 6d 79 2e 0a 2a dered for /my..*
0970: 2f 0a 73 74 61 74 69 63 20 76 6f 69 64 20 6d 79 /.static void my
0980: 70 61 67 65 5f 70 61 67 65 5f 64 65 66 61 75 6c page_page_defaul
0990: 74 28 29 0a 7b 0a 20 20 69 6e 74 20 75 69 64 20 t().{. int uid
09a0: 3d 20 67 2e 75 73 65 72 55 69 64 3b 0a 20 20 63 = g.userUid;. c
09b0: 68 61 72 20 2a 20 73 71 6c 20 3d 20 6d 70 72 69 har * sql = mpri
09c0: 6e 74 66 28 20 22 53 45 4c 45 43 54 20 6c 6f 67 ntf( "SELECT log
09d0: 69 6e 2c 63 61 70 2c 69 6e 66 6f 20 46 52 4f 4d in,cap,info FROM
09e0: 20 75 73 65 72 20 57 48 45 52 45 20 75 69 64 3d user WHERE uid=
09f0: 25 64 22 2c 0a 09 09 09 75 69 64 20 29 3b 0a 20 %d",....uid );.
0a00: 20 53 74 6d 74 20 73 74 3b 0a 20 20 63 68 61 72 Stmt st;. char
0a10: 20 63 6f 6e 73 74 20 2a 75 6e 61 6d 65 3b 0a 20 const *uname;.
0a20: 20 63 68 61 72 20 63 6f 6e 73 74 20 2a 75 63 61 char const *uca
0a30: 70 3b 0a 20 20 63 68 61 72 20 63 6f 6e 73 74 20 p;. char const
0a40: 2a 75 69 6e 66 6f 3b 0a 20 20 64 62 5f 70 72 65 *uinfo;. db_pre
0a50: 70 61 72 65 28 20 26 73 74 2c 20 73 71 6c 20 29 pare( &st, sql )
0a60: 3b 0a 20 20 66 72 65 65 28 20 73 71 6c 20 29 3b ;. free( sql );
0a70: 0a 20 20 64 62 5f 73 74 65 70 28 26 73 74 29 3b . db_step(&st);
0a80: 0a 20 20 75 6e 61 6d 65 20 3d 20 64 62 5f 63 6f . uname = db_co
0a90: 6c 75 6d 6e 5f 74 65 78 74 28 20 26 73 74 2c 20 lumn_text( &st,
0aa0: 30 20 29 3b 0a 20 20 75 63 61 70 20 3d 20 64 62 0 );. ucap = db
0ab0: 5f 63 6f 6c 75 6d 6e 5f 74 65 78 74 28 20 26 73 _column_text( &s
0ac0: 74 2c 20 31 20 29 3b 0a 20 20 75 69 6e 66 6f 20 t, 1 );. uinfo
0ad0: 3d 20 64 62 5f 63 6f 6c 75 6d 6e 5f 74 65 78 74 = db_column_text
0ae0: 28 20 26 73 74 2c 20 32 20 29 3b 0a 0a 20 20 40 ( &st, 2 );.. @
0af0: 20 3c 68 32 3e 57 65 6c 63 6f 6d 65 2c 20 25 73 <h2>Welcome, %s
0b00: 28 75 6e 61 6d 65 29 21 3c 2f 68 32 3e 0a 20 20 (uname)!</h2>.
0b10: 40 20 59 6f 75 72 20 75 73 65 72 20 49 44 20 69 @ Your user ID i
0b20: 73 3a 20 25 64 28 75 69 64 29 3c 62 72 2f 3e 0a s: %d(uid)<br/>.
0b30: 20 20 40 20 59 6f 75 72 20 46 6f 73 73 69 6c 20 @ Your Fossil
0b40: 70 65 72 6d 69 73 73 69 6f 6e 73 20 61 72 65 3a permissions are:
0b50: 20 5b 25 73 28 75 63 61 70 29 5d 0a 20 20 40 20 [%s(ucap)]. @
0b60: 20 20 5b 54 4f 44 4f 3a 20 65 78 70 6c 61 69 6e [TODO: explain
0b70: 20 74 68 65 73 65 5d 3c 62 72 2f 3e 0a 20 20 69 these]<br/>. i
0b80: 66 28 20 67 2e 6f 6b 41 64 6d 69 6e 20 29 7b 0a f( g.okAdmin ){.
0b90: 20 20 20 20 40 20 59 6f 75 20 61 72 65 20 61 6e @ You are an
0ba0: 20 3c 61 20 68 72 65 66 3d 27 25 73 28 67 2e 7a <a href='%s(g.z
0bb0: 42 61 73 65 55 52 4c 29 2f 61 64 6d 69 6e 27 3e BaseURL)/admin'>
0bc0: 61 64 6d 69 6e 3c 2f 61 3e 2e 3c 62 72 2f 3e 0a admin</a>.<br/>.
0bd0: 20 20 7d 0a 20 20 40 20 59 6f 75 72 20 61 64 64 }. @ Your add
0be0: 69 74 69 6f 6e 61 6c 20 69 6e 66 6f 3a 20 5b 25 itional info: [%
0bf0: 73 28 75 69 6e 66 6f 29 5d 0a 20 20 40 20 20 20 s(uinfo)]. @
0c00: 5b 54 4f 44 4f 3a 20 6d 61 6b 65 20 74 68 69 73 [TODO: make this
0c10: 20 65 64 69 74 61 62 6c 65 5d 3c 62 72 2f 3e 0a editable]<br/>.
0c20: 0a 20 20 6d 79 70 61 67 65 5f 6c 6f 67 6f 75 74 . mypage_logout
0c30: 5f 62 75 74 74 6f 6e 28 29 3b 0a 0a 20 20 40 20 _button();.. @
0c40: 3c 68 72 2f 3e 0a 20 20 40 20 3c 68 32 3e 59 6f <hr/>. @ <h2>Yo
0c50: 75 72 20 61 72 74 69 66 61 63 74 73 3a 3c 2f 68 ur artifacts:</h
0c60: 32 3e 0a 20 20 40 20 3c 75 6c 3e 0a 20 20 40 20 2>. @ <ul>. @
0c70: 3c 6c 69 3e 3c 61 20 68 72 65 66 3d 27 25 73 28 <li><a href='%s(
0c80: 67 2e 7a 42 61 73 65 55 52 4c 29 2f 74 69 6d 65 g.zBaseURL)/time
0c90: 6c 69 6e 65 3f 75 3d 25 73 28 75 6e 61 6d 65 29 line?u=%s(uname)
0ca0: 26 79 3d 63 69 27 3e 59 6f 75 72 20 6c 61 74 65 &y=ci'>Your late
0cb0: 73 74 20 63 6f 6d 6d 69 74 73 3c 2f 61 3e 2e 3c st commits</a>.<
0cc0: 2f 6c 69 3e 0a 20 20 40 20 3c 6c 69 3e 3c 61 20 /li>. @ <li><a
0cd0: 68 72 65 66 3d 27 25 73 28 67 2e 7a 42 61 73 65 href='%s(g.zBase
0ce0: 55 52 4c 29 2f 74 69 6d 65 6c 69 6e 65 3f 75 3d URL)/timeline?u=
0cf0: 25 73 28 75 6e 61 6d 65 29 26 79 3d 77 27 3e 59 %s(uname)&y=w'>Y
0d00: 6f 75 72 20 6c 61 74 65 73 74 20 77 69 6b 69 20 our latest wiki
0d10: 63 68 61 6e 67 65 73 3c 2f 61 3e 2e 3c 2f 6c 69 changes</a>.</li
0d20: 3e 0a 20 20 40 20 3c 6c 69 3e 54 4f 44 4f 3a 20 >. @ <li>TODO:
0d30: 79 6f 75 72 20 74 69 63 6b 65 74 73 3c 2f 6c 69 your tickets</li
0d40: 3e 0a 20 20 40 20 3c 6c 69 3e 54 4f 44 4f 3a 20 >. @ <li>TODO:
0d50: 65 74 63 2e 20 65 74 63 2e 20 65 74 63 2e 3c 2f etc. etc. etc.</
0d60: 6c 69 3e 0a 20 20 40 20 3c 2f 75 6c 3e 0a 20 20 li>. @ </ul>.
0d70: 6d 79 70 61 67 65 5f 70 61 73 73 77 6f 72 64 5f mypage_password_
0d80: 63 68 61 6e 67 65 72 28 29 3b 0a 0a 20 20 40 20 changer();.. @
0d90: 3c 68 72 2f 3e 3c 68 32 3e 54 4f 44 4f 73 3a 3c <hr/><h2>TODOs:<
0da0: 2f 68 32 3e 3c 75 6c 3e 0a 20 20 40 20 3c 6c 69 /h2><ul>. @ <li
0db0: 3e 43 68 61 6e 67 65 20 22 61 64 64 69 74 69 6f >Change "additio
0dc0: 6e 61 6c 20 69 6e 66 6f 22 20 66 69 65 6c 64 2e nal info" field.
0dd0: 3c 2f 6c 69 3e 0a 20 20 40 20 3c 6c 69 3e 53 65 </li>. @ <li>Se
0de0: 61 72 63 68 20 66 6f 72 20 63 68 61 6e 67 65 73 arch for changes
0df0: 20 6d 61 64 65 20 62 79 20 79 6f 75 2e 3c 2f 6c made by you.</l
0e00: 69 3e 0a 20 20 40 20 3c 6c 69 3e 53 65 61 72 63 i>. @ <li>Searc
0e10: 68 20 66 6f 72 20 66 69 6c 65 73 2f 77 69 6b 69 h for files/wiki
0e20: 20 70 61 67 65 73 2f 74 69 63 6b 65 74 73 20 72 pages/tickets r
0e30: 65 6c 61 74 65 64 20 74 6f 20 79 6f 75 2e 3c 2f elated to you.</
0e40: 6c 69 3e 0a 20 20 40 20 3c 6c 69 3e 41 6c 6c 6f li>. @ <li>Allo
0e50: 77 20 70 65 72 2d 75 73 65 72 20 73 65 74 75 70 w per-user setup
0e60: 20 6f 66 20 74 68 65 20 70 61 67 65 20 28 65 2e of the page (e.
0e70: 67 2e 20 72 65 70 6f 72 74 73 29 2e 3c 2f 6c 69 g. reports).</li
0e80: 3e 0a 20 20 40 20 3c 6c 69 3e 2e 2e 2e 20 74 68 >. @ <li>... th
0e90: 65 20 6c 69 73 74 20 67 6f 65 73 20 6f 6e 20 2e e list goes on .
0ea0: 2e 2e 3c 2f 6c 69 3e 0a 20 20 40 20 3c 2f 75 6c ..</li>. @ </ul
0eb0: 3e 0a 0a 20 20 64 62 5f 66 69 6e 61 6c 69 7a 65 >.. db_finalize
0ec0: 28 20 26 73 74 20 29 3b 0a 0a 7d 0a 0a 2f 2a 0a ( &st );..}../*.
0ed0: 2a 2a 20 57 45 42 50 41 47 45 3a 20 2f 6d 79 0a ** WEBPAGE: /my.
0ee0: 2a 2f 0a 76 6f 69 64 20 6d 79 70 61 67 65 5f 70 */.void mypage_p
0ef0: 61 67 65 28 76 6f 69 64 29 7b 0a 20 20 63 6f 6e age(void){. con
0f00: 73 74 20 63 68 61 72 20 2a 6e 61 6d 65 3b 0a 20 st char *name;.
0f10: 20 6c 6f 67 69 6e 5f 63 68 65 63 6b 5f 63 72 65 login_check_cre
0f20: 64 65 6e 74 69 61 6c 73 28 29 3b 0a 20 20 69 66 dentials();. if
0f30: 28 20 21 67 2e 6f 6b 52 64 57 69 6b 69 20 29 7b ( !g.okRdWiki ){
0f40: 0a 20 20 20 20 6c 6f 67 69 6e 5f 6e 65 65 64 65 . login_neede
0f50: 64 28 29 3b 0a 20 20 7d 0a 20 20 73 74 79 6c 65 d();. }. style
0f60: 5f 68 65 61 64 65 72 28 22 59 6f 75 72 20 48 6f _header("Your Ho
0f70: 6d 65 22 29 3b 0a 20 20 6e 61 6d 65 20 3d 20 50 me");. name = P
0f80: 28 22 6e 61 6d 65 22 29 3b 0a 20 20 69 66 28 20 ("name");. if(
0f90: 6e 61 6d 65 20 29 0a 20 20 7b 0a 20 20 20 20 69 name ). {. i
0fa0: 66 28 20 30 20 3d 3d 20 73 74 72 63 6d 70 28 6e f( 0 == strcmp(n
0fb0: 61 6d 65 2c 22 74 69 63 6b 65 74 73 22 29 20 29 ame,"tickets") )
0fc0: 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 40 20 54 . {. @ T
0fd0: 4f 44 4f 3a 20 54 69 63 6b 65 74 73 20 70 61 67 ODO: Tickets pag
0fe0: 65 2e 0a 20 20 20 20 7d 0a 20 20 20 20 65 6c 73 e.. }. els
0ff0: 65 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 40 20 e. {. @
1000: 54 4f 44 4f 3a 20 68 61 6e 64 6c 65 20 2f 6d 79 TODO: handle /my
1010: 2f 25 73 28 6e 61 6d 65 29 0a 20 20 20 20 7d 0a /%s(name). }.
1020: 20 20 7d 0a 20 20 65 6c 73 65 0a 20 20 7b 0a 20 }. else. {.
1030: 20 20 20 6d 79 70 61 67 65 5f 70 61 67 65 5f 64 mypage_page_d
1040: 65 66 61 75 6c 74 28 29 3b 0a 20 20 7d 0a 20 20 efault();. }.
1050: 73 74 79 6c 65 5f 66 6f 6f 74 65 72 28 29 3b 0a style_footer();.
1060: 7d 0a }.