I would like to add a button to the default login success page that returns a user to their proper login home page.
I added the following,
"<button type="submit" id="wlpeLoginButton" name="service" value="login">Return to Member Only Content</button>"
But I get the login success page with an extra line saying, "You have left some required form fields blank." That makes sense, I suppose.
I’m trying to have the button return them to the page that they would typically go to when they initially log in. Basically, the page is used by two user groups that have access to different content, and I’d like them to have the ability to go back to the content they’re authorized to see from that page.
I also tried adding to the service case statement a new value that simply calls LoginHomePage(), and that produced no results.
I’m officially in over my head.
Any suggestions? Thanks in advance!!!!
I’m not sure what WLPE is capable of, but would it work to have just two login home pages that each just contained a snippet that forwarded the user to the appropriate content area using $modx->sendRedirect(’url_of_appropriate_content_area’)?
I’d thought of a similar approach, but I was trying to avoid hard coding a specific page id into that.
That said, sometimes a simple solution is the most appropriate. Thanks for giving it some thought, though.
This works with regular WebLogin
[[
MyPage]]
<?php
if(isset($_SESSION['webValidated'])
&& isset($_SESSION['webShortname'])
&& isset($_SESSION['webUsrConfigSet']['login_home'])){
$loginpageid = $_SESSION['webUsrConfigSet']['login_home'];
$output ="";
$output .="<a href='[~".$loginpageid."~]'>My Homepage</a>";
return $output;
}
?>