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

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 19 2025 00:14:29
Script start
Timing: Jan 19 2025 00:14:29
Module start 'layout'
Timing: Jan 19 2025 00:14:29
Module start 'content'
Timing: Jan 19 2025 00:14:31
Module end 'content'
Timing: Jan 19 2025 00:14:31
Script end

Main resources:

Total runtime1.1578 sec
Peak memory usage4,096.0000 KB
Database Queries68

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0052 587.9141152.6250
Module start 'layout' 0.00520.0028 740.539139.4453
Module start 'content' 0.00811.1479 779.9844581.9375
Module end 'content' 1.15600.0017 1,361.921916.1641
Script end 1.1577  1,378.0859 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.2738160.0002
Check MTime0.00130.1081160.0001
Mysql Total
Database connection0.00060.053610.0006
Mysqli_queries1.096794.7249680.0161
Looping result0.00070.0589660.0000
Template Total1.123997.120.5619
Template load0.00220.193120.0011
Template processing1.121696.879020.5608
Template load and register function0.00020.015910.0002
states
state_id_array0.00140.121710.0014
state_identifier_array0.00220.186920.0011
Override
Cache load0.00200.1739430.0000
Sytem overhead
Fetch class attribute can translate value0.00070.059730.0002
Fetch class attribute name0.00120.100870.0002
XML
Image XML parsing0.00100.086030.0003
class_abstraction
Instantiating content class attribute0.00000.001170.0000
General
dbfile0.00080.0693160.0001
String conversion0.00000.000540.0000
Note: percentages do not add up to 100% because some accumulators overlap

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
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
11content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 25
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs