Forums / Developer / Moving mass users from one user group to another.

Moving mass users from one user group to another.

Author Message

John Smith

Tuesday 18 November 2008 7:47:23 am

Hope some one can help me. On one of my sites I need the following functionality.

1. Importing (1000 to 1500) users from a CSV file into ezpublish 4.0.1.

2. The user class needs attributes such as - First name, last name, username, password, email, address, phone, date of birth etc.

3. Once imported, users would be able to edit their own profiles from the public website.

4. When changes are made to the profile, administrator needs the changes to be approved.

5. Now on the administration site, need some sort of mechanism / module with the help of extension, which would help me in moving the users (within certain age range based on date of birth to and from) from one user group to another user group.

Any help and advise would be appreciated.

Thanks.

Maxime Thomas

Tuesday 18 November 2008 11:40:51 pm

Hi,

Some clues :
1. Make an extension with a script (one shot job) or cronjob (recurrent job) to read the CSV, convert it in PHP objects, create or update users and store them in the a group called "Authentified Users" (for example).

2. Go in the administration initerface and modify the content class as needed.

3. Create a role with the policies allowing the modification of the profile (content/create && content/edit && user/edit, if I can remember).

4. Set up a workflow in the backoffice.

5. Add a module to your extension. It will contain one view : "list" inwhich one you may sort or filter all the users by some criteria. Finally it will have a button move that will effectivelly move the users to the chosen group.

Maxime Thomas
maxime.thomas@wascou.org | www.wascou.org | http://twitter.com/wascou

Company Blog : http://www.wascou.org/eng/Company/Blog
Technical Blog : http://share.ez.no/blogs/maxime-thomas

John Smith

Wednesday 19 November 2008 1:31:59 am

First of all I would like to thank you for taking out your time.

Some clues :
1. Make an extension with a script (one shot job) or cronjob (recurrent job) to read the CSV, convert it in PHP objects, create or update users and store them in the a group called "Authentified Users" (for example).

2. Go in the administration initerface and modify the content class as needed.

3. Create a role with the policies allowing the modification of the profile (content/create && content/edit && user/edit, if I can remember).

4. Set up a workflow in the backoffice. 

I think upto here it seems quite straight forward by importing the users. Last night I did some digging where I found an extension named as "usercreator" which is capable of importing the user into the required customised class created before importing the users. After that some roles/policies and workflow of type "Event/Aprove" on the Section - Users will do the job.

5. Add a module to your extension. It will contain one view : "list" inwhich one you may sort or filter all the users by some criteria. Finally it will have a button move that will effectivelly move the users to the chosen 

Here it seems bit complicated. Maxime, would it be possible to explain this point bit more in detail or is there any extension which could give me some sort of idea how to pull all the usergroups and users based on some criteria. I think I need some sort of example or similar sort of extension from where I can pick things according to my requirements.

kracker (the)

Wednesday 19 November 2008 1:30:29 pm

Check it, <i>http://projects.ez.no/batchtool</i>

<i>//kracker

Lil Wayne : Tha Carter III : DontGetIt</i>

Member since: 2001.07.13 || http://ezpedia.se7enx.com/

eZ debug

Timing: Jan 18 2025 16:13:48
Script start
Timing: Jan 18 2025 16:13:48
Module start 'content'
Timing: Jan 18 2025 16:13:49
Module end 'content'
Timing: Jan 18 2025 16:13:49
Script end

Main resources:

Total runtime0.9960 sec
Peak memory usage4,096.0000 KB
Database Queries199

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 589.2734180.8125
Module start 'content' 0.00560.8621 770.0859605.5547
Module end 'content' 0.86770.1282 1,375.6406337.3672
Script end 0.9959  1,713.0078 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00400.3983210.0002
Check MTime0.00150.1514210.0001
Mysql Total
Database connection0.00060.064810.0006
Mysqli_queries0.923792.74091990.0046
Looping result0.00200.20241970.0000
Template Total0.967297.120.4836
Template load0.00210.211720.0011
Template processing0.965196.897320.4825
Template load and register function0.00020.021110.0002
states
state_id_array0.00120.124610.0012
state_identifier_array0.00110.112220.0006
Override
Cache load0.00180.1778310.0001
Sytem overhead
Fetch class attribute can translate value0.00140.139240.0003
Fetch class attribute name0.00120.117260.0002
XML
Image XML parsing0.00170.167740.0004
class_abstraction
Instantiating content class attribute0.00000.001360.0000
General
dbfile0.00210.2136350.0001
String conversion0.00000.000430.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
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/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/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 18
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs