Changeset 11 for trunk/class/User.php
- Timestamp:
- Jun 19, 2012, 10:26:04 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/class/User.php
r10 r11 20 20 function __construct($Database) 21 21 { 22 $this->Database = $Database; 22 23 if(isset($_SESSION)) $this->Restore(); 23 24 else $this->SetAnonymous(); … … 31 32 function Login($Name, $Password) 32 33 { 33 global $Database;34 $DbResult = $ Database->query('SELECT `ID` FROM `User` WHERE LOWER(`Name`) = LOWER("'.$Name.'") AND `Pass` = '.$this->CryptPasswordSQL('"'.$Password.'"', '`Salt`'));34 ECHO 'TES'; 35 $DbResult = $this->Database->query('SELECT `ID` FROM `User` WHERE LOWER(`Name`) = LOWER("'.$Name.'") AND `Pass` = '.$this->CryptPasswordSQL('"'.$Password.'"', '`Salt`')); 35 36 if($DbResult->num_rows > 0) 36 37 { … … 46 47 { 47 48 if($this->Role != LICENCE_ANONYMOUS) 48 $this-> System->Database->query('UPDATE `User` SET `LastLogout` = NOW() WHERE `ID` = '.$this->Id);49 $this->Database->query('UPDATE `User` SET `LastLogout` = NOW() WHERE `ID` = '.$this->Id); 49 50 $this->SetAnonymous(); 50 51 } … … 52 53 function Load() 53 54 { 54 $DbResult = $this-> System->Database->query('SELECT * FROM `User` WHERE `ID` = '.$this->Id);55 $DbResult = $this->Database->query('SELECT * FROM `User` WHERE `ID` = '.$this->Id); 55 56 $User = $DbResult->fetch_assoc(); 56 57 // Security: Password and Salt hash should not be loaded to variables … … 110 111 { 111 112 if(array_key_exists('REMOTE_ADDR', $_SERVER)) 112 $this-> System->Database->query('UPDATE `User` SET `LastIP` = "'.$_SERVER['REMOTE_ADDR'].'", `LastLogin` = NOW() WHERE `ID` = '.$this->Id);113 $this->Database->query('UPDATE `User` SET `LastIP` = "'.$_SERVER['REMOTE_ADDR'].'", `LastLogin` = NOW() WHERE `ID` = '.$this->Id); 113 114 } 114 115 }
Note:
See TracChangeset
for help on using the changeset viewer.