How can you redirect the page if the user does not logged in in velocity machine? for example when you visit a another page it will redirect to login page to view the that another page, do I need a conditonal on that?
I believe that you are using SpringFramework in your project.
You could simply add an interceptor to check whether the user has logged in or not and redirect him. You could also add a filter in web.xml file to do the same.
Related
Our dnn version is 07.04.00 (353). We have an external system that redirects the user to some page. In order, the user will see the page he must have specific role i.e. this page only visible for users that have this role. If the user doesn't have this role he should be redirected to the home page.
Using chrome developer tools we see that the page get "You+do+not+have+access+to+view+this+page+within+the+website", dnn then redirect to Default.aspx where there it gets "=An%20unexpected%20error%20has%20occurred". It then try redirect to the page again and it enter into infinite loop of redirection.
Can you please advise?
Please check the Log4Net files in \Portals_default\Logs for more a detailed error message.
I create more than one site on sensenet and I want to specify an login page for each site.
On site properties I can define the login page but that is not working... (I think). Every time I access without the login made I receive the follow message:
404 error The requested resource could not be found Please make sure
that the url is spelled correctly.
To go to the main page, click here
It shouldn't go to my login page defined on site settings?
What am I not picking here?
You should add at least one site URL to your new site, and also check if "Everyone" has "open" and "run application" permission on the new login page.
I need help figuring out how to allow users who login go back to the page that they were on before being sent to the login page. Here is a quote from my boss:
Sometimes I forget to sign in and I go to a page, click and get the
notice about joining or signing in. That is fine, but is there a way,
once I sign in to open the page I was trying to open prior to signing
in, instead of having to go through all the navigation again?
I'm using PHP to do this project.
Whatever mechanism forwards the user to the sign-in page should include the original page's URL as a parameter. Something like:
header('Location: http://example.com/login.php?redirectTo=' + urlencode($_SERVER['REQUEST_URI']));
Then the login.php page can redirect to that page after the user authenticates:
header('Location: ' . $_GET['redirectTo']);
You may want to put in some checking on the redirectTo value in login.php to make sure nobody's trying to do anything malicious, I suppose. Though I can't currently think of anything malicious they could do. (Though you would want to include a default if no URL was provided.)
But the general idea is that the authentication mechanism provides the login page with a redirect URL when it detects that the user needs to login.
I have been trying to do this for days now and cant seem to find any help on how to do is. I want the user after login to be redirected to a different page instead of the members landing page.
Try checking the code in User/AuthController after this comment Run post login hook. There are several ways to do a custom redirect here.
specify a return_url parameter in the link to login page. You can also 64-bit encode the redirect url so that it is compact.
Keep a session variable, namely Zend_Session_Namespace('Redirect')->uri
Write a post login hook onUserLoginAfter and pass a redirect parameter in its response.
If all else fails, hard-code the next line of code which redirects to home :P
i'm having troubles with the bhLDAPAuthPlugin for symfony when the user session expires. It redirects to the signin form as expected but once the user is authenticated, instead of redirect him to the requested page (the one witch first requested the user), it redirects him to the requested page adding exra information to the URL.
Let me show it to you with an example:
The user is in this URL and the session expires
myapp/editSomething/id/231
And then is redirected by the bhLDAPAuthPlugin to the signin form. Once the user had entered the username & password is redirected here
myapp/editSomething/images/loadingAnimation.gif
I dont know what loadingAnimation.gif is (is not in my /images/ directory nor in anywhere else of my app), nor where is this additional information added :S
Could you please help me to find the place where i must change this behaviour?
Thank you! :D
Every thing is done in the action. The redirect url is build here:
// always redirect to a URL set in app.yml
// or to the referer
// or to the homepage
$signinUrl = sfConfig::get('app_sf_guard_plugin_success_signin_url', $user->getReferer('#homepage'));
Did you define something in your app.yml for app_sf_guard_plugin_success_signin_url ?
all:
sf_guard_plugin:
success_signin_url: #my_route?param=value # the plugin uses the referer as default
So it seems that your referer is bad. Try to define an url in the app.yml to see if the behavior is different.