[Openfirst-cvscommit] update account.php,1.4,1.5 directory.php,1.1,1.2 install.php,1.2,1.3 system.ph
Brought to you by:
xtimg
From: Tim G. <xt...@us...> - 2004-11-18 13:02:55
|
Update of /cvsroot/openfirst/update In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27336 Modified Files: account.php directory.php install.php system.php Log Message: Make updating of account preferences work. Force login when required. Index: account.php =================================================================== RCS file: /cvsroot/openfirst/update/account.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** account.php 7 Nov 2004 02:36:15 -0000 1.4 --- account.php 18 Nov 2004 13:02:45 -0000 1.5 *************** *** 3,22 **** include_once("../config/globals.php"); include_once("$header"); ! ! //Debug settings ! $Servers = array( ! 'Foo' => array('ID' => 0, 'URL' => 'ftp://foo.com/'), ! 'Bar' => array('ID' => 1, 'URL' => 'ftp://bar.com/') ! ); ! //End Debug Stuff ! ! function PrintValue($Setting) { ! if (isset($Setting) && !$NewServer) { ! echo " value=\"$Setting\""; } } ! ?> ! <form> <fieldset id="Account"> <legend><img src="yast_sysadmin.png"> Account Information</legend> --- 3,30 ---- include_once("../config/globals.php"); include_once("$header"); ! ! if(! isset($user)) { showlogin(); include_once($footer); die(); } ! ! if(isset($_REQUEST["user"])) { ! $ns = mysql_query("UPDATE ofirst_members SET user='" . $_REQUEST["user"] . "' WHERE user='$user->user' LIMIT 1;"); ! $user = mysql_fetch_object(mysql_query("SELECT * FROM ofirst_members WHERE id='$user->id' LIMIT 1;")); ! if(! $ns) { echo "Could not update username, selected username is already in use."; } ! if($_REQUEST["password"] == $_REQUEST["confirmpassword"] && $_REQUEST["password"] != "") { ! mysql_query("UPDATE ofirst_members SET password='" . md5sum($_REQUEST["password"]) . "' WHERE id = '$user->id';"); ! } else { ! echo "<br>Password remains unchanged."; } + if($_REQUEST["email"] == $user->email) { + echo "<br>e-mail address remains unchanged."; + } else { + mysql_query("UPDATE ofirst_members SET email='" . $_REQUEST["email"] . "' WHERE id='$user->id'"); + echo "<br>e-mail address updated"; + } + include_once($footer); + die(""); } ! ?> ! <form action="account.php" method="post"> <fieldset id="Account"> <legend><img src="yast_sysadmin.png"> Account Information</legend> *************** *** 27,31 **** <th>Username</th> <td> ! <input type='text' name='user' <?php PrintValue($Name); ?>> </td> </tr> --- 35,39 ---- <th>Username</th> <td> ! <input type='text' name='user' value="<?php echo $user->user; ?>"> </td> </tr> *************** *** 45,49 **** <th>E-mail Address</th> <td> ! <input type='text' name='email' <?php PrintValue($Email); ?>> </td> </tr> --- 53,63 ---- <th>E-mail Address</th> <td> ! <input type='text' name='email' ! <?php ! if (isset($user->email)) { ! echo " value=\"$user->email\""; ! } ! ?> ! > </td> </tr> Index: directory.php =================================================================== RCS file: /cvsroot/openfirst/update/directory.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** directory.php 7 Nov 2004 00:52:25 -0000 1.1 --- directory.php 18 Nov 2004 13:02:45 -0000 1.2 *************** *** 4,7 **** --- 4,8 ---- include_once("$header"); + if(! isset($user)) { showlogin(); include_once($footer); die(); } ?> Index: install.php =================================================================== RCS file: /cvsroot/openfirst/update/install.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** install.php 7 Nov 2004 03:10:14 -0000 1.2 --- install.php 18 Nov 2004 13:02:45 -0000 1.3 *************** *** 4,7 **** --- 4,9 ---- include_once($header); + if(! isset($user)) { showlogin(); include_once($footer); die(); } + if(! isset($_REQUEST["id"])) { echo "No package selected."; die(include_once($footer)); } $vq = mysql_query("SELECT * FROM ofirst_directory_software_versions WHERE parent='" . $_REQUEST["id"] . "'"); Index: system.php =================================================================== RCS file: /cvsroot/openfirst/update/system.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** system.php 7 Nov 2004 02:36:15 -0000 1.4 --- system.php 18 Nov 2004 13:02:45 -0000 1.5 *************** *** 4,7 **** --- 4,9 ---- include_once($header); + if(! isset($user)) { showlogin(); include_once($footer); die(); } + if(isset($_REQUEST["id"])) { echo "Update System Configuration"; } |