Share » Forums » Developer » Interesting challenge: multi - step...

Interesting challenge: multi - step user registration

Interesting challenge: multi - step user registration

Tuesday 12 July 2005 4:03:12 am - 4 replies

Modified on Tuesday 12 July 2005 6:16:23 am by Massimiliano Bariola

Author Message

Mikael Johansson

Tuesday 12 July 2005 7:19:45 am

I don't think that it is a good idea to call your functions from templates, at least not if you are using caching, since then the template code might not be run (I think).

Maybe this thread can help?
http://ez.no/community/forum/setup_design/ldap_questions/re_ldap_questions__4

Mikael Johansson, Sweden

Massimiliano Bariola

Tuesday 12 July 2005 8:10:46 am

hi Mikael,

what you suggest could be a way to go .... I could change my program flow to defer anagraphic data insertion at the time of first login.

so, do you think it's possible to do something along the lines of
- I register myself via normal ez registration process
- I activate my account
- I log in
- my custom handler detects that my IDAnagraphic field is 0 so I need to provide additional data (which I do ....)
- all subsequent logins, as I will have already provided my data, will not ask me again for my data (and the only place where I have my login/password will be only in my database).

is something like this achievable? I have read about cronjobs, etc. but I need a on-demand run-once check at login time.

BTW -- Maybe I wasn't clear, but I don't need to import the user data into eZ publish! the only thing about those users which I need in eZ is a stripped-down version of the User class (to allow login and eZ user handling). All other user data *must* stay in the outer DB.

Mikael Johansson

Tuesday 12 July 2005 8:50:02 am

Just to make sure I am following you:
Do you want the users to use a password stored in eZpublish to log in or is the password stored in the legacy database?

Is this what you want:
* User A has no information in the legacy database, so user A registers as "regular" eZ-user and everything works as usual.
* User B has information in the legacy database. She registers as an usual eZ-user but at the first login the system detects that the user exists in the legacy database and will not let the user access any content before entering some extra information. After that the user proceeds as usual, maybe with more privilegas than user A.

Correct? If not, please explain further.

Mikael Johansson, Sweden

Massimiliano Bariola

Tuesday 12 July 2005 9:19:22 am

no, situation is like this:

there is no login info in the old database. just anagraphic info, and other info which is relevant to the other clients which are using it. Due to contract limits, I cannot import this data into eZpublish. I have to access and write it through my own extension, and keep it on a separate db.

After login, Program logic then goes like this:

1- eZ user profile 's IDAnagraphic field is >0 ? ok, take her to the page she wanted to access.
2- else, ask for the relevant data fields which could determine whether she has a profile in the legacy database.
2a- if check is positive, write the relevant foreign key value into her ezUser IDAnagraphic field, and take her to her personal page.
2b-if check is negative, display the full input mask so that this data can be entered into the legacy database. then, update the IDAnagraphic field for her eZ profile and take her to her personal page.

After rewriting this, I think that maybe the best hassle-free way for doing this is :

- let her login
- make login redirect to her personal page
- incorporate points 2 ,2a, 2b into the logic of a custom template for her personal homepage.

now I only have to discover how to make the login behavior correctly redirect to personal home page or to requested page depending on user profile status (1 or 2).

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu