Forums / Developer / New user type

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

eZ debug

Timing: Jan 29 2025 23:52:47
Script start
Timing: Jan 29 2025 23:52:47
Module start 'content'
Timing: Jan 29 2025 23:52:47
Module end 'content'
Timing: Jan 29 2025 23:52:47
Script end

Main resources:

Total runtime0.1300 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0058 587.7578180.8594
Module start 'content' 0.00580.0049 768.617297.8438
Module end 'content' 0.01080.1191 866.4609525.9453
Script end 0.1299  1,392.4063 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00312.3661200.0002
Check MTime0.00120.9200200.0001
Mysql Total
Database connection0.00070.536810.0007
Mysqli_queries0.087667.36011410.0006
Looping result0.00110.84131390.0000
Template Total0.118891.410.1188
Template load0.00070.553910.0007
Template processing0.118190.860410.1181
Override
Cache load0.00050.369210.0005
Sytem overhead
Fetch class attribute can translate value0.00060.466010.0006
XML
Image XML parsing0.00030.248310.0003
General
dbfile0.00675.1222200.0003
String conversion0.00000.004030.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs