Forums / Developer / Login redirection.

Login redirection.

Author Message

Tim Ross

Tuesday 13 January 2004 9:34:45 am

I'm trying to set up a system where users can submit articles to my site.

I have successfully allowed anonymous users to add articles with out problems. Now I am trying to restrict access, so that users have to have to have correct credentials to post articles.

What I would like to achieve is a redirection to a login form when an anonymous user clicks on an 'add article' link.
When login is completed, the verified user can carry on adding an article in the same flow; without having to click on the add article link again.

For example, the flow would be:

1. Click 'add article'
2. Check for login status, if not logged in goto 3, else goto 4.
3. Login with login form, and continue.
4. Create and edit article.

At the moment if the user is not logged in ezpublish just shows an "Object not available", rather than showing a login form.

I hope you can help

Tim Ross
Web Developer
FREECPD Ltd.
---------------------------
Tel: 01491 681818
Fax: 01491 681718
---------------------------
tim@freecpd.co.uk
www.freecpd.co.uk

Dominik Pich

Wednesday 14 January 2004 4:42:15 am

Prohibit anonymous access to that site
OR
check $current_user.anonmyous_user_id

Angel Martinez

Wednesday 10 November 2004 9:09:53 am

I have the same problem that you, with login redirection. Have you solved this problem?.

Can you tell me what I have to do?.

Thanks.

Lazaro Ferreira

Wednesday 10 November 2004 10:36:41 am

Hi Angel,

Which is exactly your problem ?

Do you want also to register a new user before adding articles , in case the user doesn't have a login ?

http://ez.no/ez_publish/documentation/incoming/tutorial_using_user_register

Or do you want only to logon registered user ?

 

Lazaro
http://www.mzbusiness.com

Angel Martinez

Thursday 11 November 2004 8:23:26 am

Hello Lazaro:

My problem is the folowing:

I created my users by the Aministrator interface. Then, I have a section (called "Files") on my web, that require login to add a file. When a user enter in this section (Files) and click on an "add file" button, it display a login form.

When login is completed, the user can add a new file by means of a form.

But, this is the problem: when the user is login, it display a empty web, instead of the form to add a file. Nevertheless, if I enter in this section "Files" again, it display the form to add a file correctly.

The flow is:
1. Enter in the section "Files", clicking in the link "Files".
2. Click on the button "Add file".
3. It display the login form, and the user enter his login and password.
4. The user is login, but nothing is display.
5. The user click the link "Files" again.
6. Click on the button "Add file".
7. It display the form to add a new file correctly.

Well, where is the error?.

Thanks.

PD: I don´t speak english very good, so if you prefer, I will explain my problem in Spanish.

Lazaro Ferreira

Saturday 13 November 2004 4:14:28 am

Hi Angel,

You don't have problem the second time, because at that time the user is already logged on to the system, so the login form is automatically bypassed by ezpublish

One solution is to add or change the hidden field RedirectURI in your login form (you will have to override user/login.tpl ), that way when ezpublish finish login on the user it will automatically redirect the user to the url you want

You can also add there a template code that check if the user is already log on :

Could be something like :

{let current_user=fetch('user','current_user') }
{section show=$current_user.contentobject.main_parent_node_id|eq(REPLACE_BY_YOUR_ANONYMOUS_NODE_ID_HERE)}
<input type="hidden" name="RedirectURI" value="HERE_PUT_YOUR_FORM_URL_USING_EZURL()_OPERATOR_TO}" />
{section-else}
<input type="hidden" name="RedirectURI" value="{$User:redirect_uri}" />
{/section}
{/let}

 

Lazaro
http://www.mzbusiness.com

nga patel

Tuesday 24 May 2005 5:21:03 am

Hi, Lazaro
I have also the same type of problem, that after login the user has to redirect on particular link.
The flow is like that:
1. Display the login form, and the user enter his login and password, to add "files".
2. User has to received the exact link on which he can submit the files i.e.
..../tscm/espace_annonceurs/profil
but rather than that it goes to /content/view/sitemap/2/ ,

As i had change this link and put node id"147 rather than "2" but it does not work. and also change in the site.ini.append in
[UserSettings]
PasswordCancelURI=/espace_annonceurs/profil

But still not get success, any other change??
thanks