Here is a small import script that worked for me.
csv file (utf-8 encoded):
"name";"username";"email";"plaintextpassword"
<?php
require_once('/var/www/htdocs/engine/start.php');
global $CONFIG;
$ordner = "/var/www/htdocs";
$rb_datei = fopen($ordner."/user.csv", "r");
if ($rb_datei) {
$array = explode("\n", fread($rb_datei, filesize($ordner."/user.csv")));
}
$total_array = count($array);
echo $total_array;
$i = 0;
while($i < $total_array) {
$data = explode(";", $array[$i]);
$name = str_replace('"','',utf8_decode($data[1]));
$username = str_replace('"','',utf8_decode($data[2]));
$email = str_replace('"','',utf8_decode($data[3]));
$password = str_replace('"','',utf8_decode($data[4]));
$guid = register_user($username, $password, $name, $email, false);
$user = get_entity($guid);
$user->enable();
set_email_validation_status($user->getGUID(), true);
echo "<br>Username: ".$username." - Name: ".$name. " - E-Mail: ".$email. " - Password: ".$password;
$i++;
}
?>
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.