From b938db9e5d7ccf5a9176fe9dbf2d1e35ecd449f1 Mon Sep 17 00:00:00 2001 From: Ibnu Maksum Date: Tue, 27 Feb 2024 10:37:41 +0700 Subject: [PATCH] redirect after login --- system/controllers/admin.php | 4 ++++ system/controllers/default.php | 9 +++++++-- system/controllers/login.php | 4 ++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/system/controllers/admin.php b/system/controllers/admin.php index 76338042..76bd7400 100644 --- a/system/controllers/admin.php +++ b/system/controllers/admin.php @@ -5,6 +5,10 @@ * by https://t.me/ibnux **/ +if(Admin::getID()){ + r2(U.'dashboard'); +} + if (isset($routes['1'])) { $do = $routes['1']; } else { diff --git a/system/controllers/default.php b/system/controllers/default.php index 0694c7a6..d32f8ce4 100644 --- a/system/controllers/default.php +++ b/system/controllers/default.php @@ -4,5 +4,10 @@ * by https://t.me/ibnux **/ - -r2(APP_URL.'/index.php?_route=dashboard'); +if(Admin::getID()){ + r2(U.'dashboard'); +}if(User::getID()){ + r2(U.'home'); +}else{ + r2(U.'login'); +} diff --git a/system/controllers/login.php b/system/controllers/login.php index 6148591c..15b5eaf0 100644 --- a/system/controllers/login.php +++ b/system/controllers/login.php @@ -5,6 +5,10 @@ * by https://t.me/ibnux **/ +if(User::getID()){ + r2(U.'home'); +} + if (isset($routes['1'])) { $do = $routes['1']; } else {