Changeset 880 for trunk/Modules/User
- Timestamp:
- Apr 7, 2020, 10:15:48 PM (5 years ago)
- Location:
- trunk/Modules/User
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/User/Options.php
r861 r880 17 17 '<option value="0">'.T('Nowhere').'</option>'. 18 18 '<option value="1"'; 19 if ($this->System->User->Redirecting == '1') $Output .= ' selected="selected"';19 if ($this->System->User->Redirecting == '1') $Output .= ' selected="selected"'; 20 20 $Output .= '>'.T('To untranslated').'</option>'; 21 21 $Output .= '<option value="2"'; 22 if ($this->System->User->Redirecting == '2') $Output .= ' selected="selected"';22 if ($this->System->User->Redirecting == '2') $Output .= ' selected="selected"'; 23 23 $Output .= '>'.T('To next translation').'</option>'; 24 24 $Output .= '<option value="3"'; 25 if ($this->System->User->Redirecting == '3') $Output .= ' selected="selected"';25 if ($this->System->User->Redirecting == '3') $Output .= ' selected="selected"'; 26 26 $Output .= '>'.T('To previous translation').'</option>'; 27 27 $Output .= '</select>'; … … 60 60 '<input type="hidden" name="action" value="gointeam"/>'. 61 61 '<select name="id">'; 62 while ($LineTeam = $DbResult->fetch_assoc())62 while ($LineTeam = $DbResult->fetch_assoc()) 63 63 { 64 64 $Output .= '<option value="'.$LineTeam['Id'].'"'; … … 69 69 </form>'; 70 70 $Output .= '</fieldset>'; 71 return ($Output);71 return $Output; 72 72 } 73 73 … … 75 75 { 76 76 $Output = ''; 77 if (array_key_exists('Email', $_POST))77 if (array_key_exists('Email', $_POST)) 78 78 { 79 79 $Email = $_POST['Email']; … … 84 84 $Redirecting = $_POST['redirecting']; 85 85 $PreferredVersion = $_POST['ClientVersion']; 86 if ($PreferredVersion == '') $PreferredVersion = null;86 if ($PreferredVersion == '') $PreferredVersion = null; 87 87 $Info = $_POST['info']; 88 88 89 89 // Do user want to change password? 90 if (($OldPass != '') or ($NewPass != '') or ($NewPass2 != ''))90 if (($OldPass != '') or ($NewPass != '') or ($NewPass2 != '')) 91 91 { 92 if ($NewPass == $NewPass2)92 if ($NewPass == $NewPass2) 93 93 { 94 94 $DbResult = $this->System->Database->query('SELECT `Pass`, '.$this->System->User->CryptPasswordSQL('"'.$OldPass.'"', '`Salt`').' AS `Hash` FROM `User` WHERE `ID`= '.$this->System->User->Id); 95 95 $DbRow = $DbResult->fetch_assoc(); 96 if ($DbRow['Hash'] == $DbRow['Pass'])96 if ($DbRow['Hash'] == $DbRow['Pass']) 97 97 { 98 98 // Update password … … 130 130 $this->System->User->Load(); 131 131 } else $Output .= ShowMessage('Nezadány údaje.', MESSAGE_CRITICAL); 132 return ($Output);132 return $Output; 133 133 } 134 134 … … 137 137 $this->Title = T('User settings'); 138 138 $Output = ''; 139 if ($this->System->User->Licence(LICENCE_USER))139 if ($this->System->User->Licence(LICENCE_USER)) 140 140 { 141 if (array_key_exists('action', $_GET) and ($_GET['action'] == 'save'))141 if (array_key_exists('action', $_GET) and ($_GET['action'] == 'save')) 142 142 { 143 143 $Output .= $this->UserOptionsSave(); … … 145 145 $Output .= $this->UserOptionsFrom(); 146 146 } else $Output .= ShowMessage('Nejste přihlášený.', MESSAGE_CRITICAL); 147 return ($Output);147 return $Output; 148 148 } 149 149 } -
trunk/Modules/User/Profile.php
r861 r880 6 6 { 7 7 $Output = ''; 8 if (array_key_exists('text', $_POST))9 if ($this->System->User->Licence(LICENCE_ADMIN))8 if (array_key_exists('text', $_POST)) 9 if ($this->System->User->Licence(LICENCE_ADMIN)) 10 10 { 11 11 $Text = $_POST['text']; … … 16 16 'Text: <strong>'.$Text.'</strong><br />'; 17 17 18 if (@mail($Email, $Subject, $Text, 'From: '.$this->System->Config['Web']['AdminEmail'].18 if (@mail($Email, $Subject, $Text, 'From: '.$this->System->Config['Web']['AdminEmail']. 19 19 '\nReply-To: '.$this->System->Config['Web']['AdminEmail'].'\nX-Mailer: PHP/')) 20 20 { … … 23 23 else $Output .= ShowMessage('Nepodařilo se odesat E-mail.', MESSAGE_CRITICAL); 24 24 } else $Output .= ShowMessage(T('Access denied'), MESSAGE_CRITICAL); 25 return ($Output);25 return $Output; 26 26 } 27 27 … … 57 57 '(SELECT COUNT(*) FROM `ExportUser` WHERE `ExportUser`.`Export`=`Export`.`Id`) AS `UserCount` FROM `Export` '. 58 58 'LEFT JOIN `User` ON `User`.`ID`=`Export`.`User` '.$Filter.$Order['SQL'].$PageList['SQLLimit']); 59 while ($Export = $DbResult->fetch_assoc())59 while ($Export = $DbResult->fetch_assoc()) 60 60 { 61 61 $Action = '<a href="'.$this->System->Link('/export/?Action=View&ExportId='.$Export['Id'].'&Tab=0').'">'.T('Show').'</a> '. 62 62 '<a href="'.$this->System->Link('/export/?Action=View&ExportId='.$Export['Id'].'&Tab=7').'">'.T('Export').'</a>'; 63 if ($Export['User'] == $this->System->User->Id) $Action .= ' <a href="?Action=Delete&ExportId='.$Export['Id'].'" onclick="return confirmAction(\''.T('Really remove item?').'\');">'.T('Remove').'</a>';64 if ($this->System->User->Id != null) $Action .= ' <a href="'.$this->System->Link('/export/?Action=Clone&ExportId='.$Export['Id']).'" onclick="return confirmAction(\''.T('Really clone item?').'\');">'.T('Clone').'</a>';63 if ($Export['User'] == $this->System->User->Id) $Action .= ' <a href="?Action=Delete&ExportId='.$Export['Id'].'" onclick="return confirmAction(\''.T('Really remove item?').'\');">'.T('Remove').'</a>'; 64 if ($this->System->User->Id != null) $Action .= ' <a href="'.$this->System->Link('/export/?Action=Clone&ExportId='.$Export['Id']).'" onclick="return confirmAction(\''.T('Really clone item?').'\');">'.T('Clone').'</a>'; 65 65 $Output .= '<tr><td>'.HumanDate($Export['TimeCreate']).'</td>'. 66 66 '<td>'.htmlspecialchars($Export['Title']).'</td>'. … … 74 74 75 75 $Output .= '<div style="text-align: center;"><a href="'.$this->System->Link('/export/').'">'.T('Export page').'</a></div>'; 76 return ($Output);76 return $Output; 77 77 } 78 78 … … 86 86 $UnionItems = array(); 87 87 $DbResult = $this->Database->query($GroupListQuery); 88 if ($DbResult->num_rows > 0)89 { 90 while ($DbRow = $DbResult->fetch_assoc())88 if ($DbResult->num_rows > 0) 89 { 90 while ($DbRow = $DbResult->fetch_assoc()) 91 91 { 92 92 $UnionItems[] = 'SELECT `T`.`ID`, `T`.`Take`, `T`.`User`, `T`.`ModifyTime`, `T`.`Group`, `T`.`GroupName` '. … … 106 106 $Output .= '<table class="BaseTable"><tr>'. 107 107 '<th>'.T('Date').'</th><th>'.T('New').'</th><th>'.T('Source').'</th><th>'.T('Group').'</th></tr>'; 108 while ($DbRow = $DbResult->fetch_assoc())108 while ($DbRow = $DbResult->fetch_assoc()) 109 109 { 110 110 $Output .= '<tr><td>'.HumanDate($DbRow['ModifyTime']).'</td>'. … … 115 115 $Output .= '</table>'; 116 116 } 117 return ($Output);117 return $Output; 118 118 } 119 119 … … 130 130 'JOIN `ForumThread` ON `ForumThread`.`ID` = `ForumText`.`Thread` '. 131 131 'WHERE `ForumText`.`User` = '.($_GET['user'] * 1).' ORDER BY `ForumText`.`Date` DESC LIMIT '.$Count); 132 while ($Line = $DbResult->fetch_assoc())132 while ($Line = $DbResult->fetch_assoc()) 133 133 $Output .= '<div><a href="'.$this->System->Link('/forum/?Thread='.$Line['Thread']).'">'.htmlspecialchars($Line['ThreadName']).'</a><br />'. 134 134 '<strong>'.$Line['UserName'].'</strong> ('.HumanDate($Line['Date']).'): '.$parser->qparse(htmlspecialchars($Line['Text'])).'</div> '; 135 135 $Output .= '</div>'; 136 return ($Output);136 return $Output; 137 137 } 138 138 … … 151 151 'WHERE `User`.`Id` = '.($_GET['user'] * 1); 152 152 $DbResult = $this->Database->query($Query); 153 if ($DbResult->num_rows > 0)153 if ($DbResult->num_rows > 0) 154 154 { 155 155 $UserLine = $DbResult->fetch_array(); … … 163 163 T('Number of translated:').' <a href="'.$this->System->Link('/TranslationList.php?user='.$UserLine['ID'].'&state=2&group=0').'" title="Zobrazit Všechny jeho přeložené texty"><strong>'.$UserLine['TranslatedCount'].'</strong></a><br />'. 164 164 T('Level:').' <strong>'.$XP['Level'].'</strong> '.T('experience:').' '.ProgressBar(150, round($XP['XP'] / $XP['MaxXP'] * 100, 2), $XP['XP'].' / '.$XP['MaxXP']).'<br/>'; 165 if ($this->System->ModuleManager->ModuleRunning('Team') and ($UserLine['TeamName'] != ''))165 if ($this->System->ModuleManager->ModuleRunning('Team') and ($UserLine['TeamName'] != '')) 166 166 $Output .= T('Member of team:').' <a href="'.$this->System->Link('/team/?action=team&id='.$UserLine['Team']).'"><strong>'.htmlspecialchars($UserLine['TeamName']).'</strong></a><br />'; 167 167 … … 187 187 '</tr></table>'; 188 188 $Output .= '<br />'.$this->ShowLastForum().'<br />'; 189 if ($this->System->User->Licence(LICENCE_MODERATOR))189 if ($this->System->User->Licence(LICENCE_MODERATOR)) 190 190 { 191 191 $Output .= '<fieldset><legend>Moderování</legend>'; … … 243 243 } 244 244 } else $Output .= ShowMessage('Uživatel nenalezen', MESSAGE_CRITICAL); 245 return ($Output);245 return $Output; 246 246 } 247 247 … … 250 250 $this->Title = T('User profile'); 251 251 $Output = $this->SendMail(); 252 if (array_key_exists('user', $_GET))252 if (array_key_exists('user', $_GET)) 253 253 { 254 254 $Output .= $this->ShowProfile(); 255 255 } else $Output .= ShowMessage('Nevybrán uživatel', MESSAGE_CRITICAL); 256 return ($Output);256 return $Output; 257 257 } 258 258 } -
trunk/Modules/User/Registration.php
r861 r880 5 5 function ShowForm() 6 6 { 7 if (array_key_exists('sc', $_POST)) $Human = true;7 if (array_key_exists('sc', $_POST)) $Human = true; 8 8 else $Human = false; 9 if (array_key_exists('user', $_POST)) $UserName = $_POST['user'];9 if (array_key_exists('user', $_POST)) $UserName = $_POST['user']; 10 10 else $UserName = ''; 11 if (array_key_exists('Email', $_POST)) $Email = $_POST['Email'];11 if (array_key_exists('Email', $_POST)) $Email = $_POST['Email']; 12 12 else $Email = ''; 13 if (array_key_exists('Team', $_POST)) $Team = $_POST['Team'];13 if (array_key_exists('Team', $_POST)) $Team = $_POST['Team']; 14 14 else $Team = ''; 15 if (array_key_exists('Language', $_POST)) $Language = $_POST['Language'];15 if (array_key_exists('Language', $_POST)) $Language = $_POST['Language']; 16 16 else $Language = 1; 17 17 … … 24 24 <tr> 25 25 <th class="Left">'.T('Are you human?').'</th>'; 26 if ($Human) $Checked = ' checked="checked"';26 if ($Human) $Checked = ' checked="checked"'; 27 27 else $Checked = ''; 28 28 $Output .= '<td><input type="checkbox" name="sc" '.$Checked.'/></td> … … 50 50 <tr> 51 51 <th class="Left">'.T('I belong to team').':</th>'; 52 if ($Team == '') $Selected = ' selected="selected"';52 if ($Team == '') $Selected = ' selected="selected"'; 53 53 else $Selected = ''; 54 54 $Output .= '<td><select name="Team"><option value="0"'.$Selected.'>'.T('none').'</option>'; 55 55 $DbResult = $this->Database->query('SELECT `Name`, `Id` FROM `Team`'); 56 while ($Line = $DbResult->fetch_assoc())56 while ($Line = $DbResult->fetch_assoc()) 57 57 { 58 if ($Team == $Line['Id']) $Selected = ' selected="selected"';58 if ($Team == $Line['Id']) $Selected = ' selected="selected"'; 59 59 else $Selected = ''; 60 60 $Output .= '<option value="0'.$Line['Id'].'"'.$Selected.'>'.htmlspecialchars($Line['Name']).'</option>'; … … 81 81 </tr> 82 82 </table></fieldset></form>'; 83 return ($Output);83 return $Output; 84 84 } 85 85 … … 91 91 $ShowForm = true; 92 92 93 if (array_key_exists('user', $_POST)) $UserName = $_POST['user'];93 if (array_key_exists('user', $_POST)) $UserName = $_POST['user']; 94 94 else $UserName = ''; 95 if (array_key_exists('pass', $_POST)) $Pass = $_POST['pass'];95 if (array_key_exists('pass', $_POST)) $Pass = $_POST['pass']; 96 96 else $Pass = ''; 97 if (array_key_exists('pass2', $_POST)) $Pass2 = $_POST['pass2'];97 if (array_key_exists('pass2', $_POST)) $Pass2 = $_POST['pass2']; 98 98 else $Pass2 = ''; 99 if (array_key_exists('Email', $_POST)) $Email = $_POST['Email'];99 if (array_key_exists('Email', $_POST)) $Email = $_POST['Email']; 100 100 else $Email = ''; 101 if (array_key_exists('Team', $_POST)) $Team = $_POST['Team'] * 1;101 if (array_key_exists('Team', $_POST)) $Team = $_POST['Team'] * 1; 102 102 else $Team = ''; 103 if (array_key_exists('Language', $_POST)) $Language = $_POST['Language'] * 1;103 if (array_key_exists('Language', $_POST)) $Language = $_POST['Language'] * 1; 104 104 else $Language = ''; 105 if (array_key_exists('ClientVersion', $_POST)) $PreferredVersion = $_POST['ClientVersion'] * 1;105 if (array_key_exists('ClientVersion', $_POST)) $PreferredVersion = $_POST['ClientVersion'] * 1; 106 106 else $PreferredVersion = ''; 107 if ($PreferredVersion == '') $PreferredVersion = 'NULL';108 if (array_key_exists('sc', $_POST)) $SpamCheck = $_POST['sc'];107 if ($PreferredVersion == '') $PreferredVersion = 'NULL'; 108 if (array_key_exists('sc', $_POST)) $SpamCheck = $_POST['sc']; 109 109 else $SpamCheck = ''; 110 110 111 if ($SpamCheck != '')111 if ($SpamCheck != '') 112 112 { 113 if (($UserName != '') and ($Pass != '') and ($Pass2 != ''))113 if (($UserName != '') and ($Pass != '') and ($Pass2 != '')) 114 114 { 115 if (!in_array(strtolower($UserName), $Config['ForbiddedUserNames']))115 if (!in_array(strtolower($UserName), $Config['ForbiddedUserNames'])) 116 116 { 117 if ($Pass == $Pass2)117 if ($Pass == $Pass2) 118 118 { 119 119 $DbResult = $this->Database->query('SELECT * FROM `User` WHERE LOWER(`Name`) = LOWER("'.$UserName.'")'); 120 120 $Line = $DbResult->fetch_row(); 121 if (!$Line)121 if (!$Line) 122 122 { 123 if ($Team == 0) $Team = 'NULL';123 if ($Team == 0) $Team = 'NULL'; 124 124 $this->System->User->Register($UserName, $Pass, $Email, $Language, $Team, $PreferredVersion); 125 125 $Output .= ShowMessage(T('Registration was successful')); … … 154 154 } else $Output = ShowMessage('Nejsi člověk. Strojům není dovoleno se registrovat.', MESSAGE_CRITICAL); 155 155 156 if ($ShowForm) $Output .= $this->ShowForm();157 return ($Output);156 if ($ShowForm) $Output .= $this->ShowForm(); 157 return $Output; 158 158 } 159 159 … … 162 162 $this->Title = T('User registration'); 163 163 $Output = ''; 164 if (array_key_exists('user', $_POST))164 if (array_key_exists('user', $_POST)) 165 165 { 166 166 $Output .= $this->CheckRegistration(); 167 167 } else $Output .= $this->ShowForm(); 168 return ($Output);168 return $Output; 169 169 } 170 170 } -
trunk/Modules/User/User.php
r871 r880 34 34 'Icon' => '', 35 35 ), 0); 36 if (array_key_exists('Search', $this->System->ModuleManager->Modules))36 if (array_key_exists('Search', $this->System->ModuleManager->Modules)) 37 37 $this->System->ModuleManager->Modules['Search']->RegisterSearch('user', 38 38 T('Translators'), array('Name'), '`User`', $this->System->Link('/users/?search=')); … … 49 49 'WHERE (`ActivityTime` >= NOW() - 300) '. 50 50 'ORDER BY `ActivityTime` DESC ) AS `T` GROUP BY `Name`'); 51 while ($DbUser = $DbResult->fetch_assoc())51 while ($DbUser = $DbResult->fetch_assoc()) 52 52 { 53 53 $Name = '<a href="'.$this->System->Link('/user/?user='.$DbUser['ID']).'">'.$DbUser['Name'].'</a>'; 54 54 $Output .= $Name.'<br />'; 55 55 } 56 return ($Output);56 return $Output; 57 57 } 58 58 … … 60 60 { 61 61 $Output = ''; 62 if ($this->System->User->Licence(LICENCE_USER))62 if ($this->System->User->Licence(LICENCE_USER)) 63 63 { 64 64 //$DbResult =$this->Database->query('SELECT `Id`, `Name` FROM `Team` WHERE `Id`='.$this->System->User->Team); … … 79 79 '<a href="'.$this->System->Link('/registration/').'">'.T('Registration').'</a>'; 80 80 } 81 return ($Output);81 return $Output; 82 82 } 83 83 } … … 104 104 </table> 105 105 </fieldset></form>'; 106 return ($Output);106 return $Output; 107 107 } 108 108 } … … 132 132 $this->Database = &$System->Database; 133 133 $this->OnlineStateTimeout = 600; // in seconds 134 if (isset($_SESSION)) $this->Check();134 if (isset($_SESSION)) $this->Check(); 135 135 } 136 136 … … 144 144 $DbResult = $this->Database->query('SELECT `ID` FROM `User` WHERE '. 145 145 'LOWER(`Name`) = LOWER("'.$Name.'") AND `Pass` = '.$this->CryptPasswordSQL('"'.$Password.'"', '`Salt`')); 146 if ($DbResult->num_rows > 0)146 if ($DbResult->num_rows > 0) 147 147 { 148 148 $User = $DbResult->fetch_assoc(); … … 151 151 // Prepare cookies for permanent login 152 152 $StayLoggedSalt = $this->GetPasswordSalt(); 153 if ($StayLogged == true) $StayLoggedValue = 1; else $StayLoggedValue = 0;153 if ($StayLogged == true) $StayLoggedValue = 1; else $StayLoggedValue = 0; 154 154 $this->Database->update('UserOnline', '`SessionId`="'.$SID.'"', array( 155 155 'User' => $User['ID'], 'StayLogged' => $StayLoggedValue, 'StayLoggedHash' => $StayLoggedSalt)); 156 if ($StayLogged)156 if ($StayLogged) 157 157 { 158 158 setcookie('LoginUserId', $User['ID'], time() + 365 * 24 * 60 * 60); … … 176 176 { 177 177 $SID = session_id(); 178 if ($this->Role != LICENCE_ANONYMOUS)178 if ($this->Role != LICENCE_ANONYMOUS) 179 179 { 180 180 $this->Database->update('UserOnline', '`SessionId`="'.$SID.'"', array('User' => null)); … … 192 192 'LEFT JOIN `ClientVersion` ON `ClientVersion`.`Id` = `User`.`PreferredVersion` '. 193 193 'WHERE `User`.`ID` = '.$this->Id); 194 if ($DbResult->num_rows > 0)194 if ($DbResult->num_rows > 0) 195 195 { 196 196 $User = $DbResult->fetch_assoc(); … … 222 222 function Licence($Licence) 223 223 { 224 if (GetRemoteAddress() == '') return(true); // Execution from command line225 else return ($this->Role >= $Licence);224 if (GetRemoteAddress() == '') return true; // Execution from command line 225 else return $this->Role >= $Licence; 226 226 } 227 227 … … 229 229 { 230 230 $DbResult = $this->Database->select('APIToken', 'User', '`Token`="'.$Token.'"'); 231 if ($DbResult->num_rows > 0)231 if ($DbResult->num_rows > 0) 232 232 { 233 233 $DbRow = $DbResult->fetch_assoc(); 234 234 $DbResult2 = $this->Database->select('User', 'GM', '`ID`="'.$DbRow['User'].'"'); 235 235 $DbRow2 = $DbResult2->fetch_assoc(); 236 return ($DbRow2['GM'] >= $Licence);237 } else return (false);236 return $DbRow2['GM'] >= $Licence; 237 } else return false; 238 238 } 239 239 240 240 function GetPasswordSalt() 241 241 { 242 return (substr(sha1(mt_rand()), 0, 8));242 return substr(sha1(mt_rand()), 0, 8); 243 243 } 244 244 245 245 function CryptPasswordSQL($Password, $Salt) 246 246 { 247 return ('SHA1(CONCAT(SHA1('.$Password.'), '.$Salt.'))');247 return 'SHA1(CONCAT(SHA1('.$Password.'), '.$Salt.'))'; 248 248 } 249 249 … … 253 253 // Lookup user record 254 254 $Query = $this->Database->select('UserOnline', '*', 'SessionId="'.$SID.'"'); 255 if ($Query->num_rows > 0)255 if ($Query->num_rows > 0) 256 256 { 257 257 // Refresh time of last access 258 258 $this->Database->update('UserOnline', 'SessionId="'.$SID.'"', array('ActivityTime' => 'NOW()')); 259 259 } else { 260 if (GetRemoteAddress() != '') $HostName = gethostbyaddr(GetRemoteAddress());260 if (GetRemoteAddress() != '') $HostName = gethostbyaddr(GetRemoteAddress()); 261 261 else $HostName = ''; 262 262 $this->Database->insert('UserOnline', array('SessionId' => $SID, … … 267 267 268 268 // Logged permanently? 269 if (array_key_exists('LoginHash', $_COOKIE))269 if (array_key_exists('LoginHash', $_COOKIE)) 270 270 { 271 271 $DbResult = $this->Database->query('SELECT * FROM `UserOnline` WHERE `User`='.$_COOKIE['LoginUserId']. 272 272 ' AND `StayLogged`=1 AND SessionId!="'.$SID.'"'); 273 if ($DbResult->num_rows > 0)273 if ($DbResult->num_rows > 0) 274 274 { 275 275 $DbRow = $DbResult->fetch_assoc(); 276 if (sha1($_COOKIE['LoginUserId'].$DbRow['StayLoggedHash']) == $_COOKIE['LoginHash'])276 if (sha1($_COOKIE['LoginUserId'].$DbRow['StayLoggedHash']) == $_COOKIE['LoginHash']) 277 277 { 278 278 $this->Database->query('DELETE FROM `UserOnline` WHERE `SessionId`="'.$SID.'"'); … … 285 285 $Query = $this->Database->select('UserOnline', '*', '`SessionId`="'.$SID.'"'); 286 286 $Row = $Query->fetch_assoc(); 287 if ($Row['User'] != '')287 if ($Row['User'] != '') 288 288 { 289 289 $this->Id = $Row['User']; … … 296 296 // Remove nonactive users 297 297 $DbResult = $this->Database->select('UserOnline', '`Id`, `User`', '(`ActivityTime` < DATE_SUB(NOW(), INTERVAL '.$this->OnlineStateTimeout.' SECOND)) AND (`StayLogged` = 0)'); 298 while ($DbRow = $DbResult->fetch_array())298 while ($DbRow = $DbResult->fetch_array()) 299 299 { 300 300 $this->Database->delete('UserOnline', 'Id='.$DbRow['Id']); … … 305 305 { 306 306 $Salt = $this->GetPasswordSalt(); 307 if ($Team == null) $Team = 'NULL';308 if ($PreferredVersion == null) $PreferredVersion = 'NULL';307 if ($Team == null) $Team = 'NULL'; 308 if ($PreferredVersion == null) $PreferredVersion = 'NULL'; 309 309 $this->Database->query('INSERT INTO `User` '. 310 310 '(`Name` , `Pass` , `Salt`, `Email` , `Language` , `Team` , `NeedUpdate`, `RegistrationTime`, `PreferredVersion` ) '. -
trunk/Modules/User/UserList.php
r851 r880 7 7 $this->Title = T('Translators'); 8 8 $Output = ''; 9 if (array_key_exists('search', $_GET)) $_SESSION['search'] = $_GET['search'];10 else if (!array_key_exists('search', $_SESSION)) $_SESSION['search'] = '';11 if (array_key_exists('search', $_GET) and ($_GET['search'] == '')) $_SESSION['search'] = '';12 if ($_SESSION['search'] != '')9 if (array_key_exists('search', $_GET)) $_SESSION['search'] = $_GET['search']; 10 else if (!array_key_exists('search', $_SESSION)) $_SESSION['search'] = ''; 11 if (array_key_exists('search', $_GET) and ($_GET['search'] == '')) $_SESSION['search'] = ''; 12 if ($_SESSION['search'] != '') 13 13 { 14 14 $SearchQuery = ' AND (`User`.`Name` LIKE "%'.$_SESSION['search'].'%")'; … … 17 17 18 18 $TeamFilter = ''; 19 if (array_key_exists('team', $_GET))19 if (array_key_exists('team', $_GET)) 20 20 { 21 21 $TeamId = $_GET['team'] * 1; 22 22 $DbResult = $this->Database->select('Team', 'Name', '`Id`='.$TeamId); 23 if ($DbResult->num_rows > 0)23 if ($DbResult->num_rows > 0) 24 24 { 25 25 $Team = $DbResult->fetch_assoc(); … … 58 58 59 59 $DbResult = $this->Database->query($Query); 60 while ($Line = $DbResult->fetch_assoc())60 while ($Line = $DbResult->fetch_assoc()) 61 61 { 62 62 $XP = GetLevelMinMax($Line['XP']); … … 71 71 $PageList['Output']; 72 72 73 return ($Output);73 return $Output; 74 74 } 75 75 }
Note:
See TracChangeset
for help on using the changeset viewer.