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.