Changeset 240 for quests/Options.php
- Timestamp:
- Jan 17, 2008, 2:02:18 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
quests/Options.php
r231 r240 6 6 $User = @$_SESSION['User']; 7 7 8 if (array_key_exists('Email', $_GET)) { 9 $Email = $_GET['Email']; 10 11 $Database->SQLCommand("UPDATE user SET Email = '$Email' WHERE user = '$User'"); 12 echo 'Úprava nastavení probìhla v poøádku, Email: <b>'.$Email.'</b> U¾ivatel: <b>'.$User.'</b>'; 8 if (array_key_exists('Email', $_POST)) { 9 $Email = $_POST['Email']; 10 $OldPass = $_POST['OldPass']; 11 $NewPass = $_POST['NewPass']; 12 $NewPass2 = $_POST['NewPass2']; 13 14 $Line = mysql_fetch_array($Database->SQLCommand("SELECT * FROM user WHERE ID = ".$_SESSION['UserID'])); 15 if (($Line['pass'] == $OldPass) and ($NewPass == $NewPass2)) { 16 $Database->SQLCommand("UPDATE user SET pass = '$NewPass' WHERE ID = ".$_SESSION['UserID']); 17 echo 'Heslo zmìnìno!<br />'; 18 } else echo '<br />Hesla se neshodují!<br />'; 19 $Database->SQLCommand("UPDATE user SET Email = '$Email' WHERE ID = ".$_SESSION['UserID']); 20 echo 'Úprava nastavení probìhla v poøádku, Email: <b>'.$Email.'</b> U¾ivatel: <b>'.$User.'</b><br />'; 21 WriteLog('Úprava nastavení!', 3); 13 22 } else { 14 $Line = mysql_fetch_array($Database->SQLCommand("SELECT * FROM user WHERE user = '$User'"));23 $Line = mysql_fetch_array($Database->SQLCommand("SELECT * FROM user WHERE ID = ".$_SESSION['UserID'])); 15 24 ?> 16 <form action="Options.php" method=" get">25 <form action="Options.php" method="post"> 17 26 <table> 18 27 <tr> … … 21 30 </tr> 22 31 <tr> 23 <th><input type="submit" value="ulozit"></th> 32 <td>Pùvodní heslo: </td> 33 <td><input type="password" name="OldPass"></td> 34 </tr> 35 <tr> 36 <td>Nové heslo: </td> 37 <td><input type="password" name="NewPass"></td> 38 </tr> 39 <tr> 40 <td>Nové heslo pro potvrzení: </td> 41 <td><input type="password" name="NewPass2"></td> 42 </tr> 43 <tr> 44 <th><input type="submit" value="Ulo¾it"></th> 24 45 </tr> 25 46 </table>
Note:
See TracChangeset
for help on using the changeset viewer.