[Openfirst-cvscommit] members updateprofile.php,NONE,1.1 auth.php,1.7,1.8
Brought to you by:
xtimg
From: <xt...@us...> - 2003-06-01 14:46:32
|
Update of /cvsroot/openfirst/members In directory sc8-pr-cvs1:/tmp/cvs-serv18866 Modified Files: auth.php Added Files: updateprofile.php Log Message: Add user-level profile management functionality. --- NEW FILE: updateprofile.php --- <?php /* * openFIRST.members - updateprofile.php * * Copyright (C) 2003, * openFIRST Project * Original Author: Tim Ginn <tim...@po...> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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. * 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 * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ include("../config/globals.php"); include($header); if(isset($user->user)) { membersmenu($user->membertype); if (isset($_POST["firstname"]) == true) { $query = "UPDATE ofirst_members SET firstname='" . $_POST["firstname"] . "', lastname='" . $_POST["lastname"] . "' , division='" . $_POST["division"] . "', year='" . $_POST["year"] . "', email='" . $_POST["email"] . "', icq='" . $_POST["icq"] . "', aim='" . $_POST["aim"] . "', msn='" . $_POST["msn"] . "', yim='" . $_POST["yim"] . "', signature='" . $_POST["signature"] . "', description='" . $_POST["description"] . "', picturelocation='" . $_POST["picturelocation"] . "' WHERE user='$user->user';"; $q = mysql_query($query); if(isset($_POST["password"]) == true && isset($_POST["cpassword"]) == true) { if($_POST["password"] == $_POST["cpassword"] && $_POST["password"] != "") { $query = mysql_query("UPDATE ofirst_members SET password='" . cryptpassword($_POST["password"], $encryption) ."' WHERE user='$user->user';"); echo("Password Changed."); } elseif ($_POST["password"] != $_POST["cpassword"]) { echo("The password and confirm password fields do not match."); } } echo("Profile updated."); } ?> <h1>Update Profile</h1> <p>You may use this page to update your members profile. You should also: <a href="updateskills.php">update your skills list</a>.</p> <form action='updateprofile.php' method='post'> <table> <tr><th>Heading</th><th>Content</th></tr> <?php echo("<tr><td>Username</td><td>$user->user</td></tr> <tr><td>First Name</td><td><input type='text' name='firstname' value='$user->firstname' /></td></tr> <tr><td>Last Name</td><td><input type='text' name='lastname' value='$user->lastname' /></td></tr> <tr><td>Password</td><td><input type='password' name='password' value='' /></td></tr> <tr><td>Confirm Password</td><td><input type='password' name='cpassword' value='' /></td></tr> <tr><td>Division</td><td><input type='text' name='division' value='$user->division'></td></tr> <tr><td>Year</td><td><input type='text' name='year' value='$user->year'></td></tr> <tr><td>E-mail Address</td><td><input type='text' name='email' value='$user->email'></td></tr> <tr><td>ICQ Number</td><td><input type='text' name='icq' value='$user->icq'></td></tr> <tr><td>AIM Screenname</td><td><input type='text' name='aim' value='$user->aim'></td></tr> <tr><td>MSN Messenger Address</td><td><input type='text' name='msn' value='$user->msn'></td></tr> <tr><td>Yahoo! Instant Messenger Address</td><td><input type='text' name='yim' value='$user->yim'></td></tr> <tr><td>Freeform Description</td><td><textarea name='description'>$user->description</textarea></td></tr> <tr><td>Signature</td><td><textarea name='signature'>$user->signature</textarea></td></tr> <tr><td>Picture Location</td><td><input type='text' name='picturelocation' value='$user->picturelocation'></td></tr> "); ?> <tr><td></td><td><input type="submit" value="Update Profile"> <input type="reset" value="Reset Profile"> </table> </form> <?php } else { showlogin(); } include($footer); ?> Index: auth.php =================================================================== RCS file: /cvsroot/openfirst/members/auth.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** auth.php 1 Jun 2003 05:59:14 -0000 1.7 --- auth.php 1 Jun 2003 14:46:28 -0000 1.8 *************** *** 44,48 **** function membersmenu($membertype) { ! echo("<p><a href='../members'>Members Home</a> <a href='../members/profile.php'>Members Profiles</a> <a href='../members/skills.php'>Update Skills</a> "); if($membertype == "administrator") { echo("<a href='../members/sqlinstall.php'>Install SQL Tables</a> --- 44,48 ---- function membersmenu($membertype) { ! echo("<p><a href='../members'>Members Home</a> <a href='../members/profile.php'>Members Profiles</a> <a href='../members/updateprofile.php'>Update Profile</a> <a href='../members/skills.php'>Update Skills</a> "); if($membertype == "administrator") { echo("<a href='../members/sqlinstall.php'>Install SQL Tables</a> |