Forums / Setup & design / [Resolved] Redirect after login problem

[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

eZ debug

Timing: Jan 18 2025 11:27:55
Script start
Timing: Jan 18 2025 11:27:55
Module start 'content'
Timing: Jan 18 2025 11:27:55
Module end 'content'
Timing: Jan 18 2025 11:27:56
Script end

Main resources:

Total runtime0.1763 sec
Peak memory usage4,096.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0064 587.8281180.8281
Module start 'content' 0.00640.0060 768.656393.8984
Module end 'content' 0.01240.1639 862.5547522.5781
Script end 0.1762  1,385.1328 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00362.0471200.0002
Check MTime0.00150.8469200.0001
Mysql Total
Database connection0.00080.479810.0008
Mysqli_queries0.128072.59871410.0009
Looping result0.00170.94941390.0000
Template Total0.163592.710.1635
Template load0.00090.485010.0009
Template processing0.162692.248810.1626
Override
Cache load0.00060.339910.0006
Sytem overhead
Fetch class attribute can translate value0.00090.499210.0009
XML
Image XML parsing0.00030.153110.0003
General
dbfile0.00181.0296200.0001
String conversion0.00000.004130.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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