fix login redirect
This commit is contained in:
@@ -10,13 +10,18 @@ error_reporting(E_ALL | E_STRICT);
|
|||||||
include(__DIR__ . '/../../../extra/auth.php');
|
include(__DIR__ . '/../../../extra/auth.php');
|
||||||
//require_once __DIR__ . '/extra/auth.php';
|
//require_once __DIR__ . '/extra/auth.php';
|
||||||
|
|
||||||
// Here we just check if user is not
|
// Here we just check if user is not
|
||||||
// logged in, and in that case we redirect
|
// logged in, and in that case we redirect
|
||||||
// the user to vanguard login page.
|
// the user to vanguard login page.
|
||||||
|
|
||||||
if (! Auth::check()) {
|
if (! Auth::check()) {
|
||||||
|
// Cut everything at /userarea/ and append /login.
|
||||||
redirectTo('../../public/login');
|
$scriptName = $_SERVER['SCRIPT_NAME'] ?? '';
|
||||||
|
$basePath = substr($scriptName, 0, strpos($scriptName, '/userarea/'));
|
||||||
|
if ($basePath === false || $basePath === '') {
|
||||||
|
$basePath = '';
|
||||||
|
}
|
||||||
|
redirectTo($basePath . '/login');
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = Auth::user();
|
$user = Auth::user();
|
||||||
@@ -58,4 +63,4 @@ require_once(__DIR__ . '/../../languages/en/general.php');
|
|||||||
|
|
||||||
//include("generalsettings.php");
|
//include("generalsettings.php");
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
Reference in New Issue
Block a user