close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Redirect after logout to different page depending on user group?

Thread began 3/13/2014 6:49 pm by MagsW | Last modified 3/17/2014 10:41 am by Jason Byrnes | 455 views | 3 replies |

MagsW

Redirect after logout to different page depending on user group?

We have three user groups set up on our system, two of which are actually different companies. I would like to be able to redirect users to a different page (on an external site) depending on the user group they belong to - so for example, Usergroup A (our company) logs out and gets redirected back to our homepage; Usergroup B (external company) logs out and is redirected back to their own company's homepage. Is this possible?

Sign in to reply to this post

Jason ByrnesWebAssist

it would require hand coding to evaluate the user group and set a variable with the log out:

Assuming the user group is stored in a session named UserGroup, you could use cold like this on the logout page before the code block to unset the session variables:

<?php
@session_start();
switch ($_SESSION['UserGroup']) {
case "a":
$redir = "page1.php";
break;
case "b":
$redir = "page2.php";
break;
case "c":
$redir = "page3.php";
break;
default:
$redir = "default.php";
}
?>



and this to do the redirect after the code to unset the sessions:

<?php
header("Location: ".$redir); ?>





http://www.php.net/manual/en/control-structures.switch.php

Sign in to reply to this post

MagsW

Thanks Jason, as it turns out I don't need to do this now, but will bear it in mind in case they change their minds at some point - and your reply may help other users in the meantime.

Sign in to reply to this post

Jason ByrnesWebAssist

You're welcome.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...