[LinksOS CVS Commit]website/content person_edit.php,1.2,1.3
Status: Inactive
Brought to you by:
terencevs
|
From: <ke...@to...> - 2003-01-02 01:26:23
|
Update of /cvsroot/linksos/website/content In directory router-internal.tossell.net:/tmp/cvs-serv28576/content Modified Files: person_edit.php Log Message: Title: Timezone Specification Changes: Added timezone field and code to write the selection to DB. Effects: Users can set their timezone by themselves. a=kennyt Index: person_edit.php =================================================================== RCS file: /cvsroot/linksos/website/content/person_edit.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** person_edit.php 24 Dec 2002 01:48:23 -0000 1.2 --- person_edit.php 2 Jan 2003 01:26:16 -0000 1.3 *************** *** 7,12 **** if ($_REQUEST["newpassword"] && $_REQUEST["newpasswordconfirm"] && $_REQUEST["newpassword"] = $_REQUEST["newpasswordconfirm"] ) { mysql_query('UPDATE linksos_people SET password = PASSWORD(\'' . $_REQUEST["newpassword"] . '\') WHERE uid = ' . $user[0]) or die('Couldn\'t set password.'); ! } else ! echo $lang['pass_conf_req']; break; default: --- 7,20 ---- if ($_REQUEST["newpassword"] && $_REQUEST["newpasswordconfirm"] && $_REQUEST["newpassword"] = $_REQUEST["newpasswordconfirm"] ) { mysql_query('UPDATE linksos_people SET password = PASSWORD(\'' . $_REQUEST["newpassword"] . '\') WHERE uid = ' . $user[0]) or die('Couldn\'t set password.'); ! echo 'Password changed.<br>'; ! } else { ! if ( $_REQUEST["newpassword"] || $_REQUEST["newpasswordconfirm"] ) ! echo $lang['pass_conf_req']; } ! // if ( $REQUEST["newtimezone"] ) { ! if ( $_REQUEST["newtimezone"] != $_SESSION["user"][6] ) { ! mysql_query('UPDATE linksos_people SET gmt = \'' . $_REQUEST["newtimezone"] . '\' WHERE uid = ' . $_SESSION["user"][0]) or die('Could not update timezone.<br>'); ! echo 'Timezone updated.<br>'; ! } ! // } break; default: *************** *** 15,18 **** --- 23,31 ---- $lang['password'] . ': <input type="password" name="newpassword"><br>' . $lang['confirm'] . ': <input type="password" name="newpasswordconfirm"><br>' . + 'Timezone: <select name="newtimezone">'; + for ( $t = -12; $t < 13; $t++ ) { + echo '<option value="' . $t . '"' . ( $t == $_SESSION["user"][6] ? ' selected' : '' ) . '>GMT ' . ($t > 0 ? '+' : ($t == 0 ? '+-' : '-') ) . abs($t) . '</option>'; + } + echo '</select><br>' . '<input type="submit" value="' . $lang['commit'] . '"></form>'; break; |