Topic on Extension talk:ImportUsers

Cobbled together a replacement script with less than half the functionality

2
134.174.110.12 (talkcontribs)

if (($handle = fopen("accounts.csv", "r")) !== FALSE) {

   while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {

       $output = shell_exec('php maintenance\createAndPromote.php "'.$data[0].'" '.$data[1].' --force');

       $row++;

       echo $row . "\r\n";

       $output = shell_exec('php maintenance\resetUserEmail.php "'.$data[0].'" '.$data[2]);

       echo $output;

   }

   fclose($handle);


If you're in dire straits and can upload the csv file into the root mediawiki directory, the above script might help you.

Had some issues with the initial import not respecting the passwords in the file, --force was necessary before the passwords were respected.

134.174.110.12 (talkcontribs)

Missed a line in above script.


$row = 1;

if (($handle = fopen("accounts.csv", "r")) !== FALSE) {

   while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {

       $output = shell_exec('php maintenance\createAndPromote.php "'.$data[0].'" '.$data[1].' --force');

       $row++;

       echo $row . "\r\n";

       $output = shell_exec('php maintenance\resetUserEmail.php "'.$data[0].'" '.$data[2]);

       echo $output;

   }

   fclose($handle);

}

Reply to "Cobbled together a replacement script with less than half the functionality"