Class ilServicesUserTasks.
More...
◆ createAnonymousUsers()
static ilServicesUserTasks::createAnonymousUsers |
( |
|
$context, |
|
|
|
$params |
|
) |
| |
|
static |
- Parameters
-
- Returns
- array
Definition at line 25 of file class.ilServicesUserTasks.php.
References PHPMailer\PHPMailer\$params.
33 $pseudonymousUserMap = array();
34 $discloseMap = array();
37 foreach ($input_params[
'usrIdList'] as $user_id) {
38 $source_user =
new ilObjUser($user_id,
false);
39 $anon_login = self::getValidLogin();
40 $anon_password = self::generatePassword();
41 $new_id = self::createUser(
44 $source_user->getEmail()
47 $pseudonymousUserMap[] = array(
48 'Original User' => $user_id,
49 'Anonymous User' => $new_id
52 $discloseMap[] = array(
53 'Original User' => $user_id,
54 'Original Login' => $source_user->getLogin(),
55 'Original Firstname' => $source_user->getFirstname(),
56 'Original Lastname' => $source_user->getLastname(),
57 'Original Matriculation' => $source_user->getMatriculation(),
58 'Original Gender' => $source_user->getGender(),
59 'Original EMail' => $source_user->getEmail(),
60 'Anon User' => $new_id,
61 'Anon Login' => $anon_login,
62 'Anon Password' => $anon_password
65 $usrIdList[] = $new_id;
68 return array($output_params[0] => $discloseMap);
◆ createUser()
static ilServicesUserTasks::createUser |
( |
|
$login, |
|
|
|
$password, |
|
|
|
$email |
|
) |
| |
|
staticprotected |
◆ generatePassword()
static ilServicesUserTasks::generatePassword |
( |
|
$length = 8 | ) |
|
|
staticprotected |
◆ getValidLogin()
static ilServicesUserTasks::getValidLogin |
( |
| ) |
|
|
staticprotected |
- Returns
- string
Definition at line 74 of file class.ilServicesUserTasks.php.
References $login, and ilObjUser\_loginExists().
76 $random = new \ilRandom();
78 $login = self::ANON_LOGIN_PREFIX . str_pad($random->int(0, 9999999), 7, STR_PAD_LEFT);
static _loginExists($a_login, $a_user_id=0)
check if a login name already exists You may exclude a user from the check by giving his user id as 2...
◆ repersonalizeUsers()
static ilServicesUserTasks::repersonalizeUsers |
( |
|
$context, |
|
|
|
$params |
|
) |
| |
|
static |
- Parameters
-
Definition at line 141 of file class.ilServicesUserTasks.php.
References PHPMailer\PHPMailer\$params.
147 foreach ($input_params[
'discloseMap'] as $disclose_entry) {
148 $anon_user =
new ilObjUser($disclose_entry[
'Anon User'],
false);
149 $anon_user->setFirstname($disclose_entry[
'Original Firstname']);
150 $anon_user->setLastname($disclose_entry[
'Original Lastname']);
151 $anon_user->setMatriculation($disclose_entry[
'Original Matriculation']);
152 $anon_user->setGender($disclose_entry[
'Original Gender']);
153 $anon_user->update();
◆ ANON_FIRSTNAME
const ilServicesUserTasks::ANON_FIRSTNAME = 'Anonymous' |
◆ ANON_GENDER
const ilServicesUserTasks::ANON_GENDER = 'm' |
◆ ANON_LASTNAME
const ilServicesUserTasks::ANON_LASTNAME = 'Exam-User' |
◆ ANON_LOGIN_PREFIX
const ilServicesUserTasks::ANON_LOGIN_PREFIX = 'EX-' |
◆ PASSWORD_CHARACTERSET
const ilServicesUserTasks::PASSWORD_CHARACTERSET = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890' |
The documentation for this class was generated from the following file: