aboutsummaryrefslogtreecommitdiffstats
path: root/core/include/user/list.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/include/user/list.php')
-rw-r--r--core/include/user/list.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/core/include/user/list.php b/core/include/user/list.php
index 6009164..4ce9fc8 100644
--- a/core/include/user/list.php
+++ b/core/include/user/list.php
@@ -11,7 +11,8 @@ $Language = Application::getLanguage();
$site_size = Application::get('USER.LIST_SIZE');
$site_sort = Application::get('USER.LIST_SORT');
-$lastSite = ceil($Database->query(sprintf('SELECT COUNT(id) FROM %s', User\Attribute::TABLE))->fetchColumn() / $site_size);
+$count = $Database->query(sprintf('SELECT COUNT(id) FROM %s', User\Attribute::TABLE))->fetchColumn();
+$lastSite = ceil($count / $site_size);
$currentSite = HTTP::GET('site') ?? 1;
$currentSite = intval($currentSite);
@@ -21,6 +22,15 @@ if($currentSite < 1 OR ($currentSite > $lastSite AND $lastSite > 0)) {
}
#===============================================================================
+# Single redirect
+#===============================================================================
+if(Application::get('USER.SINGLE_REDIRECT') === TRUE AND $count === '1') {
+ $Statement = $Database->query(sprintf('SELECT id FROM %s LIMIT 1', User\Attribute::TABLE));
+ $User = User\Factory::build($Statement->fetchColumn());
+ HTTP::redirect($User->getURL());
+}
+
+#===============================================================================
# TRY: Template\Exception
#===============================================================================
try {