Changeset 14 for trunk/class/User.php
- Timestamp:
- Jun 19, 2012, 12:09:30 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/class/User.php
r11 r14 32 32 function Login($Name, $Password) 33 33 { 34 ECHO 'TES';35 34 $DbResult = $this->Database->query('SELECT `ID` FROM `User` WHERE LOWER(`Name`) = LOWER("'.$Name.'") AND `Pass` = '.$this->CryptPasswordSQL('"'.$Password.'"', '`Salt`')); 36 35 if($DbResult->num_rows > 0) … … 42 41 $this->UpdateState(); 43 42 } else $ŧhis->Role = LICENCE_ANONYMOUS; 43 } 44 45 function Register($Email,$RegUser,$RegPass,$RegPass2) 46 { 47 48 if ($RegPass != $RegPass2) return -1; 49 50 $Salt = $this->GetPasswordSalt(); 51 52 $DbResult = $this->Database->insert('User', array( 53 'Email' => '"'.$Email.'"', 54 'Name' => '"'.$RegUser.'"', 55 'Pass' => $this->CryptPasswordSQL('"'.$RegPass.'"', '"'.$Salt.'"'), 56 'LastIP' => '"'.$_SERVER['REMOTE_ADDR'].'"', 57 'Salt' => '"'.$Salt.'"', 58 ) 59 ); 60 61 62 return $DbResult; 63 44 64 } 45 65 … … 57 77 // Security: Password and Salt hash should not be loaded to variables 58 78 $this->Id = $User['ID']; 59 $this->Team = $User['Team'];60 79 $this->Name = $User['Name']; 61 $this->Role = $User['GM'];80 $this->Role = LICENCE_USER; 62 81 $this->Email = $User['Email']; 63 82 } … … 86 105 $this->Name = 'anonymous'; 87 106 $this->Role = LICENCE_ANONYMOUS; 88 $this->Language = 1;89 $this->Redirecting = 1;90 $this->Team = 0;91 107 $this->Email = ''; 92 108 }
Note:
See TracChangeset
for help on using the changeset viewer.