Share » Forums » Developer » Two user types, two registration...

Two user types, two registration forms. Not possible?

Two user types, two registration forms. Not possible?

Wednesday 21 September 2005 10:02:22 pm - 5 replies

Author Message

laurent le cadet

Thursday 22 September 2005 1:37:53 am

Hi,

I'm trying to perform this also and it's not so eZ because there is a lot of process regarding to validations, email, confirmation, activation...

The best way I found is to create a new extension based on the kernel>user and write some additional settings, something like this :

[AncienSettings]
GeneratePasswordIfEmpty=true
GeneratePasswordLength=6
DefaultAncienPlacement=316
DefaultSectionID=8
RegistrationFeedback=email
VerifyUserEmail=enabled
RegistrationEmail=
AncienClassID=45
AncienGroupClassID=2
AncienClassGroupID=2
UserCreatorID=316
HashType=md5_user
UpdateHash=true
AuthenticateMatch=login;email
RequireUniqueEmail=true
UseSpecialCharacters=false
LogoutRedirect=/ancien_eleve/login
LoginHandler[]=standard

You can have a look to site.ini for more explanation about the code above.

Apparently this solution works but need more fine tuning because it cause sometime confusion between the regular userand the custom one.

Hope this help.

Laurent

laurent le cadet

Thursday 22 September 2005 1:50:07 am

in addition you can read this : http://ez.no/products/ez_publish_cms/documentation/incoming/tutorial_using_user_register

Nathan Kelly

Thursday 22 September 2005 3:31:49 pm

Hi laurent, I have read that tutorial several times but it really doesn't cover multiple user types.

I thought the use of an extension would be the best idea but as I said, I have zero knowledge of PHP so writing my own extension is somewhat out of my depth.

Would you think that the dual siteaccess approach may be more stable? I'm pretty sure I could get it working with dual access though it seems like a clunky way to go about something so trivial.

I must admit I'm very surprised to find this functionality lacking in EzP, if I had of known EzP couldn't do this it would have changed my choice of CMS as this was a major point for the project (among other lacking features).

I'm staring to feel a bit silly about the choice now, o well!

Cheers!

Pardon me while I burst into flames...

laurent le cadet

Friday 23 September 2005 12:30:18 am

Hi,

Maybe you did the wrong choice if you need a CMS which deliver you a out of the box multi-users choice...
In fact eZp is a very complete solution and allowed you to do what you want by using it's functionalities and there is forums to help you ;) when you are stuck.
You know, I'm not a hard coder and my approche of php is close to 0.
But eZp can perform most of my needs if I spend time to learn a bit.

Anyway !

Your dual approche based on site acces doesn't seems to me to be useful.

There is minor things to do to make your own kind of extensions manually especially if it's already written ;)

- create a new folder in extension "myextension"
- create 2 subfolders "modules" and "settings"
- in "settings" create a file "module.ini.append" with this lines

#?ini charset="iso-8859-1"?

[ModuleSettings]
ExtensionRepositories[]=myextension

- In "modules" create a new subfolder "myextension" and copy/paste the whole content of kernel>user in it

- create a folder in yourdesign (plain ?)>templates>"myextension" and copy/paste the whole content of standard>templates>user

You'll have to modify the php files to call the templates you need so open them and look for this kind of lines :

$templateResult =& $tpl->fetch( 'design:user/activateaccountmail.tpl' );

In regiter.php replace the session variable "RegisterUserID" with "RegisterUserID_myextension" to avoid confusion between the 2 forms.

{* nearly the end ;) *}

Create you new user class in admin under user tab.

Copy/paste this in settings>override>site.ini.append.php

[myextensionSettings]
GeneratePasswordIfEmpty=true
GeneratePasswordLength=6
DefaultmyextensionPlacement=316
DefaultSectionID=8
RegistrationFeedback=email
VerifyUserEmail=enabled
RegistrationEmail=
myextensionClassID=45
myextensionGroupClassID=2
AncienClassGroupID=2
UserCreatorID=316
HashType=md5_user
UpdateHash=true
AuthenticateMatch=login;email
RequireUniqueEmail=true
UseSpecialCharacters=false
LogoutRedirect=/myextension/login
LoginHandler[]=standard

Mind to write our own IDs

Done.

It should have be better to make a real extension to install all this stuff with 2 clics but it will be a good approch of how eZp works.

regards.

Laurent

Nathan Kelly

Friday 23 September 2005 2:44:11 am

Cool thanks for the info laurent, I know I sound a little cynical of Ez now and then but I don't mean too, its just that the impression given from the info on the site seems to suggest all this is so easy when in fact it does take a little more work than I expected. Mind you having no PHP skills is no help either (if only I had time to learn that too ;) ).

I'll give your suggestion a go, the only thing that concerns me is that you said in your earlier post that sometimes it causes confusion between the standard and custom user, what do you mean by that exactly?

Cheers!

Pardon me while I burst into flames...

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

36 542 Users on board!

Forums menu