Changeset 240 for quests/Options.php


Ignore:
Timestamp:
Jan 17, 2008, 2:02:18 PM (17 years ago)
Author:
maron
Message:

Mrtě oprav

File:
1 edited

Legend:

Unmodified
Added
Removed
  • quests/Options.php

    r231 r240  
    66    $User = @$_SESSION['User'];
    77
    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);
    1322  } 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']));   
    1524?>
    16   <form action="Options.php" method="get">
     25  <form action="Options.php" method="post">
    1726  <table>
    1827    <tr>
     
    2130    </tr>
    2231    <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>
    2445    </tr>
    2546  </table>
Note: See TracChangeset for help on using the changeset viewer.