Forums / Setup & design / Redirect after login

Redirect after login

Author Message

Marko Žmak

Tuesday 25 October 2005 12:36:24 pm

Is it possible to redirect after user login to a page like this:

/content/view/full/{$UserID}

I would like that every user, after it loogs in is redirected to his "homepage", the page with his user data.

I know it can be specified with:

<input type="hidden" name="RedirectURI" value="{$User:redirect_uri|wash}" />

but it seems that in this way I cannot redirect to user's details page.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Łukasz Serwatka

Wednesday 02 November 2005 1:07:36 am

Redirecting is possible, but if this will work depends where are your users folders placed. If user folder is placed in e.g content structure and it is availalbe for currently logged in user, then use main_node.node_id or main_node.url_alias and redirect after login using RedirectURI field.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Marko Žmak

Saturday 05 November 2005 3:35:02 pm

If I undesrtood you correctly I should use:

<input type="hidden" name="RedirectURI" value="{$User:main_node.url_alias|wash}" />

Is that correct?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Marko Žmak

Sunday 06 November 2005 2:13:14 pm

Also in what template override should I put this code?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Marko Žmak

Tuesday 08 November 2005 3:27:55 pm

I tired this but it doesnt work. has anyone actually succeed to redirect user to it's user details page after successfull login?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Bruce Morrison

Tuesday 08 November 2005 4:02:28 pm

Hi Marko

I'm not sure you will be able to do this using RedirectURI. You would need to put the hidden RedirectURI form element into the login form. As you cannot know who the user will be <b>before</b> they login it is not possible to redirect them to a page specific to that user using this method.

It does appear that you will be able to do what you require in 3.8. Seehttp://pubsvn.ez.no/nextgen/trunk/doc/features/3.8/advanced_redirection_after_user_login.txt

HTH

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Marko Žmak

Wednesday 09 November 2005 12:13:06 am

Thx Bruce, this is exactly what I tought it will be the problem. I just tought that eZ already has a mechanisim for doing such thing. It seems I'll have to wait... :)

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Marko Žmak

Wednesday 09 November 2005 12:15:50 am

While we're waiting for the 3.8 version I came up with a quick fix for this:

Redirect user after login to a node with special template override in which I fetch the current user, and call the template that displays it's homepage. Should work just fine.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Łukasz Serwatka

Wednesday 09 November 2005 12:39:49 am

A little bit late, but ...

Bruce has right. Regarding to your idea:
Create dummy node, and put in template redirectoperator (check contrib section).

In login.tpl put

<input type="hidden" name="RedirectURI" value="/dummy_node" />

this will redirect user to dummy_node. In tpl for that dummy_node you can check user object and redirect to folder.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Marko Žmak

Thursday 10 November 2005 3:11:48 pm

Yes Lukasz, that's exactly what I had in mind.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Bruce Morrison

Thursday 10 November 2005 3:52:47 pm

Hi Lukasz

A great solution! Love "smoke & mirrors"!

On the redirect after login in 3.8, is there a reason that hooks for workflow triggers were not added to the user module to achieve this?

It would be a much more flexible solution, allowing for any type of redirection code to be added, and many other opportunities for login restrictions (logging of logins, time based restrictions, ip based restrictions, etc)

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

eZ debug

Timing: Jan 19 2025 09:57:28
Script start
Timing: Jan 19 2025 09:57:28
Module start 'content'
Timing: Jan 19 2025 09:57:29
Module end 'content'
Timing: Jan 19 2025 09:57:29
Script end

Main resources:

Total runtime0.8782 sec
Peak memory usage4,096.0000 KB
Database Queries220

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0069 588.9453180.8438
Module start 'content' 0.00690.7157 769.7891695.0234
Module end 'content' 0.72250.1556 1,464.8125348.4453
Script end 0.8781  1,813.2578 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00430.4947210.0002
Check MTime0.00150.1734210.0001
Mysql Total
Database connection0.00070.083710.0007
Mysqli_queries0.753685.81992200.0034
Looping result0.00290.32622180.0000
Template Total0.847696.520.4238
Template load0.00210.244120.0011
Template processing0.845496.270720.4227
Template load and register function0.00010.012110.0001
states
state_id_array0.00110.128210.0011
state_identifier_array0.00110.130620.0006
Override
Cache load0.00190.2178580.0000
Sytem overhead
Fetch class attribute can translate value0.00230.261540.0006
Fetch class attribute name0.00240.2735140.0002
XML
Image XML parsing0.00200.229540.0005
class_abstraction
Instantiating content class attribute0.00010.0113220.0000
General
dbfile0.01141.2997430.0003
String conversion0.00000.000730.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
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
11content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
11content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
16content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 45
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs