Changeset 378 for trunk/includes/user.php
- Timestamp:
- Mar 11, 2010, 11:14:05 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/user.php
r377 r378 37 37 $this->Load(); 38 38 WriteLog('Login: '.$Name, LOG_TYPE_USER); 39 40 // Záznam o aktivitě 41 if(array_key_exists('REMOTE_ADDR', $_SERVER)) 42 $Database->SQLCommand('UPDATE `User` SET `LastIP` = "'.$_SERVER['REMOTE_ADDR'].'", `LastLogin` = NOW() WHERE `ID` = '.$this->Id); 39 $this->UpdateState(); 43 40 } else $ŧhis->Role = LICENCE_ANONYMOUS; 44 41 } … … 59 56 $DbResult = $Database->SQLCommand('SELECT * FROM `User` WHERE `ID` = '.$this->Id); 60 57 $User = mysql_fetch_assoc($DbResult); 58 // Security: Password and Salt hash should not be loaded to variables 61 59 $this->Id = $User['ID']; 62 60 $this->Team = $User['Team']; … … 73 71 { 74 72 $this->Id = $_SESSION['UserId']; 75 if($this->Id != 0) $this->Load(); 76 else $this->SetAnonymous(); 73 if($this->Id != 0) 74 { 75 $this->Load(); 76 $this->UpdateState(); 77 } else $this->SetAnonymous(); 77 78 } else $this->SetAnonymous(); 78 79 } … … 111 112 return('sha1(CONCAT(sha1('.$Password.'), '.$Salt.'))'); 112 113 } 114 115 function UpdateState() 116 { 117 global $Database; 118 119 if(array_key_exists('REMOTE_ADDR', $_SERVER)) 120 $Database->SQLCommand('UPDATE `User` SET `LastIP` = "'.$_SERVER['REMOTE_ADDR'].'", `LastLogin` = NOW() WHERE `ID` = '.$this->Id); 121 } 113 122 } 114 123
Note:
See TracChangeset
for help on using the changeset viewer.