Changeset 54
- Timestamp:
- Aug 21, 2007, 3:45:42 PM (17 years ago)
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
administrace/SubFiles/LoginMaster.php
r11 r54 1 1 <?php 2 2 3 require_once('../../config.php'); 3 $User = addslashes($_POST['user']); 4 $Pass = addslashes($_POST['pass']); 4 5 5 $User = $_POST['user']; 6 $Pass = $_POST['pass']; 7 8 include 'SubFiles/DatabaseConection.php'; 9 $Database = new Database($DatabaseHost, $DatabaseUser, $DatabasePassword); 10 $Database->SelectDatabase('wow'); 11 12 $Line = mysql_fetch_array($Database->SQLCommand("SELECT * FROM user WHERE user = '$User' AND Ban = 0")); 13 if (!$Line) { 14 die('Uivatel s touto pøezdívkou neexistuje<br />'); 15 } else { 16 If ($Line['Pass'] == $Pass) { 17 // pøihláení 18 $_SESSION['Licence'] = 1; 19 $_SESSION['User'] = $User; 6 $Database->select_db('wow'); 7 $DbResult = $Database->query('SELECT * FROM user WHERE user = "'.$User.'" AND Ban = 0'); 8 if($DbResult->num_rows == 0) 9 { 10 die('Uivatel s touto pøezdívkou neexistuje<br />'); 11 } else 12 { 13 $Line = $DbResult->fetch_array(); 14 If ($Line['Pass'] == $Pass) 15 { 16 // pøihláení 17 $_SESSION['Licence'] = 1; 18 $_SESSION['User'] = $User; 20 19 // echo 'Pøihláení se povedlo pokraèovat mùete <A href="../master.php">Zde</a>'; 21 20 22 21 // zapsání poslení pouité IP 23 24 $Database->SQLCommand("UPDATE user SET LastLogin = now(), LastIP = '$Addres' WHERE user = '$User'");22 $Addres = $_SERVER['REMOTE_ADDR']; 23 $Database->query("UPDATE user SET LastLogin = now(), LastIP = '$Addres' WHERE user = '$User'"); 25 24 26 } else { 27 $_SESSION['Licence'] = 0; 28 die('patné heslo'); 29 } 30 } 31 $Database->Disconnect(); 25 } else 26 { 27 $_SESSION['Licence'] = 0; 28 die('patné heslo'); 29 } 30 } 31 32 32 ?> -
administrace/master.php
r51 r54 2 2 include('../global.php'); 3 3 4 if (@$_SESSION['Licence'] == 1)4 if(array_key_exists('Licence', $_SESSION)) 5 5 { 6 } else { 7 include 'SubFiles/LoginMaster.php';8 } 6 if($_SESSION['Licence'] == 1); 7 else include('SubFiles/LoginMaster.php'); 8 } else include('SubFiles/LoginMaster.php'); 9 9 ?> 10 10 11 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 11 12 <html> -
config.sample.php
r47 r54 26 26 'Admin' => 'Chronos', 27 27 'AdminEmail' => 'wow@zdechov.net', 28 'ShowError' => 0, 28 29 ), 29 30 ); -
error.php
r14 r54 3 3 // Obsluha chyb v1.1.1 // 4 4 5 $Error_Email = 'robie@centrum.cz'; // Adresa, kam budou chyby odesílány6 $Error_Subject = 'WoW Heroes of Fantasy- Chybové hlá¹ení'; // Název zpráv o chybách7 $Error_ShowDetails = 1; // Zobrazit detajly o chyby5 $Error_Email = $Config['Web']['AdminEmail']; // Adresa, kam budou chyby odesílány 6 $Error_Subject = $Config['Web']['Title'].' - Chybové hlá¹ení'; // Název zpráv o chybách 7 $Error_ShowDetails = $Config['Web']['ShowError']; // Zobrazit detajly o chyby 8 8 $ErrorLogFile = 'php_script_error.log'; 9 9
Note:
See TracChangeset
for help on using the changeset viewer.