Import users with importer Concrete 5.5.0
Permalink 1 user found helpful
Just put the following function in your importer.php script and u have the possibility to import users with attributes. Works only for Concrete 5.5.0. Don't forget to call the function in the construct!
protected function importUsers(SimpleXMLElement $sx) { if (isset($sx->users)) { $nodes = array(); foreach($sx->users->user as $p) { $nodes[] = $p; } usort($nodes, array('ContentImporter', 'setupPageNodeOrder')); Loader::model('attribute/type'); Loader::model('attribute/categories/user'); foreach($nodes as $px) { $args = array(); $args['uName'] = $px['username']; $args['uEmail'] = $px['username']; $args['uPassword'] = $px['password']; $args['uPasswordConfirm'] = $px['password'];
Viewing 15 lines of 38 lines. View entire code block.
Just not so sure about the
line.
I BELIEVE that that actually logs the user in, thus logging you out.
I would imagine that you can get a uID or a UserInfo from the ::register() function, and then be able to do User::getByID().
James