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.