Changeset 217 for quests/dictionary.php


Ignore:
Timestamp:
Jan 12, 2008, 10:40:33 PM (17 years ago)
Author:
maron
Message:

Menší úoravy

File:
1 edited

Legend:

Unmodified
Added
Removed
  • quests/dictionary.php

    r216 r217  
    99$Database->SQLCommand('SET NAMES '.$Config['Database']['Charset']);
    1010$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í použité 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øihlašte se: <a href="'.$Config['Web']['BaseURL'].'">zde</a>');
     40      }
     41    }
     42    } else { return False;
     43      //  die('Nemáte zde pøístup, pøihlašte se: <a href="'.$Config['Web']['BaseURL'].'">zde</a>');
     44    }
     45       
     46  } // END function Licence
     47
     48
    1149
    1250
     
    5694    echo '<tr><td><form action="dictionary.php" method="get">
    5795          <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>';
    60101    echo '<tr><td>
    61102    <p style="  overflow: auto;  width: 100%; height: 345px;">';
Note: See TracChangeset for help on using the changeset viewer.