Changeset 54 for administrace


Ignore:
Timestamp:
Aug 21, 2007, 3:45:42 PM (17 years ago)
Author:
george
Message:

Oprava chyb v administraci.

Location:
administrace
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • administrace/SubFiles/LoginMaster.php

    r11 r54  
    11<?php
    22
    3 require_once('../../config.php');
     3$User = addslashes($_POST['user']);
     4$Pass = addslashes($_POST['pass']);
    45
    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('Uživatel 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');
     8if($DbResult->num_rows == 0)
     9{
     10  die('Uživatel 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;
    2019    //    echo 'Pøihlá‘ení se povedlo pokraèovat mùžete <A href="../master.php">Zde</a>';
    2120       
    2221        // zapsání poslení použité IP
    23         $Addres = $_SERVER['REMOTE_ADDR'];   
    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'");
    2524
    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
    3232?>
  • administrace/master.php

    r51 r54  
    22include('../global.php');
    33
    4 if (@$_SESSION['Licence'] == 1)
     4if(array_key_exists('Licence', $_SESSION))
    55{
    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');
    99?>
     10
    1011<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    1112<html>
Note: See TracChangeset for help on using the changeset viewer.