Forums / General / Point of view about Advanced Redirection after login

Point of view about Advanced Redirection after login

Author Message

Pascal France

Thursday 22 November 2007 8:26:03 pm

Hi,

About the <i>Advanced Redirection after login</i> I thing someting could be done to obtain a nicer behavior.
Currently, the <i>Advanced Redirection after login</i> mechanism only redirects the user to the customised redirection page if he comes from the home page (I mean, if there is no <i>LastAccessesURI</i>).

I know two ways to avoid this behavior:

1°/ by commenting out these lines in the kernel/user/login.php file (dirty solution):

71    /* if ( trim( $userRedirectURI ) == "" )
72     {
73         // Only use redirection if RequireUserLogin is disabled
74         $requireUserLogin = ( $ini->variable( "SiteAccessSettings", "RequireUserLogin" ) == "true" );
75         if ( !$requireUserLogin )
76         {
77             if ( $http->hasSessionVariable( "LastAccessesURI" ) )
78                 $userRedirectURI = $http->sessionVariable( "LastAccessesURI" );
79         }
80
81         if ( $http->hasSessionVariable( "RedirectAfterLogin" ) )
82         {
83             $userRedirectURI = $http->sessionVariable( "RedirectAfterLogin" );
84         }
85     }*/

2)/ by adding a "log in" link only in the home page.

My opinion is that most often if we use private access it is in order to display pages that are not showed in the public site. And, in the other side, we can be not interrested to display the public pages in the private side of the site.
So, with the currently and default behavior, if the user comes from any page of the site (other than the home page) he will get an error message once logged in (because the page where it came from should not be displayed in the private part).

Therefore I wonder if it wouldn't be better to add a test in the login.php file. Something like that:

"if LoginRedirectionUriAttribute[group]= is used in site.ini.append.php then always use this advanced redirection". Or anything else like that.

Regards

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish