[Openfirst-cvscommit] members/admin editmember.php,1.8,1.9
Brought to you by:
xtimg
From: Tim G. <xt...@us...> - 2004-04-09 20:52:01
|
Update of /cvsroot/openfirst/members/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11384 Modified Files: editmember.php Log Message: Fix editing of users to work properly and not mysteriously reset passwords (Also closes bug id #84) Index: editmember.php =================================================================== RCS file: /cvsroot/openfirst/members/admin/editmember.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** editmember.php 18 Feb 2004 18:05:19 -0000 1.8 --- editmember.php 9 Apr 2004 20:38:39 -0000 1.9 *************** *** 16,23 **** * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License --- 16,19 ---- *************** *** 36,61 **** // Check if user has entered a user to edit ! if (! isset($_GET['user'])){ echo "<br><br>You must select a user from the member list to edit! [ <a href='index.php'>Member List</a> ]<br><br>"; ! die(include("$footer")); } ! if (isset($_POST["firstname"]) == true) { ! ! if (isset($_POST["ndivision"]) == true && $_POST["ndivision"] != "") { ! $_POST["division"] = $_POST["ndivision"]; ! $q = ofirst_dbquery("INSERT INTO ofirst_divisions (division) VALUES ('" . $_POST["division"] . "');"); ! $q = ofirst_dbquery("UPDATE ofirst_divisions SET description='" . $_POST["divisiondescription"] . "' WHERE division='" . $_POST["division"] . "';"); ! } ! if (isset($_POST["cellphonesms"]) && $_POST["cellphonesms"] == "0") { ! $_POST["cellphonesms"] = true; ! $edituser->cellphonesms = "1"; ! } else { ! $_POST["cellphonesms"] = false; ! $edituser->cellphonesms = "0"; ! } ! $query = ofirst_dbquery("UPDATE ofirst_members SET firstname='" . $_POST["firstname"] . "', lastname='" . $_POST["lastname"] . "', --- 32,56 ---- // Check if user has entered a user to edit ! if (! isset($_GET['user'])) { echo "<br><br>You must select a user from the member list to edit! [ <a href='index.php'>Member List</a> ]<br><br>"; ! die(include_once("$footer")); } ! if (isset($_POST["firstname"]) == true) { ! if (isset($_POST["ndivision"]) == true && $_POST["ndivision"] != "") { ! $_POST["division"] = $_POST["ndivision"]; ! ofirst_dbquery("INSERT INTO ofirst_divisions (division) VALUES ('" . $_POST["division"] . "');"); ! ofirst_dbquery("UPDATE ofirst_divisions SET description='" . $_POST["divisiondescription"] . "' WHERE division='" . $_POST["division"] . "';"); ! } ! if (isset($_POST["cellphonesms"]) && $_POST["cellphonesms"] == "0") { ! $_POST["cellphonesms"] = true; ! $edituser->cellphonesms = "1"; ! } else { ! $_POST["cellphonesms"] = false; ! $edituser->cellphonesms = "0"; ! } ! ofirst_dbquery("UPDATE ofirst_members SET firstname='" . $_POST["firstname"] . "', lastname='" . $_POST["lastname"] . "', *************** *** 72,86 **** cellphonenumber='" . $_POST["cellphonenumber"] . "', cellphonecarrier='" . $_POST["cellphonecarrier"] . "', ! password = '" . cryptpassword($_POST["password"], $encryption) . "', cellphonesms='" . $_POST["cellphonesms"] . "' WHERE user='".$_POST['user']."';"); ! $query = ofirst_dbquery("UPDATE ofirst_members SET password='" . cryptpassword($_POST["password"], $encryption) ."' WHERE user='".$_GET['user']."';"); ! ! echo("<br><font color='green'>Profile updated.</font>"); } ! ! $edituser_query = ofirst_dbquery("SELECT * FROM ofirst_members WHERE user = '".$_GET['user']."';"); ! $edituser = ofirst_dbfetch_object($edituser_query); ! ?> <h1>Edit Member Account</h1> <p><a href="<?php echo $basepath; ?>/members/admin/">Back to Member List</a></p> --- 67,84 ---- cellphonenumber='" . $_POST["cellphonenumber"] . "', cellphonecarrier='" . $_POST["cellphonecarrier"] . "', ! password = '" . cryptpassword($_POST["password"], $encryption) . "', cellphonesms='" . $_POST["cellphonesms"] . "' WHERE user='".$_POST['user']."';"); ! // Update password only if it's been entered ! if(isset($_POST["password"]) && $_POST["password"] != "") { ! ofirst_dbquery("UPDATE ofirst_members SET password='" . cryptpassword($_POST["password"], $encryption) ."' WHERE user='".$_GET['user']."';"); } ! echo("<br><font color='green'>Profile updated.</font>"); ! } ! ! $edituser_query = ofirst_dbquery("SELECT * FROM ofirst_members WHERE user = '".$_GET['user']."';"); ! $edituser = ofirst_dbfetch_object($edituser_query); ! ! ?> <h1>Edit Member Account</h1> <p><a href="<?php echo $basepath; ?>/members/admin/">Back to Member List</a></p> |