| 1 | <?php
|
|---|
| 2 |
|
|---|
| 3 | $info = '';
|
|---|
| 4 | $html->PrgStart();
|
|---|
| 5 | if($player->Check())
|
|---|
| 6 | {
|
|---|
| 7 | if(array_key_exists('zmenit', $_POST) and ($_POST['zmenit'] == 1))
|
|---|
| 8 | {
|
|---|
| 9 | $account = $_POST['acc1'];
|
|---|
| 10 | $heslo1 = $_POST['heslo1'];
|
|---|
| 11 | $heslo2 = $_POST['heslo2'];
|
|---|
| 12 | $heslo3 = $_POST['heslo3'];
|
|---|
| 13 |
|
|---|
| 14 | if(empty($account) OR empty($heslo1) OR empty($heslo2) OR empty($heslo3)) $info = '<font color=red><strong>Nevyplnil jste všechna políčka!</strong></font>';
|
|---|
| 15 | else
|
|---|
| 16 | {
|
|---|
| 17 | $db->select_db($Config['Mangos']['DatabaseRealmd']);
|
|---|
| 18 | $DbResult = $db->query('SELECT id FROM account WHERE username="'.$account.'" and sha_pass_hash=SHA1(CONCAT(UPPER("'.$account.'"),":",UPPER("'.$heslo1.'")))');
|
|---|
| 19 | if($DbResult->num_rows > 0)
|
|---|
| 20 | {
|
|---|
| 21 | if($heslo2 == $heslo3)
|
|---|
| 22 | {
|
|---|
| 23 | $pass_update = $db->query('update account set sha_pass_hash=SHA1(CONCAT(UPPER("'.$account.'"), ":", UPPER("'.$heslo2.'"))) where username="'.$account.'"');
|
|---|
| 24 | if($pass_update) $info = '<font color="green"><strong>Heslo bylo vpořádku změněno!</strong></font>';
|
|---|
| 25 | else $info = '<font color="red"><strong>Heslo se nepodařilo změnit!</strong></font>';
|
|---|
| 26 | } else $info = '<font color="red"><b>Hesla se neshodují!</b></font>';
|
|---|
| 27 | } else $info = '<font color="red"><b>Zadali jste neexistujici účet nebo špatné heslo!</b></font>';
|
|---|
| 28 | }
|
|---|
| 29 | }
|
|---|
| 30 |
|
|---|
| 31 | echo(' <a href="'.$html->Link('/ucet/').'"><- Zpět do správy účtu</a><br />
|
|---|
| 32 |
|
|---|
| 33 | <b>'.$info.'</b>
|
|---|
| 34 | <form method="post" action="?">
|
|---|
| 35 | <center><h3>Změna typu účtu</h3></center>
|
|---|
| 36 |
|
|---|
| 37 | <table align="center">
|
|---|
| 38 | <input type="hidden" name="acc1" value="'.$_SESSION['UserName'].'" />
|
|---|
| 39 | <tr>
|
|---|
| 40 | <td>
|
|---|
| 41 | Momentální Heslo: </td>
|
|---|
| 42 | <td>
|
|---|
| 43 | <input type="password" name="heslo1" class="textinput" /></td>
|
|---|
| 44 | </tr>
|
|---|
| 45 | <tr>
|
|---|
| 46 | <td>
|
|---|
| 47 | Nové Heslo : </td>
|
|---|
| 48 | <td>
|
|---|
| 49 | <input type="password" name="heslo2" class="textinput" /></td>
|
|---|
| 50 | </tr>
|
|---|
| 51 | <tr>
|
|---|
| 52 | <td>
|
|---|
| 53 | Nové Heslo podruhé : </td>
|
|---|
| 54 | <td>
|
|---|
| 55 | <input type="password" name="heslo3" class="textinput" /></td>
|
|---|
| 56 | </tr>
|
|---|
| 57 | <tr>
|
|---|
| 58 | <td colspan="2" align="right">
|
|---|
| 59 | <input type="hidden" name="zmenit" value="1" />
|
|---|
| 60 | <input type="submit" value="Změnit" name="change"></td>
|
|---|
| 61 | </tr>
|
|---|
| 62 | </table>
|
|---|
| 63 | </form>');
|
|---|
| 64 | }
|
|---|
| 65 | else $player->LoginForm();
|
|---|
| 66 | $html->PrgStop();
|
|---|
| 67 |
|
|---|
| 68 | ?>
|
|---|