source: branches/old/administrace/index.php

Last change on this file was 389, checked in by george, 16 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
4if(!array_key_exists('HTTPS', $_SERVER))
5{
6// Header('Location: https://'.$_SERVER['HTTP_HOST'].substr($_SERVER["SCRIPT_NAME"], 4));
7// die();
8}
9
10include('../global.php');
11ShowHeader();
12
13include('home.php');
14include('user.php');
15$User = new User();
16
17if(!array_key_exists('op', $_GET)) $_GET['op'] = '';
18$Operation = addslashes($_GET['op']);
19switch($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
38if($User->Check()) Show();
39else {
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());
53ShowFooter();
54
55?>
Note: See TracBrowser for help on using the repository browser.