Changeset 843 for trunk/Modules/User/User.php
- Timestamp:
- Jan 14, 2016, 10:25:47 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/User/User.php
r838 r843 22 22 { 23 23 $this->System->User = new User($this->System); 24 $this->System->RegisterPage('user list.php', 'PageUserList');25 $this->System->RegisterPage(' Options.php', 'PageUserOptions');26 $this->System->RegisterPage('registra ce.php', 'PageUserRegistration');27 $this->System->RegisterPage('user .php', 'PageUserProfile');24 $this->System->RegisterPage('users', 'PageUserList'); 25 $this->System->RegisterPage('options', 'PageUserOptions'); 26 $this->System->RegisterPage('registration', 'PageUserRegistration'); 27 $this->System->RegisterPage('user', 'PageUserProfile'); 28 28 $this->System->RegisterPage('login', 'PageUserLogin'); 29 29 $this->System->RegisterMenuItem(array( 30 30 'Title' => T('Translators'), 31 31 'Hint' => 'Seznam registrovaných uživatelů', 32 'Link' => $this->System->Link('/user list.php'),32 'Link' => $this->System->Link('/users/'), 33 33 'Permission' => LICENCE_ANONYMOUS, 34 34 'Icon' => '', … … 36 36 if(array_key_exists('Search', $this->System->ModuleManager->Modules)) 37 37 $this->System->ModuleManager->Modules['Search']->RegisterSearch('user', 38 T('Translators'), array('Name'), '`User`', $this->System->Link('/user list.php?search='));38 T('Translators'), array('Name'), '`User`', $this->System->Link('/users/?search=')); 39 39 } 40 40 … … 43 43 $Output = T('Online translators').':<br />'; 44 44 $DbResult = $this->System->Database->query('SELECT * FROM ('. 45 'SELECT `User`.`Name`, `User`.`ID` FROM `UserOnline` '.46 47 48 45 'SELECT `User`.`Name`, `User`.`ID` FROM `UserOnline` '. 46 'JOIN `User` ON `User`.`ID` = `UserOnline`.`User` '. 47 'WHERE (`ActivityTime` >= NOW() - 300) '. 48 'ORDER BY `ActivityTime` DESC ) AS `T` GROUP BY `Name`'); 49 49 while($DbUser = $DbResult->fetch_assoc()) 50 50 { 51 $Name = '<a href="'.$this->System->Link('/user .php?user='.$DbUser['ID']).'">'.$DbUser['Name'].'</a>';51 $Name = '<a href="'.$this->System->Link('/user/?user='.$DbUser['ID']).'">'.$DbUser['Name'].'</a>'; 52 52 $Output .= $Name.'<br />'; 53 53 } … … 124 124 // Prepare cookies for permanent login 125 125 $StayLoggedSalt = $this->GetPasswordSalt(); 126 $this->Database->update('UserOnline', ' SessionId="'.$SID.'"', array(126 $this->Database->update('UserOnline', '`SessionId`="'.$SID.'"', array( 127 127 'User' => $User['ID'], 'StayLogged' => $StayLogged, 'StayLoggedHash' => $StayLoggedSalt)); 128 128 if($StayLogged) 129 129 { 130 setcookie('LoginUserId', $User['ID'], time() +365*24*60*60);131 setcookie('LoginHash', sha1($User['ID'].$StayLoggedSalt), time() +365*24*60*60);130 setcookie('LoginUserId', $User['ID'], time() + 365 * 24 * 60 * 60); 131 setcookie('LoginHash', sha1($User['ID'].$StayLoggedSalt), time() + 365 * 24 * 60 * 60); 132 132 } else { 133 133 setcookie('LoginUserId', '', time() - 3600); … … 150 150 if($this->Role != LICENCE_ANONYMOUS) 151 151 { 152 $this->Database->update('UserOnline', ' SessionId="'.$SID.'"', array('User' => null));152 $this->Database->update('UserOnline', '`SessionId`="'.$SID.'"', array('User' => null)); 153 153 $this->Database->query('UPDATE `UserTrace` SET '. 154 154 '`LastLogout` = NOW() WHERE `User` = '.$this->Id);
Note:
See TracChangeset
for help on using the changeset viewer.