|
Last change
on this file was 389, checked in by george, 17 years ago |
- Upraveno: Kódování všech souborů webu bylo převedeno z ISO 8859-2 na obecné UTF-8.
|
|
File size:
1.3 KB
|
| Line | |
|---|
| 1 | <?php
|
|---|
| 2 |
|
|---|
| 3 | // Redirection to secure connection
|
|---|
| 4 | if(!array_key_exists('HTTPS', $_SERVER))
|
|---|
| 5 | {
|
|---|
| 6 | // Header('Location: https://'.$_SERVER['HTTP_HOST'].substr($_SERVER["SCRIPT_NAME"], 4));
|
|---|
| 7 | // die();
|
|---|
| 8 | }
|
|---|
| 9 |
|
|---|
| 10 | include('../global.php');
|
|---|
| 11 | ShowHeader();
|
|---|
| 12 |
|
|---|
| 13 | include('home.php');
|
|---|
| 14 | include('user.php');
|
|---|
| 15 | $User = new User();
|
|---|
| 16 |
|
|---|
| 17 | if(!array_key_exists('op', $_GET)) $_GET['op'] = '';
|
|---|
| 18 | $Operation = addslashes($_GET['op']);
|
|---|
| 19 | switch($Operation)
|
|---|
| 20 | {
|
|---|
| 21 | case 'Login':
|
|---|
| 22 | $User->Login(addslashes($_POST['username']), addslashes($_POST['password']));
|
|---|
| 23 | break;
|
|---|
| 24 | case 'Logout':
|
|---|
| 25 | $User->Logout();
|
|---|
| 26 | break;
|
|---|
| 27 | case 'AddMessage':
|
|---|
| 28 | if($User->Check())
|
|---|
| 29 | {
|
|---|
| 30 | $Database->select_db('wow');
|
|---|
| 31 | $Database->insert('gm_news', array('author' => $_SESSION['UserId'], 'text' => addslashes($_POST['text']), 'time' => 'NOW()'));
|
|---|
| 32 | //echo('Zpráva vložena.<br>');
|
|---|
| 33 | }
|
|---|
| 34 | break;
|
|---|
| 35 | default:
|
|---|
| 36 | }
|
|---|
| 37 |
|
|---|
| 38 | if($User->Check()) Show();
|
|---|
| 39 | else {
|
|---|
| 40 |
|
|---|
| 41 | echo('<h3>Správa serveru:</h3><br><strong>Přihlášení:</strong><br>
|
|---|
| 42 | <form action="?op=Login" method="post">
|
|---|
| 43 | <table>
|
|---|
| 44 | <tr><td>Jméno:</td><td><input name="username" type="text"></td></tr>
|
|---|
| 45 | <tr><td>Heslo:</td><td><input name="password" type="password"></td></tr>
|
|---|
| 46 | <tr><td colspan=2"><input type="submit" value="Přihlásit"></td></tr>
|
|---|
| 47 | </table>
|
|---|
| 48 | </form>');
|
|---|
| 49 |
|
|---|
| 50 | }
|
|---|
| 51 |
|
|---|
| 52 | //echo(phpinfo());
|
|---|
| 53 | ShowFooter();
|
|---|
| 54 |
|
|---|
| 55 | ?>
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.