Changeset 185 for administrace
- Timestamp:
- Dec 31, 2007, 5:25:17 PM (17 years ago)
- Location:
- administrace
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
administrace/index.php
r124 r185 1 1 <?php 2 3 // Redirection to secure connection 4 if(!array_key_exists('HTTPS', $_SERVER)) 5 { 6 Header('Location: https'.substr($_SERVER["SCRIPT_URI"], 4)); 7 die(); 8 } 2 9 3 10 include('../global.php'); 4 11 ShowHeader(); 5 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 vloena.<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 } 6 51 7 52 ShowFooter();
Note:
See TracChangeset
for help on using the changeset viewer.