You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
925 B
25 lines
925 B
<?php
|
|
/* For licensing terms, see /license.txt */
|
|
die('Remove the "die()" statement on line '.__LINE__.' to execute this script'.PHP_EOL);
|
|
require_once __DIR__.'/../../public/main/inc/global.inc.php';
|
|
api_protect_admin_script();
|
|
|
|
// Define origin and destination courses' code
|
|
$debug = true;
|
|
|
|
$file = 'file.csv';
|
|
$users = Import :: csvToArray($file);
|
|
foreach ($users as $user) {
|
|
//$userInfo = api_get_user_info_from_username($user['UserName']);
|
|
$userInfo = api_get_user_info_from_email($user['Email']);
|
|
if ($userInfo) {
|
|
if ($debug == false) {
|
|
UserManager::delete_user($userInfo['user_id']);
|
|
echo 'User deleted: '.$userInfo['user_id'].' '.$userInfo['username'].'<br />';
|
|
} else {
|
|
echo 'User will be deleted: '.$userInfo['user_id'].' '.$userInfo['username'].'<br />';
|
|
}
|
|
} else {
|
|
echo 'user not found: "'.$user['UserName'].'"<br />';
|
|
}
|
|
}
|
|
|