Forums / Developer / redirect login form problem

redirect login form problem

Author Message

Golvier Jean

Tuesday 11 May 2004 7:32:47 am

I try to include a custom login template in another template and it works fine but I can't redirect my logged user in another page. I try to use hidden input "Redirect_uri" like this :

<form method="post" action={*"/content/view/full/2/"|ezurl*}{"/user/login/"|ezurl}>

{section show=$User:warning.bad_login}
<div class="warning">
<h2>{"Could not login"|i18n("design/standard/user")}</h2>
<ul>
    <li>{"A valid username and password is required to login."|i18n("design/standard/user")}</li>
</ul>
</div>
{/section}

<div class="block">
<label for="id1">{"Login"|i18n("design/standard/user")}</label><div class="labelbreak"></div>
<input class="halfbox" type="text" size="10" name="Login" id="id1" value="{$User:login}" />
</div>
<div class="block">
<label for="id2">{"Password"|i18n("design/standard/user")}</label><div class="labelbreak"></div>
<input class="halfbox" type="password" size="10" name="Password" id="id2" value="" />
</div>

<div class="buttonblock">
<input class="defaultbutton" type="submit" name="LoginButton" value="{'Login'|i18n('design/standard/user','Button')}" />
</div>

<input type="hidden" name="RedirectURI" value={"content/view/full/2"|ezurl} />
</form>

Is there an error ? Is it the right method ?

Thanks fo help,

Jean

Willie Seabrook

Friday 14 May 2004 10:40:11 pm

Your using the right name for the RedirectURI hidden variable so it should work (that's exactly how I do it too).

After the login, exactly where does the user get taken to?

Regards,
Willie

Golvier Jean

Friday 21 May 2004 2:07:56 am

I try some more tests and even if it doesn't work, new information could help you resolving my problem. So I discover that my problem doesn't come from RedirectURI but from :

<form method="post" action={"user/login/"|ezurl}>

which become after ezPublish compiling :

<form method="post" action="/news_en/user/login">

because a message error appears and says :

Module not found
The requested module news_en could not be found.

Possible reasons for this is.

The module name was misspelled, try changing the url. 
The module does not exist on this site. 
This site uses siteaccess matching in the url and you didn't supply one, try inserting a siteaccess name before the module in the url . 

but news_en is not a module, it's only the english part of the url (http://www.mydomain.com/news_en/...) which lead to my english website. I have the same problem with others languages.

I try to change this line but I can't reach my goal. Do you have an idea ?

Golvier Jean

Friday 21 May 2004 5:24:37 am

any idea ?

James Packham

Tuesday 25 May 2004 9:20:10 am

I get the same problem with redirects of any kind. Maybe we can help each other - My system is ezp 3.3-3 using siteaccess method. The reason why it doesn't work is because you end up with:

http://www.example.com/siteaccess/siteaccess/node2

or some such thing, which is of course nonsense as far as EZ is concerned. I think it looks like a bug in the code, but I don't know. I have a fix, but it isn't very good. In your template:

<input type="hidden" name="RedirectURI" value={"content/view/full/2"|ezurl} />

becomes

<input type="hidden" name="RedirectURI" value="content/view/full/2" />

This works because content/view/full/2 gets written to the end of whatever your URL + siteaccess is in siteaccess mode.

Did you find a better way to solve the problem? I noticed you posted this a few days ago now. I think a kernel hack would be better because so many of my templates have a redirect. My next step is to try and see if this was fixed in a newer version of EZ, so hopefully I won't need to do that!

Regards,

James

Golvier Jean

Monday 21 June 2004 7:52:39 am

Thanks James,

I fixed this bug as you do and write a complete URL with "http://www.mydomain.com/.../content/view/full/2" in this hidden input.

I know that's not a good code but I have other things to do and hopefully I use this redirect mechanism two or three times.

If you notice something in new releases of ezp, let me know.

Sincerely,

Jean

eZ debug

Timing: Jan 18 2025 21:15:00
Script start
Timing: Jan 18 2025 21:15:00
Module start 'content'
Timing: Jan 18 2025 21:15:00
Module end 'content'
Timing: Jan 18 2025 21:15:00
Script end

Main resources:

Total runtime0.1712 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0062 587.7109180.8359
Module start 'content' 0.00620.0055 768.5469101.9922
Module end 'content' 0.01170.1594 870.5391527.7734
Script end 0.1712  1,398.3125 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00352.0193200.0002
Check MTime0.00140.8040200.0001
Mysql Total
Database connection0.00130.748110.0013
Mysqli_queries0.125573.28751410.0009
Looping result0.00110.66781390.0000
Template Total0.159092.910.1590
Template load0.00080.474810.0008
Template processing0.158292.382110.1582
Override
Cache load0.00050.306110.0005
Sytem overhead
Fetch class attribute can translate value0.00080.473010.0008
XML
Image XML parsing0.00030.167710.0003
General
dbfile0.00543.1396200.0003
String conversion0.00000.002930.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