Changeset 626 for trunk/Modules/User
- Timestamp:
- Dec 4, 2013, 9:50:16 PM (11 years ago)
- Location:
- trunk/Modules/User
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/User/User.php
r622 r626 29 29 'Title' => T('Translators'), 30 30 'Hint' => 'Seznam registrovaných uživatelů', 31 'Link' => $this->System->Link('/userlist.php ?action=nofilter'),31 'Link' => $this->System->Link('/userlist.php'), 32 32 'Permission' => LICENCE_ANONYMOUS, 33 33 'Icon' => '', 34 34 ), 0); 35 if(array_key_exists('Search', $this->System->ModuleManager->Modules)) 36 $this->System->ModuleManager->Modules['Search']->RegisterSearch('user', 37 T('Translators'), array('Name'), '`User`', $this->System->Link('/userlist.php?search=')); 35 38 } 36 39 -
trunk/Modules/User/UserList.php
r577 r626 10 10 11 11 $Output = ''; 12 if(array_key_exists('search', $_GET)) 12 if(array_key_exists('search', $_GET)) $_SESSION['search'] = $_GET['search']; 13 else if(!array_key_exists('search', $_SESSION)) $_SESSION['search'] = ''; 14 if(array_key_exists('search', $_GET) and ($_GET['search'] == '')) $_SESSION['search'] = ''; 15 if($_SESSION['search'] != '') 13 16 { 14 $_SESSION['Where'] = ' WHERE `User`.`Name` LIKE "%'.$_GET['search'].'%"'; 15 } 17 $SearchQuery = ' AND (`User`.`Name` LIKE "%'.$_SESSION['search'].'%")'; 18 $Output .= '<div><a href="?search=">'.sprintf(T('Disable filter "%s"'), $_SESSION['search']).'</a></div>'; 19 } else $SearchQuery = ''; 20 21 $TeamFilter = ''; 16 22 if(array_key_exists('team', $_GET)) 17 23 { … … 20 26 { 21 27 $Team = $DbResult->fetch_assoc(); 22 $Output .= '<h3>Seznam uživatelů v týmu '.$Team['Name'].'</h3>'; 23 $_SESSION['Where'] = ' WHERE `Team`='.$_GET['team']; 24 if($_GET['team'] == '') $_SESSION['Where'] = ''; 28 $Output .= '<h3>'.sprintf(T('Users in team %s'), $Team['Name']).'</h3>'; 29 $TeamFilter = ' AND (`Team`='.$_GET['team'].')'; 25 30 } else { 26 $Output .= ShowMessage('Tým '.$_GET['team'].' nenalezen', MESSAGE_CRITICAL); 27 $_SESSION['Where'] = ' WHERE FALSE'; 31 $Output .= ShowMessage('Tým '.$_GET['team'].' nenalezen', MESSAGE_CRITICAL); 28 32 } 29 33 } else 30 34 { 31 $Output .= '<h3>Seznam uživatelů</h3>'; 32 if(!array_key_exists('Where', $_SESSION)) $_SESSION['Where'] = ''; 35 $Output .= '<h3>'.T('User list').'</h3>'; 33 36 } 34 37 35 if(array_key_exists('action', $_GET)) 36 { 37 if($_GET['action'] == 'nofilter') $_SESSION['Where'] = ''; 38 } 39 //if($_SESSION['Where'] <> '') $Output .= ' <a href="?action=nofilter">Zrušit filtr uživatelů</a><br />'; 40 41 $DbResult = $this->Database->query('SELECT COUNT(*) FROM `User`'.$_SESSION['Where']); 38 $DbResult = $this->Database->query('SELECT COUNT(*) FROM `User` WHERE 1'.$SearchQuery.$TeamFilter); 42 39 $DbRow = $DbResult->fetch_row(); 43 40 $PageList = GetPageList($DbRow[0]); … … 56 53 ); 57 54 $Order = GetOrderTableHeader($TableColumns, 'TranslatedCount', 1); 58 $Output .= $Order['Output']; 59 55 $Output .= $Order['Output']; 60 56 61 57 $Query = 'SELECT `User`.`ID`, `User`.`Name`, `LastLogin`, `GM`, `XP`, `TranslatedCount`, `RegistrationTime` '. 62 58 'FROM `User` '. 63 59 'LEFT JOIN `UserTrace` ON `UserTrace`.`User` = `User`.`Id` '. 64 $_SESSION['Where'].$Order['SQL'].$PageList['SQLLimit'];60 'WHERE 1'.$SearchQuery.$TeamFilter.$Order['SQL'].$PageList['SQLLimit']; 65 61 66 62 $DbResult = $this->Database->query($Query);
Note:
See TracChangeset
for help on using the changeset viewer.