getConnection(); ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL | E_STRICT); // This should be equal to: PATH_TO_VANGUARD_FOLDER/extra/auth.php include(__DIR__ . '/../../../extra/auth.php'); //require_once __DIR__ . '/extra/auth.php'; // Here we just check if user is not // logged in, and in that case we redirect // the user to vanguard login page. if (! Auth::check()) { // Cut everything at /userarea/ and append /login. $scriptName = $_SERVER['SCRIPT_NAME'] ?? ''; $basePath = substr($scriptName, 0, strpos($scriptName, '/userarea/')); if ($basePath === false || $basePath === '') { $basePath = ''; } redirectTo($basePath . '/login'); } $user = Auth::user(); $iduserlogin = $user->present()->id; $nameuser = $user->present()->first_name; $surnameuser = $user->present()->last_name; $emailuser = $user->present()->email; $avatar = $user->present()->avatar; $kindofrole = $user->present()->role_id; //$user = "1"; //$iduserlogin="1"; //$nameuser="Claudio"; //$emailuser="info@claudiosironi.com"; ?>