[Resolved] Redirect after login problem

Author Message

David Cuel-Oller

Thursday 28 August 2008 5:32:20 am

Hi there,

I'm trying to redirect users after login, (following a post read somewhere around here)
I added a redirect field to the user class and modified accordingly ini files.

When I try to log from the frontpage, clicking on the log link, it works.
But when triying the same action from another page it redirects me to that page and noàt to the redirect link written in the users params.

Any ideas (am I clear ?)

Thank you in advance

David

David Cuel-Oller

Thursday 28 August 2008 6:02:32 am

A reply to myself !

I hacked into the /kernel/user/login.php and around line 197 :
if ( is_object( $user ) && !$haveRedirectionURI )

Modifiied for :
if ( is_object( $user ) )

I think it force redirectURL to be the user's one (if any) !

Works just fine ! Now user is ever redirected to its own page.

Any comments ?

Regards,

David

Maxime Thomas

Tuesday 02 December 2008 10:57:06 pm

Hi,

I understand that you are proud to have found a solution to your issue but hack the kernel is a very very very very bad habit ! The main reason is that the day you will update your ez instance, you will have to hack again the kernel...

As far as I remember, in the login.tpl file you can put an hidden input called RedirectAfterLogin and its value is the correct URL where you want your user to go. As it's in the template you can generate it...

Max

Maxime Thomas
maxime.thomas@wascou.org | www.wascou.org | http://twitter.com/wascou

Company Blog : http://www.wascou.org/eng/Company/Blog
Technical Blog : http://share.ez.no/blogs/maxime-thomas

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 01:20:24
Script start
Timing: Jan 31 2025 01:20:24
Module start 'layout'
Timing: Jan 31 2025 01:20:24
Module start 'content'
Timing: Jan 31 2025 01:20:24
Module end 'content'
Timing: Jan 31 2025 01:20:24
Script end

Main resources:

Total runtime0.0252 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0046 588.2500151.2266
Module start 'layout' 0.00460.0035 739.4766220.7188
Module start 'content' 0.00820.0155 960.1953997.8047
Module end 'content' 0.02360.0015 1,958.000033.9922
Script end 0.0252  1,991.9922 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002710.8215140.0002
Check MTime0.00114.5354140.0001
Mysql Total
Database connection0.00062.383010.0006
Mysqli_queries0.00207.739030.0007
Looping result0.00000.039710.0000
Template Total0.00114.410.0011
Template load0.00093.485210.0009
Template processing0.00020.899910.0002
Override
Cache load0.00062.315010.0006
General
dbfile0.00249.518980.0003
String conversion0.00000.019940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs