Chat window now opens with no messages inside.
[Assignment-Trapper.git] / password_change_user.php
blobfa82b1457d48645f7ee3d71dea2165534b123ecb
1 <?php
3 include_once("auth.php");
4 include_once("header.php");
5 include_once("conn.php");
7 if($role != 0) { die("Account \"".$user_name."\" Is Not Authorized To View This Page.<br><br>This Event Will Be Logged And Reported."); }
9 $_POST['username'] = mysql_real_escape_string($_POST['username']);
10 $_POST['password'] = mysql_real_escape_string($_POST['password']);
12 if($_POST['username'] && $_POST['password']) {
14 $sql = "update users set password=SHA(\"".$_POST['password']."\"), first_login=1 where email='". $_POST["username"]."'";
16 //echo $sql;
17 $result = mysql_query($sql);
18 if (!$result) { die("SQL ERROR: Update Password"); }
20 /* move to classes page */
21 //echo '<html><meta http-equiv="refresh" content="0; manage.php" /></html>';
22 exit;
27 <h3>Manage Accounts -> Change User Password</h3>
29 <form action='password_change_user.php' method="post">
30 <center>
31 <table>
32 <tr><td>e-mail:</td><td><input type="text" id="username" name="username"></td></tr>
33 <tr><td>password:</td><td><input type="password" id="password" name="password"></td></tr>
34 </table><br>
35 <input type="submit" value="Update Password"/>
36 </center>
37 </form>