Redirect after signOut
Posted: 2019-12-07 01:40
Using the global hooks file, we can redirect after signIn just by returning a URL.
Is there a way to redirect after signOut?
Is there a way to redirect after signOut?
A place where AppGini users can exchange ideas and help each other.
https://forums.appgini.com:443/phpbb/
https://forums.appgini.com:443/phpbb/viewtopic.php?f=7&t=3350
Code: Select all
if(isset($_GET['signOut']))
Code: Select all
<?php
$currDir = dirname(__FILE__);
define('HOMEPAGE', true);
include("{$currDir}/defaultLang.php");
include("{$currDir}/language.php");
include("{$currDir}/lib.php");
$x = new DataList;
$x->TableTitle = $Translation['homepage'];
// according to provided GET parameters, either log out, show login form (possibly with a failed login message), or show homepage
if(isset($_GET['signOut'])) {
include("{$currDir}/hooks/loguserout.php");
logOutUser();
redirect("index.php?signIn=1");
} elseif(isset($_GET['loginFailed']) || isset($_GET['signIn'])) {
if(isset($_GET['loginFailed'])) @header('HTTP/1.0 403 Forbidden');
include("{$currDir}/login.php");
} else {
include("{$currDir}/home.php");
}