Changeset 238 for quests/includes/global.php
- Timestamp:
- Jan 16, 2008, 9:59:47 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
quests/includes/global.php
r235 r238 10 10 $Database->SelectDatabase($Config['Database']['Database']); 11 11 12 //globální funkce 13 include('global_function.php'); 14 15 12 16 //pøihlá¹ení 13 17 if (array_key_exists('LoginUser',$_POST)) { … … 18 22 $_SESSION['UserID'] = $Line['ID']; 19 23 $_SESSION['User'] = $Line['user']; 24 WriteLog('Login: '.$_SESSION['User'], 3); 20 25 } 21 26 //odhlá¹ení … … 24 29 $_SESSION['Pass'] = ''; 25 30 $_SESSION['UserID'] = ''; 31 WriteLog('Odhlá¹ení', 3); 26 32 } 27 33 //záznam o aktivitì 28 34 if (Licence(0)) 29 35 $Database->SQLCommand("UPDATE user SET LastIP = '".$_SERVER['REMOTE_ADDR']."', LastLogin = now() WHERE ID = ".$_SESSION['UserID']); 30 31 function Licence($Licence)32 { // BEGIN function Licence33 global $Database;34 if (isset($_SESSION['User']) and $_SESSION['User'] <> '') {35 // $User = $_SESSION['User'];36 $Pass = $_SESSION['Pass'];37 38 $Line = mysql_fetch_array($Database->SQLCommand("SELECT * FROM user WHERE ID = ".$_SESSION['UserID']));39 if (!$Line) {40 return false;41 } else {42 if ($Licence == 1) {43 if ($Line['gm'] == 1) {44 return true;45 } else return false;46 }47 If ($Line['pass'] == $Pass) {48 49 // zapsání poslení pou¾ité IP50 // $Addres = $_SERVER['REMOTE_ADDR'];51 // $Database->SQLCommand("UPDATE user SET LastLogin = now(), LastIP = '$Addres' WHERE user = '$User'");52 53 return True;54 } else { return False;55 // die('Nemáte zde pøístup, pøihla¹te se: <a href="'.$Config['Web']['BaseURL'].'">zde</a>');56 }57 }58 } else { return False;59 // die('Nemáte zde pøístup, pøihla¹te se: <a href="'.$Config['Web']['BaseURL'].'">zde</a>');60 }61 62 } // END function Licence63 64 65 $Texts = array(66 // array('Title'),67 array('Details'),68 array('Objectives'),69 array('OfferRewardText'),70 array('RequestItemsText'),71 array('EndText'),72 array('ObjectiveText1'),73 array('ObjectiveText2'),74 array('ObjectiveText3'),75 array('ObjectiveText4'),76 );77 36 78 37 … … 110 69 // echo 'Administrace:'; 111 70 echo '<br /><a href="priorite.php" Title="Naètení priority questù (Moderator only)">Priorita</a><br />'; 71 echo '<a href="log.php" Title="Log dìní (Moderator only)">Log</a><br />'; 112 72 } 113 73
Note:
See TracChangeset
for help on using the changeset viewer.