Просмотр исходного кода

Detect correct landing point depending on package settings

Kristan Kenney 5 лет назад
Родитель
Сommit
1f3692e158
1 измененных файлов с 15 добавлено и 1 удалено
  1. 15 1
      web/login/index.php

+ 15 - 1
web/login/index.php

@@ -153,7 +153,21 @@ function authenticate_user($user, $password, $twofa = ''){
                     if ($_SESSION['userContext'] === 'admin') {
                         header("Location: /list/user/");
                     } else {
-                        header("Location: /list/web/");
+                        if($data[$user]['WEB_DOMAINS'] != "0") {
+                            header("Location: /list/web/");
+                        } else if ($data[$user]['DNS_DOMAINS'] != "0") {
+                            header("Location: /list/dns/");
+                        } else if ($data[$user]['MAIL_DOMAINS'] != "0") {
+                            header("Location: /list/mail/");
+                        } else if ($data[$user]['DATABASES'] != "0") {
+                            header("Location: /list/db/");
+                        } else if ($data[$user]['CRON_JOBS'] != "0") {
+                            header("Location: /list/cron/");
+                        } else if ($data[$user]['BACKUPS'] != "0") {
+                            header("Location: /list/backup/");
+                        } else {
+                            header("Location: /list/web/");
+                        }
                     }
                     exit;
                 }