Changeset 376 for trunk/Options.php
- Timestamp:
- Mar 11, 2010, 8:40:32 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Options.php
r374 r376 4 4 ShowPage(); 5 5 6 if( Licence(LICENCE_USER))6 if($User->Licence(LICENCE_USER)) 7 7 { 8 $User = @$_SESSION['User'];9 10 8 if(array_key_exists('Email', $_POST)) 11 9 { … … 15 13 $NewPass2 = $_POST['NewPass2']; 16 14 $Language = $_POST['Language']; 17 $ redirecting = $_POST['redirecting'];15 $Redirecting = $_POST['redirecting']; 18 16 19 if( ($_SESSION['Pass'] == $OldPass) and ($NewPass == $NewPass2))17 if($NewPass == $NewPass2) 20 18 { 21 // Update password 22 $Salt = GetPasswordSalt(); 23 $Database->SQLCommand('UPDATE `User` SET `Pass` = sha1(CONCAT(sha1("'.$NewPass.'"), "'.$Salt.'")), `Salt`="'.$Salt.'" WHERE `ID` = '.$_SESSION['UserID']); 24 echo('Heslo změněno!<br />'); 19 $DbResult = $Database->SQLCommand('SELECT `Pass`, '.$User->CryptPasswordSQL('"'.$OldPass.'"', '`Salt`').' AS `Hash` FROM `User` WHERE `ID`= '.$User->Id); 20 $DbRow = mysql_fetch_assoc($DbResult); 21 if($DbRow['Hash'] == $DbRow['Pass']) 22 { 23 // Update password 24 $Salt = $User->GetPasswordSalt(); 25 $Database->SQLCommand('UPDATE `User` SET `Pass` = '.$User->CryptPasswordSQL('"'.$NewPass.'"', '"'.$Salt.'"').', `Salt`="'.$Salt.'" WHERE `ID` = '.$User->Id); 26 echo('Heslo změněno!<br />'); 27 } else echo('<br />Staré heslo neodpovídá!<br />'); 25 28 } else echo('<br />Hesla se neshodují!<br />'); 26 29 27 $Database->SQLCommand('UPDATE `User` SET `Email` = "'.$Email.'", `Language` = "'.$Language.'", `Redirecting` = "'.$ redirecting.'" WHERE `ID` = '.$_SESSION['UserID']);28 echo('Úprava nastavení proběhla v pořádku, Email: <b>'.$Email.'</b> Uživatel: <b>'.$User .'</b><br />');30 $Database->SQLCommand('UPDATE `User` SET `Email` = "'.$Email.'", `Language` = "'.$Language.'", `Redirecting` = "'.$Redirecting.'" WHERE `ID` = '.$User->Id); 31 echo('Úprava nastavení proběhla v pořádku, Email: <b>'.$Email.'</b> Uživatel: <b>'.$User->Name.'</b><br />'); 29 32 WriteLog('Úprava nastavení!', LOG_TYPE_USER); 30 33 } else 31 34 { 32 $Line = mysql_fetch_assoc($Database->SQLCommand('SELECT * FROM `User` WHERE `ID` = '.$_SESSION['UserID']));33 35 echo('<form action="Options.php" method="post"> 34 36 <fieldset><legend>Nastavení uživatele</legend> … … 36 38 <tr> 37 39 <td>Email: </td> 38 <td><input type="text" name="Email" value="'.$ Line['Email'].'" /></td>40 <td><input type="text" name="Email" value="'.$User->Email.'" /></td> 39 41 </tr> 40 42 <tr> … … 53 55 <td>Normálně budu překládat do: </td> 54 56 <td>'); 55 WriteLanguages($ Line['Language']);57 WriteLanguages($User->Language); 56 58 echo('</td> 57 59 </tr> … … 62 64 echo('<select name="redirecting">'); 63 65 echo('<option value="0">Nikam</option>'); 64 echo('<option value="1"'); if ($Line['Redirecting'] == '1') echo(' selected="selected"'); echo('>Na nepřeložené</option>'); 65 echo('<option value="2"'); if ($Line['Redirecting'] == '2') echo(' selected="selected"'); echo('>Na další překlad</option>'); 66 echo('<option value="3"'); if ($Line['Redirecting'] == '3') echo(' selected="selected"'); echo('>Na předchozí překlad</option>'); 66 echo('<option value="1"'); 67 if($User->Redirecting == '1') echo(' selected="selected"'); 68 echo('>Na nepřeložené</option>'); 69 echo('<option value="2"'); 70 if($User->Redirecting == '2') echo(' selected="selected"'); 71 echo('>Na další překlad</option>'); 72 echo('<option value="3"'); 73 if($User->Redirecting == '3') echo(' selected="selected"'); 74 echo('>Na předchozí překlad</option>'); 67 75 echo('</select>'); 68 76 69 77 echo('</td> 70 78 </tr> 71 79 <tr> … … 85 93 { 86 94 echo('<option value="'.$LineTeam['Id'].'"'); 87 if ($LineTeam['Id'] == $ Line['Team']) echo(' selected="selected"');95 if ($LineTeam['Id'] == $User->Team) echo(' selected="selected"'); 88 96 echo('>'.$LineTeam['Name'].'</option>'); 89 97 }
Note:
See TracChangeset
for help on using the changeset viewer.