redirect to different locations on login
Need to re-ignite this thread as I am having similar issue with my system that requires a different re-direct on login ( or an appropriate location to apply the behaviour ) depending on the value from the table that is used to authenticate the user.
- I have attached a screen shot of the table that is used for this.
- table is named - ‘registered_apps’
- The column I want to use to determine the redirect is the ‘user_level’ column.
- ‘user-level’ has two values - ‘custom’ and ‘standard’
- The two destinations would be - ‘consent-collation.php’ OR ‘../britannia-house/consent-collation.php’
I can’t work out how to construct the ‘restrict access’ behaviours and where to put them, and how to do this along side the MySQLi server behaviours. assuming this is still the best solution.
So I have tried to setup as follows:
case "Britannia Access":
$comparisons[0] = array(TRUE, "".((isset($_SESSION['user_level']))?$_SESSION['user_level']:"") ."", 1, "standard");
break;
The user level session is saved in Login which will either be ‘standard’ or ’custom’.
I’ve then added a “MySQLi / User Authentication / MySQLi restrict access to page” behaviour to the page that login directs to:
<?php
if (WA_Auth_RulePasses("Britannia Access")) {
$RestrictAccess = new WA_MySQLi_Auth();
$RestrictAccess->Action = "restrict";
$RestrictAccess->Name = "LoggedIn";
$RestricAccessRedirect = "../britannia-house/consent-collation.php";
if (function_exists("rel2abs")) $RestricAccessRedirect = $RestricAccessRedirect?rel2abs($RestricAccessRedirect,dirname(__FILE__)):"";
$RestrictAccess->FailRedirect = $RestricAccessRedirect;
$RestrictAccess->execute();
}
?>
So what I thought would happen here is on Login. if the ‘user_level’ session value is ’standard’ then access is passed and it re-directs to the normal ‘consent-collation.php’ page.
But if the ‘user-level’ session value is ‘custom’ then the access fails and it re-directs to the custom page ‘../britannia-house/consent-collation.php’
Another issue I am having is an error with the 'Edit Access Rule' window. The 'Criteria' field sits behind the 'Comparison' Field and can not be accessed. ( see attached )
I am using DW cc 19.1
Thanks in advance.