Changeset 217
- Timestamp:
- Jan 12, 2008, 10:40:33 PM (17 years ago)
- Location:
- quests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
quests/dictionary.php
r216 r217 9 9 $Database->SQLCommand('SET NAMES '.$Config['Database']['Charset']); 10 10 $Database->SelectDatabase($Config['Database']['Database']); 11 12 13 14 15 function Licence($Licence) 16 { // BEGIN function Licence 17 global $Database; 18 if (isset($_SESSION['User']) and $_SESSION['User'] <> '') { 19 $User = $_SESSION['User']; 20 $Pass = $_SESSION['Pass']; 21 22 $Line = mysql_fetch_array($Database->SQLCommand("SELECT * FROM user WHERE LOWER(user) = LOWER('$User')")); 23 if (!$Line) { 24 return false; 25 } else { 26 if ($Licence == 1) { 27 if ($Line['gm'] == 1) { 28 return true; 29 } else return false; 30 } 31 If ($Line['pass'] == $Pass) { 32 33 // zapsání poslení pouité IP 34 // $Addres = $_SERVER['REMOTE_ADDR']; 35 // $Database->SQLCommand("UPDATE user SET LastLogin = now(), LastIP = '$Addres' WHERE user = '$User'"); 36 37 return True; 38 } else { return False; 39 // die('Nemáte zde pøístup, pøihlate se: <a href="'.$Config['Web']['BaseURL'].'">zde</a>'); 40 } 41 } 42 } else { return False; 43 // die('Nemáte zde pøístup, pøihlate se: <a href="'.$Config['Web']['BaseURL'].'">zde</a>'); 44 } 45 46 } // END function Licence 47 48 11 49 12 50 … … 56 94 echo '<tr><td><form action="dictionary.php" method="get"> 57 95 <input type="text" value="'.$Search.'" name="search" size="30"> 58 <input type="submit" value="Vyhledat"> <a href="dictionary.php?insert">Vlo¾it slovo</a> 59 </form></td></tr>'; 96 <input type="submit" value="Vyhledat">'; 97 if (Licence(0)) 98 echo ' <a href="dictionary.php?insert">Vlo¾it slovo</a>'; 99 100 echo '</form></td></tr>'; 60 101 echo '<tr><td> 61 102 <p style=" overflow: auto; width: 100%; height: 345px;">'; -
quests/includes/global.php
r216 r217 15 15 $_SESSION['Pass'] = $_POST['LoginPass']; 16 16 17 $Line = mysql_fetch_array($Database->SQLCommand("SELECT ID FROM user WHERE user = '".$_SESSION['User']."'"));17 $Line = mysql_fetch_array($Database->SQLCommand("SELECT ID FROM user WHERE LOWER(user) = LOWER('".$_SESSION['User']."')")); 18 18 $_SESSION['UserID'] = $Line['ID']; 19 19 } … … 32 32 $Pass = $_SESSION['Pass']; 33 33 34 $Line = mysql_fetch_array($Database->SQLCommand("SELECT * FROM user WHERE user = '$User'"));34 $Line = mysql_fetch_array($Database->SQLCommand("SELECT * FROM user WHERE LOWER(user) = LOWER('$User')")); 35 35 if (!$Line) { 36 36 return false;
Note:
See TracChangeset
for help on using the changeset viewer.