Legend:
- Unmodified
- Added
- Removed
-
user.php
r28 r30 41 41 $SID = session_id(); 42 42 // Lookup user record 43 $Query = $this->Database->select( $this->TableUserOnline, '*', '`SessionId`="'.$SID.'"');43 $Query = $this->Database->select(array('Table' => $this->TableUserOnline, 'Condition' => '`SessionId`="'.$SID.'"')); 44 44 if($Query->num_rows > 0) 45 45 { 46 46 // Refresh time of last access 47 $this->Database->update( $this->TableUserOnline, '`SessionId`="'.$SID.'"', array('ActivityTime' => 'NOW()'));48 } else $this->Database->insert( $this->TableUserOnline, array('SessionId' => $SID, 'User' => 0, 'LoginTime' => 'NOW()', 'ActivityTime' => 'NOW()', 'IpAddress' => GetRemoteAddress(), 'HostName' => gethostbyaddr(GetRemoteAddress())));47 $this->Database->update(array('Table' => $this->TableUserOnline, 'Condition' => '`SessionId`="'.$SID.'"'), array('ActivityTime' => 'NOW()')); 48 } else $this->Database->insert(array('Table' => $this->TableUserOnline), array('SessionId' => $SID, 'User' => 0, 'LoginTime' => 'NOW()', 'ActivityTime' => 'NOW()', 'IpAddress' => GetRemoteAddress(), 'HostName' => gethostbyaddr(GetRemoteAddress()))); 49 49 //echo($this->Database->LastQuery); 50 50 51 51 // Zkontroluj přihlášení 52 $Query = $this->Database->select( $this->TableUserOnline, '*', 'SessionId="'.$SID.'"');52 $Query = $this->Database->select(array('Table' => $this->TableUserOnline, 'Condition' => 'SessionId="'.$SID.'"')); 53 53 $Row = $Query->fetch_assoc(); 54 54 if($Row['User'] != 0) … … 60 60 } else 61 61 { 62 $Query = $this->Database->select( $this->TableUser, '*', "`Id`=0");62 $Query = $this->Database->select(array('Table' => $this->TableUser, 'Condition' => "`Id`=0")); 63 63 $this->User = $Query->fetch_assoc(); 64 64 $Result = USER_NOT_LOGGED; … … 66 66 67 67 // Odeber neaktivní uživatele 68 $DbResult = $this->Database->select( $this->TableUserOnline, 'User', '`ActivityTime` < DATE_SUB(NOW(), INTERVAL '.USER_TIMEOUT.' SECOND)');68 $DbResult = $this->Database->select(array('Table' => $this->TableUserOnline, 'Columns' => 'User', 'Condition' => '`ActivityTime` < DATE_SUB(NOW(), INTERVAL '.USER_TIMEOUT.' SECOND)')); 69 69 while($DbRow = $DbResult->fetch_assoc()) 70 70 { 71 $this->Database->delete( $this->TableUserOnline, '`User`='.$DbRow['User']);71 $this->Database->delete(array('Table' => $this->TableUserOnline, 'Condition' => '`User`='.$DbRow['User'])); 72 72 //$this->System->Modules['Log']->Add('User', 'Logout'); 73 73 } … … 87 87 { 88 88 // Je uživatel registrován? 89 $Query = $this->Database->select( $this->TableUser, '*', 'Name = "'.$Nick.'"');89 $Query = $this->Database->select(array('Table' => $this->TableUser, 'Condition' => 'Name = "'.$Nick.'"')); 90 90 if($Query->num_rows > 0) $Result = NICK_USED; 91 91 else 92 92 { 93 $Query = $this->Database->select( $this->TableUser, '*', 'Email = "'.$Email.'"');93 $Query = $this->Database->select(array('Table' => $this->TableUser, 'Condition' => 'Email = "'.$Email.'"')); 94 94 if($Query->num_rows > 0) $Result = EMAIL_USED; 95 95 else 96 96 { 97 $this->Database->insert( $this->TableUser, array('Name' => $Nick, 'FirstName' => $FirstName, 'SecondName' => $SecondName, 'Password' => $Password, 'Email' => $Email, 'RegistrationTime' => 'NOW()', 'Locked' => 1));97 $this->Database->insert(array('Table' => $this->TableUser), array('Name' => $Nick, 'FirstName' => $FirstName, 'SecondName' => $SecondName, 'Password' => $Password, 'Email' => $Email, 'RegistrationTime' => 'NOW()', 'Locked' => 1)); 98 98 $UserId = $this->Database->insert_id; 99 99 … … 112 112 function RegisterConfirm($Id, $Hash) 113 113 { 114 $DbResult = $this->Database->select( $this->TableUser, 'Id, Name, Password', 'Id = '.$Id);114 $DbResult = $this->Database->select(array('Table' => $this->TableUser, 'Columns' => 'Id, Name, Password', 'Condition' => 'Id = '.$Id)); 115 115 if($DbResult->num_rows > 0) 116 116 { … … 118 118 if($Hash == $Row['Password']) 119 119 { 120 $this->Database->update( $this->TableUser, 'Id='.$Row['Id'], array('Locked' => 0));120 $this->Database->update(array('Table' => $this->TableUser, 'Condition' => 'Id='.$Row['Id']), array('Locked' => 0)); 121 121 $Output = USER_REGISTRATION_CONFIRMED; 122 122 //$this->System->Modules['Log']->NewRecord('User', 'RegisterConfirm', 'UserName='.$Row['Name']); … … 130 130 $SID = session_id(); 131 131 // Je uživatel registrován? 132 $Query = $this->Database->select( $this->TableUser, '*', 'UserName="'.$Nick.'"');132 $Query = $this->Database->select(array('Table' => $this->TableUser, 'Condition' => 'UserName="'.$Nick.'"')); 133 133 if($Query->num_rows > 0) 134 134 { … … 138 138 else 139 139 { 140 $this->Database->update( $this->TableUser, 'Id='.$Row['Id'], array('LastLoginTime' => 'NOW()'));141 $this->Database->update( $this->TableUserOnline, 'SessionId="'.$SID.'"', array('User' => $Row['Id'], 'Id' => $Row['mId']));140 $this->Database->update(array('Table' => $this->TableUser, 'Condition' => 'Id='.$Row['Id']), array('LastLoginTime' => 'NOW()')); 141 $this->Database->update(array('Table' => $this->TableUserOnline, 'Condition' => 'SessionId="'.$SID.'"'), array('User' => $Row['Id'], 'Id' => $Row['mId'])); 142 142 // načtení stavu stromu 143 143 $Result = USER_LOGGED_IN; … … 154 154 155 155 $SID = session_id(); 156 $this->Database->update( $this->TableUserOnline, 'SessionId="'.$SID.'"', array('User' => 0));156 $this->Database->update(array('Table' => $this->TableUserOnline, 'Condition' => 'SessionId="'.$SID.'"'), array('User' => 0)); 157 157 //$this->System->Modules['Log']->NewRecord('User', 'Logout', $this->User['Name']); 158 158 $this->Check(); … … 164 164 global $Config; 165 165 166 $DbResult = $this->Database->select( $this->TableUser, 'Name, Id, Email, Password', '`Name`="'.$Name.'" AND `Email`="'.$Email.'"');166 $DbResult = $this->Database->select(array('Table' => $this->TableUser, 'Columns' => 'Name, Id, Email, Password', 'Condition' => '`Name`="'.$Name.'" AND `Email`="'.$Email.'"')); 167 167 if($DbResult->num_rows > 0) 168 168 { … … 182 182 function PasswordRecoveryConfirm($Id, $Hash, $NewPassword) 183 183 { 184 $DbResult = $this->Database->select( $this->TableUser, 'Id, Name, Password', 'Id = '.$Id);184 $DbResult = $this->Database->select(array('Table' => $this->TableUser, 'Columns' => 'Id, Name, Password', 'Condition' => 'Id = '.$Id)); 185 185 if($DbResult->num_rows > 0) 186 186 { … … 189 189 if(($NewPassword == $NewPassword2) and ($Hash == $Row['Password'])) 190 190 { 191 $this->Database->update( $this->TableUser, 'Id='.$Row['Id'], array('Password' => $NewPassword, 'Locked' => 0));191 $this->Database->update(array('Table' => $this->TableUser, 'Condition' => 'Id='.$Row['Id']), array('Password' => $NewPassword, 'Locked' => 0)); 192 192 $Output = USER_PASSWORD_RECOVERY_CONFIRMED; 193 193 //$this->System->Modules['Log']->NewRecord('User', 'PasswordRecoveryConfirm', 'UserName='.$Row['Name']);
Note:
See TracChangeset
for help on using the changeset viewer.