DMXzone Security Provider PHP Support Product Page

Answered

Conditional redirect

Asked 23 Oct 2014 22:01:59
2
have this question
23 Oct 2014 22:01:59 manuel pinto posted:
Is it possible to Restrict Access Based on User Permissions and redirect the user based on their permission. For example, the admin must be riderected to page1 and the rest of the users to page2?
Ill be glad for any help !

Replies

Replied 24 Oct 2014 09:45:39
24 Oct 2014 09:45:39 Teodor Kuduschiev replied:
Hi Manuel,
The redirect page can be only one.
Replied 24 Nov 2016 06:24:55
24 Nov 2016 06:24:55 Greta Garberini replied:
So the only solution will still be to redirect to ONE page after login and THERE put the user to a further page (no permission). Seems a bit clumsy. I'd like a solution where one logs-in, is checked what access-level a user has and then be redirected to page 1 or page 2. Is this now possible with the conditional server directive?
Replied 24 Nov 2016 08:15:48
24 Nov 2016 08:15:48 Teodor Kuduschiev replied:
Hi Greta,
This can be currently done, but not entirely by using the UI.
You can do this:
1. Create a database query, which is filtered by the logged user ID
2. Repeat (query)
3. In repeat steps add - Set Value, call it: "redirectURL" in both name and global name fields. Assign a value for it, from the filtered query (probably the redirect URL is stored in the query?)
4. Add a standard redirect to some static page, then open code view and replace it with {{redirectURL}}
Replied 11 Oct 2017 14:40:00
11 Oct 2017 14:40:00 steve kirchuk replied:
so the Security Provider is only a partial security provider? Can this be done with the State Management extension?
Replied 06 Nov 2017 12:02:00
06 Nov 2017 12:02:00 Dave Smith replied:
Bit late but may help someone else with a similar issue:
  • Create a Session based on the Group of the user in your Action used for accessing the secure pages
  • Create a new .PHP page with the following code
  • Re-direct on Success to the new .PHP page



<?php @session_start();?>
<?php
if(!session_id()) session_start();
switch($_SESSION['SESSION_NAME']) {

    case "superUser":

        header("Location: indexSU.php");

        break;

    case "teamUser":

        header("Location: indexTM.php");		

        break;		
}
?>


Hope that helps others.


Replied 06 Nov 2017 13:37:11
06 Nov 2017 13:37:11 steve kirchuk replied:
ok thanks ! I also came up with a solution .. by using < instead of = .. so page access for SA being the lowest value users are at 3, admin is 2 and super admin is 1

Reply to this topic