New user type

Author Message

David Santiso

Saturday 02 April 2011 8:44:48 am

Hi,

I want to create a new user type. This user will not be a person. It will be a institution. I want that users can choose whether to register as a person or institution.

I've thought to create a new user class called institution, but when I create the class, how can I do to allow users to register using this class?

Thanks,

David

paul bolger

Saturday 02 April 2011 7:37:44 pm

Hi David,

The magic datatype which makes a content class accept user registration is User account [User account] (id:12). Any content class which includes that will be able to act as a user account. The unique identifier for a user account is an email address. You can't use the same address for more than one account, and the person using the registration will need to be able to receive mail on that address to reset their password. Also, any other person who can read mail sent to that account will be able to reset the password.

Hope that helps.

Paul Bolger

David Santiso

Sunday 03 April 2011 6:26:41 am

Yes, yes.

The new class of user is a copy of the user, but adding some more data. I want each user can choose which type of register making. Obviously there will be only one register per mail.

When I have created the class, how would I proceed?

Thanks,

Carlos Revillo

Tuesday 05 April 2011 4:39:37 am

"

The unique identifier for a user account is an email address. You can't use the same address for more than one account, and the person using the registration will need to be able to receive mail on that address to reset their password. Also, any other person who can read mail sent to that account will be able to reset the password.

Hope that helps.

"

Hi Paul. That's not entirely correct. eZ Publish allows to have several users sharing same e-mail address. not by default, but it's just a matter of modify a setting

have a look at https://github.com/ezsystems/ezpublish/blob/master/settings/site.ini#L587

username (nick) must be unique always, but in sometimes several "users" can share email account.

Cheers.

Carlos Revillo

Tuesday 05 April 2011 4:43:40 am

Hi David.

If you're doing it via /user/register, then you can modify (override) a setting found in site.ini file

https://github.com/ezsystems/ezpublish/blob/master/settings/site.ini#L553

You can set that to the id of your new class.

But for choosing, you'll probably need a custom module. i suggest you start from the provided one and add there the modifications needed to create a object of the class you want depending on the user selection.

paul bolger

Wednesday 06 April 2011 3:57:17 pm

Hi Carlos, I must admit that I didn't know that.

Generally, and I'm starting a project where this is relevant, I'm interested in the relative merits of extending the user content class to make a 'people' directory versus creating a new class. Is there any good reason why extending the user class would not be a good idea?

Paul Bolger

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 18 2025 04:28:54
Script start
Timing: Jan 18 2025 04:28:54
Module start 'layout'
Timing: Jan 18 2025 04:28:54
Module start 'content'
Timing: Jan 18 2025 04:28:55
Module end 'content'
Timing: Jan 18 2025 04:28:55
Script end

Main resources:

Total runtime0.9872 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.0062 588.9063152.6094
Module start 'layout' 0.00620.0030 741.515639.4063
Module start 'content' 0.00910.9765 780.9219598.5078
Module end 'content' 0.98560.0015 1,379.429716.2031
Script end 0.9872  1,395.6328 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.3618160.0002
Check MTime0.00140.1370160.0001
Mysql Total
Database connection0.00080.080410.0008
Mysqli_queries0.922993.4809680.0136
Looping result0.00070.0733660.0000
Template Total0.950096.220.4750
Template load0.00230.232320.0011
Template processing0.947795.996820.4738
Template load and register function0.00040.037710.0004
states
state_id_array0.00120.124710.0012
state_identifier_array0.00130.131820.0007
Override
Cache load0.00200.1993360.0001
Sytem overhead
Fetch class attribute can translate value0.00070.067630.0002
Fetch class attribute name0.00160.164070.0002
XML
Image XML parsing0.00070.070330.0002
class_abstraction
Instantiating content class attribute0.00000.001980.0000
General
dbfile0.00090.0897160.0001
String conversion0.00000.000840.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
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/quote.tpldatatype/ezxmltext/quote.tplextension/ezwebin/design/ezwebin/override/templates/datatype/ezxmltext/quote.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 18
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs