http://forum.joomla.org/index.php/topic,200895.msg944928.html#msg944928
in de wrong place I think.
Has anybody been confronted with this dilemma and hopefully found an answer for it?
Moderators: tjay, seadap, Rogue4ngel, matthewhayashida
http://forum.joomla.org/index.php/topic,200895.msg944928.html#msg944928
Code: Select all
jimport('joomla.user.helper');
$file = JRequest::getVar( 'fileUpload', '', 'files', 'array' );
$handle = fopen($file['tmp_name'], "r");
$new_user = array();
while (($data = fgetcsv($handle, 1000, ";")) !== FALSE) {
$new_user['name'] = utf8_encode($data[0]);
$new_user['username'] = utf8_encode($data[1]);
$new_user['password'] = utf8_encode($data[2]);
$new_user['email'] = utf8_encode($data[3]);
$new_user['gid'] = 18; //Registered-usergroup
$new_user['password2'] = $new_user['password'];
// Create a new JUser object
$user = new JUser(0);
$user->bind($new_user);
$user->save();
}
Fennopolpot wrote:It is easy to create a component around the code. Just add one HTML-form upload. And remember that user email have to be unique!