Migration of user to EZ from a database using http post automatically

Author Message

Tore Skobba

Thursday 04 March 2004 5:27:46 am

Hi

I am working with moving user from an old system to EZ. Instead of making an php script to create the users I am evaluating setting up an script to automatically post to the user/regiser page. I.e

for each old user
fetch the user/register page and parse out the neccesary register post params
fill out the register post params
post the register post params.

In order to to this I am using the curl function in php. Have anyone done this before and have it been a success?

UPDATE: I am now managing to post and after the automatically posting I get the message success.. However, when I enter the admin user interface the user has no data (i.e. no login name, no password, no first name etc...) Anyone has any tips on what might be wrong? Both the post variable name and post variable value are url encoded.

cheers
Tore

Paul Borgermans

Thursday 04 March 2004 12:16:35 pm

Nice alternative Tore, but why did you not try the text-based handler for this? After the "import" you could fall back to default user handling?

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Tore Skobba

Thursday 04 March 2004 2:12:57 pm

Hi Paul

I considred it but I thought that it might be a bit to difficult, due to that my user class have lots of various datatypes (ematrix, ezselection, enum etc..). And viewing this (http://www.ez.no/ez_publish/documentation/development/importing_attribute_data) I thought that it might be a bit of a hassle. And if I managed to import data by doing automatically posts it might allow for easy import of all data. Name of datafield are parsed out with reg. exp, no manualy entering of ez post variables. Just map your data to EZ post variables and posts it in.

When you are talking about text-based handler you are refering to the install scripts found various places on the site, or ?

Currently I am still not managing to get EZ to fully accept the posted data, EZ seems to accept it since the user is created. But when viewing the user there is no data there at all, strange since EZ should have refused on no login name, email nor password if it failed to accept the data.

cheers
Tore

Paul Borgermans

Friday 05 March 2004 1:34:47 am

Hi Tore,

If you have so much attribute data, then its not worth considering the text-handler (I meant the one for text file based login and basic user info).

When posting using curl, did you disable the policy rules ? I suppose you still have to login and store the cookies within your script.

-paul

 

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Tore Skobba

Friday 05 March 2004 2:51:50 am

Hi

hmm disable policy rules, which ones do you mean? I do not think I need to do any such thing. This as I currently am trying to post to the register new user form on the default design page, i.e. replicating a typical new user comming from the "Internett".

Cheers
Tore

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 19 2025 04:27:01
Script start
Timing: Jan 19 2025 04:27:01
Module start 'layout'
Timing: Jan 19 2025 04:27:01
Module start 'content'
Timing: Jan 19 2025 04:27:02
Module end 'content'
Timing: Jan 19 2025 04:27:02
Script end

Main resources:

Total runtime0.7131 sec
Peak memory usage4,096.0000 KB
Database Queries63

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 590.7188152.6563
Module start 'layout' 0.00600.0027 743.375039.4922
Module start 'content' 0.00870.7028 782.8672562.1094
Module end 'content' 0.71150.0015 1,344.976612.0938
Script end 0.7130  1,357.0703 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.4348160.0002
Check MTime0.00140.1971160.0001
Mysql Total
Database connection0.00110.157210.0011
Mysqli_queries0.658792.3691630.0105
Looping result0.00060.0863610.0000
Template Total0.678195.120.3390
Template load0.00180.255520.0009
Template processing0.676294.829920.3381
Template load and register function0.00020.026610.0002
states
state_id_array0.00140.194010.0014
state_identifier_array0.00160.222820.0008
Override
Cache load0.00150.2163360.0000
Sytem overhead
Fetch class attribute can translate value0.00080.113720.0004
Fetch class attribute name0.00100.137360.0002
XML
Image XML parsing0.00070.096920.0003
class_abstraction
Instantiating content class attribute0.00000.001770.0000
General
dbfile0.00100.1341170.0001
String conversion0.00000.001040.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
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 22
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs