ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
ilUserImportParser Class Reference
+ Inheritance diagram for ilUserImportParser:
+ Collaboration diagram for ilUserImportParser:

Public Member Functions

 setFolderId (int $a_folder_id)
 assign users to this folder (normally the usr_folder) But if called from local admin => the ref_id of the category More...
 
 getFolderId ()
 
 setHandlers ($a_xml_parser)
 set event handler should be overwritten by inherited class @access private More...
 
 setRoleAssignment (array $a_assign)
 set import to local role assignemt More...
 
 buildTag (string $type, string $name, ?array $attr=null)
 generate a tag with given name and attributes More...
 
 handlerBeginTag ( $a_xml_parser, string $a_name, array $a_attribs)
 
 extractRolesBeginTag ( $a_xml_parser, string $a_name, array $a_attribs)
 
 importBeginTag ( $a_xml_parser, string $a_name, array $a_attribs)
 
 verifyBeginTag ( $a_xml_parser, string $a_name, array $a_attribs)
 
 handlerEndTag ( $a_xml_parser, string $a_name)
 
 extractRolesEndTag ( $a_xml_parser, string $a_name)
 
 getRoleObject (int $a_role_id)
 Returns the parent object of the role folder object which contains the specified role. More...
 
 getCourseMembersObjectForRole (int $a_role_id)
 Returns the parent object of the role folder object which contains the specified role. More...
 
 assignToRole (ilObjUser $a_user_obj, int $a_role_id)
 Assigns a user to a role. More...
 
 getParentRoleIds (int $a_role_id)
 Get array of parent role ids from cache. More...
 
 assignToRoleWithParents (ilObjUser $a_user_obj, int $a_role_id)
 Assigns a user to a role and to all parent roles. More...
 
 detachFromRole (ilObjUser $a_user_obj, int $a_role_id)
 Detaches a user from a role. More...
 
 importEndTag ( $a_xml_parser, string $a_name)
 
 saveTempImage (string $image_data, string $filename)
 Saves binary image data to a temporary image file and returns the name of the image file on success. More...
 
 verifyEndTag ( $a_xml_parser, string $a_name)
 handler for end of element when in verify mode. More...
 
 handlerCharacterData ( $a_xml_parser, string $a_data)
 handler for character data More...
 
 getCollectedRoles ()
 
 getUserCount ()
 
 logWarning (string $aLogin, string $aMessage)
 Writes a warning log message to the protocol. More...
 
 logFailure (string $aLogin, string $aMessage)
 Writes a failure log message to the protocol. More...
 
 logSuccess (string $aLogin, int $userid, string $action)
 Writes a success log message to the protocol. More...
 
 getProtocol ()
 The protocol is an associative array. More...
 
 getProtocolAsHTML (string $a_log_title)
 Returns the protocol as a HTML table. More...
 
 isSuccess ()
 Returns true, if the import was successful. More...
 
 getErrorLevel ()
 Returns the error level. More...
 
 getUserMapping ()
 returns a map user_id <=> login More...
 
 sendAccountMail ()
 send account mail More...
 
 setSendMail (bool $value)
 
 isSendMail ()
 
 setUserMappingMode (int $value)
 write access to user mapping mode More...
 
 getUserMappingMode ()
 read access to user mapping mode More...
 
- Public Member Functions inherited from ilSaxParser
 __construct (?string $path_to_file='', ?bool $throw_exception=false)
 
 setXMLContent (string $a_xml_content)
 
 getXMLContent ()
 
 getInputType ()
 
 startParsing ()
 stores xml data in array More...
 
 createParser ()
 
 setHandlers ($a_xml_parser)
 
 parse ($a_xml_parser, $a_fp=null)
 

Data Fields

const IL_EXTRACT_ROLES = 1
 
const IL_USER_IMPORT = 2
 
const IL_VERIFY = 3
 
const IL_FAIL_ON_CONFLICT = 1
 
const IL_UPDATE_ON_CONFLICT = 2
 
const IL_IGNORE_ON_CONFLICT = 3
 
const IL_IMPORT_SUCCESS = 1
 
const IL_IMPORT_WARNING = 2
 
const IL_IMPORT_FAILURE = 3
 
const IL_USER_MAPPING_ID = 2
 
- Data Fields inherited from ilSaxParser
string $xml_file
 
bool $throw_exception = false
 

Private Member Functions

 tagContained (string $tagname)
 
 readRequiredFields ()
 
 checkProfileIncomplete (ilObjUser $user_obj)
 Check if profile is incomplete Will set the usr_data field profile_incomplete if any required field is missing. More...
 
 isFieldRequired (string $fieldname)
 determine if a field $fieldname is to a required field (global setting) More...
 
 verifyPref (string $key, string $value)
 
 addUDFDataToUser (\ilObjUser $user)
 
 updateMailPreferences (int $usr_id)
 
 fetchFieldIdFromImportId (string $import_id)
 
 fetchFieldIdFromName (string $name)
 
 getCDataWithoutTags ()
 
 stripTags (string $string)
 

Private Attributes

const IL_USER_MAPPING_LOGIN = 1
 
ILIAS $ilias
 
ilSetting $settings
 
ilObjectDataCache $object_data_cache
 
ilRbacReview $rbac_review
 
ilRbacAdmin $rbac_admin
 
ilAccess $access
 
ilObjUser $user
 
Profile $user_profile
 
string $tmp_udf_name = null
 
string $tmp_udf_id = null
 
array $multi_values
 
array $udf_data
 
bool $auth_mode_set
 
string $current_pref_key = null
 
array $prefs
 
string $current_role_action
 
string $current_role_type
 
string $current_role_id = '0'
 
string $cdata
 
array $role_assign
 
string $req_send_mail
 
ilAccountMail $acc_mail
 
int $mode
 
bool $approve_date_set = false
 
bool $time_limit_set = false
 
bool $time_limit_owner_set = false
 
bool $update_look_and_skin = false
 
int $folder_id
 
array $roles
 
string $action
 
array $required_fields = []
 
array $contained_tags = []
 
array $protocol
 
array $logins
 
int $conflict_rule
 
bool $send_mail
 
int $error_level
 This variable is used to report the error level of the validation process or the importing process. More...
 
string $current_user_password_type
 
string $current_user_password
 
string $currActive = null
 
int $user_count
 
array $user_mapping = []
 
int $mapping_mode
 
array $local_role_cache
 
array $personal_picture = null
 
array $parent_roles_cache
 
string $skin = ''
 
string $style = ''
 
array $user_styles
 
int $user_id
 
ilObjUser $user_obj
 
string $current_messenger_type
 
ilRecommendedContentManager $recommended_content_manager
 
Refinery $refinery
 

Additional Inherited Members

- Protected Member Functions inherited from ilSaxParser
 openXMLFile ()
 
 handleError (string $message)
 
 setThrowException (bool $throw_exception)
 
- Protected Attributes inherited from ilSaxParser
ilLanguage $lng = null
 

Detailed Description

Definition at line 28 of file class.ilUserImportParser.php.

Member Function Documentation

◆ addUDFDataToUser()

ilUserImportParser::addUDFDataToUser ( \ilObjUser  $user)
private

Definition at line 2154 of file class.ilUserImportParser.php.

2154 : \ilObjUser
2155 {
2156 return $user->withProfileData(
2157 array_reduce(
2158 array_keys($this->udf_data),
2159 fn(ProfileData $c, string $v): ProfileData =>
2160 $c->withAdditionalFieldByIdentifier(
2161 $v,
2162 $this->udf_data[$v]
2163 ),
2164 $this->user_obj->getProfileData()
2165 )
2166 );
2167 }
User class.
withProfileData(Data $profile_data)
$c
Definition: deliver.php:25

References $c, and ilObjUser\withProfileData().

+ Here is the call graph for this function:

◆ assignToRole()

ilUserImportParser::assignToRole ( ilObjUser  $a_user_obj,
int  $a_role_id 
)

Assigns a user to a role.

Definition at line 671 of file class.ilUserImportParser.php.

671 : void
672 {
673 // Do nothing, if the user is already assigned to the role.
674 // Specifically, we do not want to put a course object or
675 // group object on the personal desktop again, if a user
676 // has removed it from the personal desktop.
677 if ($this->rbac_review->isAssigned($a_user_obj->getId(), $a_role_id)) {
678 return;
679 }
680
681 // If it is a course role, use the ilCourseMember object to assign
682 // the user to the role
683
684 $this->rbac_admin->assignUser($a_role_id, $a_user_obj->getId(), true);
685 $obj_id = $this->rbac_review->getObjectOfRole($a_role_id);
686 switch (ilObject::_lookupType($obj_id)) {
687 case 'grp':
688 case 'crs':
689 $ref_ids = ilObject::_getAllReferences($obj_id);
690 $ref_id = current((array) $ref_ids);
691 if ($ref_id) {
692 // deactivated for now, see discussion at
693 // https://docu.ilias.de/goto_docu_wiki_wpage_5620_1357.html
694 //$this->recommended_content_manager->addObjectRecommendation($a_user_obj->getId(), $ref_id);
695 }
696 break;
697 default:
698 break;
699 }
700 }
static _lookupType(int $id, bool $reference=false)
static _getAllReferences(int $id)
get all reference ids for object ID
$ref_id
Definition: ltiauth.php:66

References $ref_id, ilObject\_getAllReferences(), ilObject\_lookupType(), and ilObject\getId().

+ Here is the call graph for this function:

◆ assignToRoleWithParents()

ilUserImportParser::assignToRoleWithParents ( ilObjUser  $a_user_obj,
int  $a_role_id 
)

Assigns a user to a role and to all parent roles.

Definition at line 752 of file class.ilUserImportParser.php.

755 : void {
756 $this->assignToRole($a_user_obj, $a_role_id);
757
758 $parent_role_ids = $this->getParentRoleIds($a_role_id);
759 foreach ($parent_role_ids as $parent_role_id) {
760 $this->assignToRole($a_user_obj, $parent_role_id);
761 }
762 }
getParentRoleIds(int $a_role_id)
Get array of parent role ids from cache.
assignToRole(ilObjUser $a_user_obj, int $a_role_id)
Assigns a user to a role.

◆ buildTag()

ilUserImportParser::buildTag ( string  $type,
string  $name,
?array  $attr = null 
)

generate a tag with given name and attributes

Definition at line 278 of file class.ilUserImportParser.php.

278 : string // Missing array type.
279 {
280 $tag = '<';
281
282 if ($type === 'end') {
283 $tag .= '/';
284 }
285
286 $tag .= $name;
287
288 if (is_array($attr)) {
289 foreach ($attr as $k => $v) {
290 $tag .= " {$k}='{$v}'";
291 }
292 }
293
294 $tag .= '>';
295
296 return $tag;
297 }

◆ checkProfileIncomplete()

ilUserImportParser::checkProfileIncomplete ( ilObjUser  $user_obj)
private

Check if profile is incomplete Will set the usr_data field profile_incomplete if any required field is missing.

Definition at line 2050 of file class.ilUserImportParser.php.

2050 : bool
2051 {
2052 return $this->user_profile->isProfileIncomplete($user_obj);
2053 }

◆ detachFromRole()

ilUserImportParser::detachFromRole ( ilObjUser  $a_user_obj,
int  $a_role_id 
)

Detaches a user from a role.

Definition at line 767 of file class.ilUserImportParser.php.

770 : void {
771 $this->rbac_admin->deassignUser($a_role_id, $a_user_obj->getId());
772
773 if (substr(ilObject::_lookupTitle($a_role_id), 0, 6) !== 'il_crs'
774 && substr(ilObject::_lookupTitle($a_role_id), 0, 6) !== 'il_grp') {
775 return;
776 }
777
779 $this->rbac_review->getObjectOfRole($a_role_id)
780 );
781 $ref_id = end($ref);
782 if (!$ref_id) {
783 return;
784 }
785 $this->recommended_content_manager->removeObjectRecommendation($a_user_obj->getId(), $ref_id);
786 }
static _lookupTitle(int $obj_id)

◆ extractRolesBeginTag()

ilUserImportParser::extractRolesBeginTag (   $a_xml_parser,
string  $a_name,
array  $a_attribs 
)
Parameters
\XMLParser | resource$a_xml_parser

Definition at line 322 of file class.ilUserImportParser.php.

326 : void {
327 switch ($a_name) {
328 case 'Role':
329 // detect numeric, ilias id (then extract role id) or alphanumeric
330 $current_role_id = $a_attribs['Id'];
331 if (($internal_id = ilUtil::__extractId($current_role_id, (int) IL_INST_ID)) > 0) {
332 $current_role_id = $internal_id;
333 }
334 $this->current_role_id = $this->refinery->kindlyTo()->string()->transform($current_role_id);
335 $this->current_role_type = $a_attribs['Type'];
336 break;
337 }
338 }
static __extractId(string $ilias_id, int $inst_id)
extract ref id from role title, e.g.
const IL_INST_ID
Definition: constants.php:40

References ilUtil\__extractId(), IL_INST_ID, and ILIAS\Repository\refinery().

Referenced by handlerBeginTag().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ extractRolesEndTag()

ilUserImportParser::extractRolesEndTag (   $a_xml_parser,
string  $a_name 
)
Parameters
\XMLParser | resource$a_xml_parser

Definition at line 623 of file class.ilUserImportParser.php.

626 : void {
627 switch ($a_name) {
628 case 'Role':
629 $this->roles[$this->current_role_id]['name'] = $this->cdata;
630 $this->roles[$this->current_role_id]['type'] =
632 break;
633 }
634 }

◆ fetchFieldIdFromImportId()

ilUserImportParser::fetchFieldIdFromImportId ( string  $import_id)
private

Definition at line 2183 of file class.ilUserImportParser.php.

2183 : ?string
2184 {
2185 if ($import_id === '') {
2186 return null;
2187 }
2188
2189 $parts = explode('_', $import_id);
2190 if (($parts[0] ?? '') !== 'il'
2191 || ($parts[1] ?? '') !== 'udf'
2192 || ($parts[2] ?? '') === ''
2193 || $this->user_profile->getFieldByIdentifier($parts[2]) === null) {
2194 return null;
2195 }
2196 return $parts[2];
2197 }
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:61

References $parts.

◆ fetchFieldIdFromName()

ilUserImportParser::fetchFieldIdFromName ( string  $name)
private

Definition at line 2199 of file class.ilUserImportParser.php.

2199 : ?string
2200 {
2201 foreach ($this->user_profile->getAllUserDefinedFields() as $field) {
2202 if ($field->getLabel($this->lng) === $name) {
2203 return $field->getIdentifier();
2204 }
2205 }
2206 return null;
2207 }

◆ getCDataWithoutTags()

ilUserImportParser::getCDataWithoutTags ( )
private

Definition at line 2209 of file class.ilUserImportParser.php.

2209 : string
2210 {
2211 return $this->stripTags($this->cdata);
2212 }

◆ getCollectedRoles()

ilUserImportParser::getCollectedRoles ( )
Returns
array[]

Definition at line 1864 of file class.ilUserImportParser.php.

1864 : array
1865 {
1866 return $this->roles;
1867 }

◆ getCourseMembersObjectForRole()

ilUserImportParser::getCourseMembersObjectForRole ( int  $a_role_id)

Returns the parent object of the role folder object which contains the specified role.

Definition at line 654 of file class.ilUserImportParser.php.

655 {
656 if (array_key_exists($a_role_id . '_courseMembersObject', $this->local_role_cache)) {
657 return $this->local_role_cache[$a_role_id . '_courseMembersObject'];
658 } else {
659 $course_refs = $this->rbac_review->getFoldersAssignedToRole($a_role_id, true);
660 $course_ref = $course_refs[0];
661 $course_obj = new ilObjCourse($course_ref, true);
662 $crsmembers_obj = ilCourseParticipants::_getInstanceByObjId($course_obj->getId());
663 $this->local_role_cache[$a_role_id . '_courseMembersObject'] = $crsmembers_obj;
664 return $crsmembers_obj;
665 }
666 }
static _getInstanceByObjId(int $a_obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ilCourseParticipants\_getInstanceByObjId().

+ Here is the call graph for this function:

◆ getErrorLevel()

ilUserImportParser::getErrorLevel ( )

Returns the error level.

Returns
int IL_IMPORT_SUCCESS | IL_IMPORT_WARNING | IL_IMPORT_FAILURE

Definition at line 1970 of file class.ilUserImportParser.php.

1970 : int
1971 {
1972 return $this->error_level;
1973 }
int $error_level
This variable is used to report the error level of the validation process or the importing process.

Referenced by ilObjUserFolderGUI\verifyXmlData().

+ Here is the caller graph for this function:

◆ getFolderId()

ilUserImportParser::getFolderId ( )

Definition at line 247 of file class.ilUserImportParser.php.

247 : int
248 {
249 return $this->folder_id;
250 }

References $folder_id.

◆ getParentRoleIds()

ilUserImportParser::getParentRoleIds ( int  $a_role_id)

Get array of parent role ids from cache.

If necessary, create a new cache entry.

Returns
array[]

Definition at line 707 of file class.ilUserImportParser.php.

707 : array
708 {
709 if (!array_key_exists($a_role_id, $this->parent_roles_cache)) {
710 $parent_role_ids = [];
711
712 $role_obj = $this->getRoleObject($a_role_id);
713 $short_role_title = substr($role_obj->getTitle(), 0, 12);
714 $folders = $this->rbac_review->getFoldersAssignedToRole($a_role_id, true);
715 if (count($folders) > 0) {
716 $all_parent_role_ids = $this->rbac_review->getParentRoleIds($folders[0]);
717 foreach ($all_parent_role_ids as $parent_role_id => $parent_role_data) {
718 if ($parent_role_id != $a_role_id) {
719 switch (substr($parent_role_data['title'], 0, 12)) {
720 case 'il_crs_admin':
721 case 'il_grp_admin':
722 if ($short_role_title === 'il_crs_admin' || $short_role_title === 'il_grp_admin') {
723 $parent_role_ids[] = $parent_role_id;
724 }
725 break;
726 case 'il_crs_tutor':
727 case 'il_grp_tutor':
728 if ($short_role_title === 'il_crs_tutor' || $short_role_title === 'il_grp_tutor') {
729 $parent_role_ids[] = $parent_role_id;
730 }
731 break;
732 case 'il_crs_membe':
733 case 'il_grp_membe':
734 if ($short_role_title === 'il_crs_membe' || $short_role_title === 'il_grp_membe') {
735 $parent_role_ids[] = $parent_role_id;
736 }
737 break;
738 default:
739 break;
740 }
741 }
742 }
743 }
744 $this->parent_roles_cache[$a_role_id] = $parent_role_ids;
745 }
746 return $this->parent_roles_cache[$a_role_id];
747 }
getRoleObject(int $a_role_id)
Returns the parent object of the role folder object which contains the specified role.

◆ getProtocol()

ilUserImportParser::getProtocol ( )

The protocol is an associative array.

Keys are login names. Values are non-associative arrays. Each array element contains an error message.

Returns
array[]

Definition at line 1927 of file class.ilUserImportParser.php.

1927 : array
1928 {
1929 return $this->protocol;
1930 }

◆ getProtocolAsHTML()

ilUserImportParser::getProtocolAsHTML ( string  $a_log_title)

Returns the protocol as a HTML table.

Definition at line 1935 of file class.ilUserImportParser.php.

1935 : string
1936 {
1937 $block = new ilTemplate('tpl.usr_import_log_block.html', true, true, 'components/ILIAS/User');
1938 $block->setVariable('TXT_LOG_TITLE', $a_log_title);
1939 $block->setVariable('TXT_MESSAGE_ID', $this->lng->txt('login'));
1940 $block->setVariable('TXT_MESSAGE_TEXT', $this->lng->txt('message'));
1941 foreach ($this->getProtocol() as $login => $messages) {
1942 $block->setCurrentBlock('log_row');
1943 $reason = '';
1944 foreach ($messages as $message) {
1945 if ($reason == '') {
1946 $reason = $message;
1947 } else {
1948 $reason .= '<br>' . $message;
1949 }
1950 }
1951 $block->setVariable('MESSAGE_ID', $login);
1952 $block->setVariable('MESSAGE_TEXT', $reason);
1953 $block->parseCurrentBlock();
1954 }
1955 return $block->get();
1956 }
special template class to simplify handling of ITX/PEAR
getProtocol()
The protocol is an associative array.

References ILIAS\Repository\lng().

Referenced by ilObjUserFolderGUI\verifyXmlData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRoleObject()

ilUserImportParser::getRoleObject ( int  $a_role_id)

Returns the parent object of the role folder object which contains the specified role.

Definition at line 639 of file class.ilUserImportParser.php.

639 : ilObjRole
640 {
641 if (array_key_exists($a_role_id, $this->local_role_cache)) {
642 return $this->local_role_cache[$a_role_id];
643 } else {
644 $role_obj = new ilObjRole($a_role_id, false);
645 $role_obj->read();
646 $this->local_role_cache[$a_role_id] = $role_obj;
647 return $role_obj;
648 }
649 }
Class ilObjRole.

◆ getUserCount()

ilUserImportParser::getUserCount ( )

Definition at line 1869 of file class.ilUserImportParser.php.

1869 : int
1870 {
1871 return $this->user_count;
1872 }

◆ getUserMapping()

ilUserImportParser::getUserMapping ( )

returns a map user_id <=> login

Returns
array with user_id as key and login as value

Definition at line 1979 of file class.ilUserImportParser.php.

1979 : array
1980 {
1981 return $this->user_mapping;
1982 }

◆ getUserMappingMode()

ilUserImportParser::getUserMappingMode ( )

read access to user mapping mode

Returns
int one of IL_USER_MAPPING_ID or IL_USER_MAPPING_LOGIN

Definition at line 2024 of file class.ilUserImportParser.php.

2024 : int
2025 {
2026 return $this->mapping_mode;
2027 }

◆ handlerBeginTag()

ilUserImportParser::handlerBeginTag (   $a_xml_parser,
string  $a_name,
array  $a_attribs 
)

Definition at line 299 of file class.ilUserImportParser.php.

303 : void {
304 switch ($this->mode) {
306 $this->extractRolesBeginTag($a_xml_parser, $a_name, $a_attribs);
307 break;
309 $this->importBeginTag($a_xml_parser, $a_name, $a_attribs);
310 break;
311 case self::IL_VERIFY:
312 $this->verifyBeginTag($a_xml_parser, $a_name, $a_attribs);
313 break;
314 }
315
316 $this->cdata = '';
317 }
extractRolesBeginTag( $a_xml_parser, string $a_name, array $a_attribs)
verifyBeginTag( $a_xml_parser, string $a_name, array $a_attribs)
importBeginTag( $a_xml_parser, string $a_name, array $a_attribs)

References extractRolesBeginTag(), IL_EXTRACT_ROLES, IL_USER_IMPORT, IL_VERIFY, importBeginTag(), and verifyBeginTag().

Referenced by setHandlers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handlerCharacterData()

ilUserImportParser::handlerCharacterData (   $a_xml_parser,
string  $a_data 
)

handler for character data

Parameters
\XMLParser | resource$a_xml_parser

Definition at line 1848 of file class.ilUserImportParser.php.

1851 : void {
1852 if ($a_data !== "\n") {
1853 $a_data = preg_replace('/\t+/', ' ', $a_data);
1854 }
1855
1856 if (strlen($a_data) > 0) {
1857 $this->cdata .= $a_data;
1858 }
1859 }

Referenced by setHandlers().

+ Here is the caller graph for this function:

◆ handlerEndTag()

ilUserImportParser::handlerEndTag (   $a_xml_parser,
string  $a_name 
)

Definition at line 603 of file class.ilUserImportParser.php.

606 : void {
607 switch ($this->mode) {
609 $this->extractRolesEndTag($a_xml_parser, $a_name);
610 break;
612 $this->importEndTag($a_xml_parser, $a_name);
613 break;
614 case self::IL_VERIFY:
615 $this->verifyEndTag($a_xml_parser, $a_name);
616 break;
617 }
618 }
importEndTag( $a_xml_parser, string $a_name)
extractRolesEndTag( $a_xml_parser, string $a_name)
verifyEndTag( $a_xml_parser, string $a_name)
handler for end of element when in verify mode.

Referenced by setHandlers().

+ Here is the caller graph for this function:

◆ importBeginTag()

ilUserImportParser::importBeginTag (   $a_xml_parser,
string  $a_name,
array  $a_attribs 
)
Parameters
\XMLParser | resource$a_xml_parser

Definition at line 343 of file class.ilUserImportParser.php.

347 : void {
348 switch ($a_name) {
349 case 'Role':
350 $current_role_id = $a_attribs['Id'];
351 if (($internal_id = ilUtil::__extractId($current_role_id, (int) IL_INST_ID)) > 0) {
352 $current_role_id = $internal_id;
353 }
354 $this->current_role_id = (string) $current_role_id;
355 $this->current_role_type = $a_attribs['Type'];
356 $this->current_role_action = (!isset($a_attribs['Action'])) ? 'Assign' : $a_attribs['Action'];
357 break;
358
359 case 'PersonalPicture':
360 $this->personal_picture = [
361 'encoding' => $a_attribs['encoding'],
362 'imagetype' => $a_attribs['imagetype'],
363 'content' => ''
364 ];
365 break;
366
367 case 'Look':
368 $this->skin = $a_attribs['Skin'];
369 $this->style = $a_attribs['Style'];
370 break;
371
372 case 'User':
373 $this->contained_tags = [];
374
375 $this->acc_mail->reset();
376 $this->prefs = [];
377 $this->current_pref_key = null;
378 $this->auth_mode_set = false;
379 $this->approve_date_set = false;
380 $this->time_limit_set = false;
381 $this->time_limit_owner_set = false;
382 $this->update_look_and_skin = false;
383 $this->skin = '';
384 $this->style = '';
385 $this->personal_picture = null;
386 $this->user_count++;
387 $this->user_obj = new ilObjUser();
388
389 // user defined fields
390 $this->udf_data = [];
391
392 // if we have an object id, store it
393 $this->user_id = -1;
394 if (isset($a_attribs['Id']) && $this->getUserMappingMode() === self::IL_USER_MAPPING_ID) {
395 if (is_numeric($a_attribs['Id'])) {
396 $this->user_id = (int) $a_attribs['Id'];
397 } elseif (($id = (int) ilUtil::__extractId($a_attribs['Id'], (int) IL_INST_ID)) > 0) {
398 $this->user_id = $id;
399 }
400 }
401
402 $this->user_obj->setPref(
403 'skin',
404 $this->ilias->ini->readVariable('layout', 'skin')
405 );
406 $this->user_obj->setPref(
407 'style',
408 $this->ilias->ini->readVariable('layout', 'style')
409 );
410
411 if (isset($a_attribs['Language'])) {
412 $this->contained_tags[] = 'Language';
413 }
414 $this->user_obj->setLanguage($a_attribs['Language'] ?? '');
415 $this->user_obj->setImportId($a_attribs['Id'] ?? '');
416 $this->action = (is_null($a_attribs['Action'])) ? 'Insert' : $a_attribs['Action'];
417 $this->current_user_password = null;
418 $this->current_user_password_type = null;
419 $this->currActive = null;
420 $this->multi_values = [];
421 break;
422
423 case 'Password':
424 $this->current_user_password_type = $a_attribs['Type'];
425 break;
426 case 'AuthMode':
427 if (array_key_exists('type', $a_attribs)) {
428 switch ($a_attribs['type']) {
429 case 'saml':
430 case 'ldap':
431 if (strcmp('saml', $a_attribs['type']) === 0) {
433 if (count($list) === 1) {
434 $this->auth_mode_set = true;
435 $idp = current($list);
436 $this->user_obj->setAuthMode('saml_' . $idp->getIdpId());
437 }
438 break;
439 }
440 if (strcmp('ldap', $a_attribs['type']) === 0) {
441 // no server id provided => use default server
443 if (count($list) == 1) {
444 $this->auth_mode_set = true;
445 $ldap_id = current($list);
446 $this->user_obj->setAuthMode('ldap_' . $ldap_id);
447 }
448 }
449 break;
450
451 case 'default':
452 case 'local':
453 case 'shibboleth':
454 case 'script':
455 case 'soap':
456 case 'openid':
457 // begin-patch auth_plugin
458 default:
459 $this->auth_mode_set = true;
460 $this->user_obj->setAuthMode($a_attribs['type']);
461 break;
462 }
463 } else {
464 $this->logFailure(
465 $this->user_obj->getLogin(),
466 sprintf($this->lng->txt('usrimport_xml_element_inapplicable'), 'AuthMode', $this->stripTags($a_attribs['type']))
467 );
468 }
469 break;
470
471 case 'UserDefinedField':
472 $this->tmp_udf_id = $a_attribs['Id'];
473 $this->tmp_udf_name = $a_attribs['Name'];
474 break;
475
476 case 'AccountInfo':
477 $this->current_messenger_type = strtolower($a_attribs['Type']);
478 break;
479 case 'GMapInfo':
480 $this->user_obj->setLatitude($a_attribs['latitude']);
481 $this->user_obj->setLongitude($a_attribs['longitude']);
482 $this->user_obj->setLocationZoom($a_attribs['zoom']);
483 break;
484 case 'Pref':
485 $this->current_pref_key = $a_attribs['key'];
486 break;
487 }
488 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
static _getActiveServerList()
Get active server list.
static getActiveIdpList()
logFailure(string $aLogin, string $aMessage)
Writes a failure log message to the protocol.
getUserMappingMode()
read access to user mapping mode
Class ilObjForumAdministration.

References $id, ilUtil\__extractId(), ilLDAPServer\_getActiveServerList(), ilSamlIdp\getActiveIdpList(), IL_INST_ID, ILIAS\Repository\int(), and ILIAS\Repository\lng().

Referenced by handlerBeginTag().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ importEndTag()

ilUserImportParser::importEndTag (   $a_xml_parser,
string  $a_name 
)
Parameters
\XMLParser | resource$a_xml_parser

Definition at line 796 of file class.ilUserImportParser.php.

799 : void {
800 $this->contained_tags[] = $a_name;
801
802 switch ($a_name) {
803 case 'Role':
804 $this->roles[$this->current_role_id]['name'] = $this->cdata;
805 $this->roles[$this->current_role_id]['type'] = $this->current_role_type;
806 $this->roles[$this->current_role_id]['action'] = $this->current_role_action;
807 break;
808
809 case 'PersonalPicture':
810 switch ($this->personal_picture['encoding']) {
811 case 'Base64':
812 $this->personal_picture['content'] = base64_decode($this->cdata);
813 break;
814 case 'UUEncode':
815 $this->personal_picture['content'] = convert_uudecode($this->cdata);
816 break;
817 }
818 break;
819
820 case 'User':
821 $this->user_obj->setFullname();
822 // Fetch the user_id from the database, if we didn't have it in xml file
823 // fetch as well, if we are trying to insert -> recognize duplicates!
824 if ($this->user_id == -1 || $this->action === 'Insert') {
825 $user_id = ilObjUser::getUserIdByLogin($this->user_obj->getLogin());
826 } else {
828 }
829
830 if ($user_id === (int) ANONYMOUS_USER_ID || $user_id === (int) SYSTEM_USER_ID) {
831 return;
832 }
833
834 // Handle conflicts
835 switch ($this->conflict_rule) {
837 // do not change action
838 break;
840 switch ($this->action) {
841 case 'Insert':
842 if ($user_id) {
843 $this->logWarning($this->user_obj->getLogin(), sprintf($this->lng->txt('usrimport_action_replaced'), 'Insert', 'Update'));
844 $this->action = 'Update';
845 }
846 break;
847 case 'Update':
848 if (!$user_id) {
849 $this->logWarning($this->user_obj->getLogin(), sprintf($this->lng->txt('usrimport_action_replaced'), 'Update', 'Insert'));
850 $this->action = 'Insert';
851 }
852 break;
853 case 'Delete':
854 if (!$user_id) {
855 $this->logWarning($this->user_obj->getLogin(), sprintf($this->lng->txt('usrimport_action_ignored'), 'Delete'));
856 $this->action = 'Ignore';
857 }
858 break;
859 }
860 break;
862 switch ($this->action) {
863 case 'Insert':
864 if ($user_id) {
865 $this->logWarning($this->user_obj->getLogin(), sprintf($this->lng->txt('usrimport_action_ignored'), 'Insert'));
866 $this->action = 'Ignore';
867 }
868 break;
869 case 'Update':
870 if (!$user_id) {
871 $this->logWarning($this->user_obj->getLogin(), sprintf($this->lng->txt('usrimport_action_ignored'), 'Update'));
872 $this->action = 'Ignore';
873 }
874 break;
875 case 'Delete':
876 if (!$user_id) {
877 $this->logWarning($this->user_obj->getLogin(), sprintf($this->lng->txt('usrimport_action_ignored'), 'Delete'));
878 $this->action = 'Ignore';
879 }
880 break;
881 }
882 break;
883 }
884
885 // check external account conflict (if external account is already used)
886 // note: we cannot apply conflict rules in the same manner as to logins here
887 // so we ignore records with already existing external accounts.
888 //echo $this->userObj->getAuthMode().'h';
889 $am = ($this->user_obj->getAuthMode() === 'default' || $this->user_obj->getAuthMode() == '')
890 ? ilAuthUtils::_getAuthModeName($this->settings->get('auth_mode'))
891 : $this->user_obj->getAuthMode();
892 $loginForExternalAccount = ($this->user_obj->getExternalAccount() == '')
893 ? ''
894 : ilObjUser::_checkExternalAuthAccount($am, $this->user_obj->getExternalAccount());
895 switch ($this->action) {
896 case 'Insert':
897 if ($loginForExternalAccount != '') {
898 $this->logWarning(
899 $this->user_obj->getLogin(),
900 $this->lng->txt('usrimport_no_insert_ext_account_exists')
901 . ' (' . $this->stripTags($this->user_obj->getExternalAccount()) . ')'
902 );
903 $this->action = 'Ignore';
904 }
905 break;
906
907 case 'Update':
908 // this variable describes the ILIAS login which belongs to the given external account!!!
909 // it is NOT nescessarily the ILIAS login of the current user record !!
910 // so if we found an ILIAS login according to the authentication method
911 // check if the ILIAS login belongs to the current user record, otherwise somebody else is using it!
912 if ($loginForExternalAccount != '') {
913 // check if we changed the value!
914 $externalAccountHasChanged = $this->user_obj->getExternalAccount() != ilObjUser::_lookupExternalAccount($this->user_id);
915 // if it has changed and the external login
916 if ($externalAccountHasChanged && trim($loginForExternalAccount) != trim($this->user_obj->getLogin())) {
917 $this->logWarning(
918 $this->user_obj->getLogin(),
919 $this->lng->txt('usrimport_no_update_ext_account_exists')
920 . ' (' . $this->stripTags($this->user_obj->getExternalAccount()) . ')'
921 );
922 $this->action = 'Ignore';
923 }
924 }
925 break;
926 }
927
928 if (count($this->multi_values)) {
929 if (isset($this->multi_values['GeneralInterest'])) {
930 $this->user_obj->setGeneralInterests($this->multi_values['GeneralInterest']);
931 }
932 if (isset($this->multi_values['OfferingHelp'])) {
933 $this->user_obj->setOfferingHelp($this->multi_values['OfferingHelp']);
934 }
935 if (isset($this->multi_values['LookingForHelp'])) {
936 $this->user_obj->setLookingForHelp($this->multi_values['LookingForHelp']);
937 }
938 }
939
940 // Perform the action
941 switch ($this->action) {
942 case 'Insert':
943 if ($user_id) {
944 $this->logFailure($this->user_obj->getLogin(), $this->lng->txt('usrimport_cant_insert'));
945 } else {
946 if ($this->current_user_password !== null) {
947 switch (strtoupper($this->current_user_password_type)) {
948 case 'BCRYPT':
949 $this->user_obj->setPasswd($this->current_user_password, ilObjUser::PASSWD_CRYPTED);
950 $this->user_obj->setPasswordEncodingType('bcryptphp');
951 $this->user_obj->setPasswordSalt(null);
952 break;
953
954 case 'PLAIN':
955 $this->user_obj->setPasswd($this->current_user_password, ilObjUser::PASSWD_PLAIN);
956 $this->acc_mail->setUserPassword((string) $this->current_user_password);
957 break;
958
959 default:
960 $this->logFailure($this->user_obj->getLogin(), sprintf($this->lng->txt('usrimport_xml_attribute_value_illegal'), 'Type', 'Password', $this->stripTags($this->current_user_password_type)));
961 break;
962 }
963 } else {
964 // this does the trick for empty passwords
965 // since a MD5 string has always 32 characters,
966 // no hashed password combination will ever equal to
967 // an empty string
968 $this->user_obj->setPasswd('', ilObjUser::PASSWD_CRYPTED);
969 }
970
971 $this->user_obj->setTitle($this->user_obj->getFullname());
972 $this->user_obj->setDescription($this->user_obj->getEmail());
973
974 if (!$this->time_limit_owner_set) {
975 $this->user_obj->setTimeLimitOwner($this->getFolderId());
976 }
977
978 // default time limit settings
979 if (!$this->time_limit_set) {
980 $this->user_obj->setTimeLimitUnlimited(true);
981
982 if (!$this->approve_date_set) {
983 $this->user_obj->setApproveDate(date('Y-m-d H:i:s'));
984 }
985 }
986
987
988 $this->user_obj->setActive($this->currActive === 'true' || is_null($this->currActive));
989
990 // Finally before saving new user.
991 // Check if profile is incomplete
992
993 // #8759
994 if ($this->udf_data !== []) {
995 $this->user_obj = $this->addUDFDataToUser($this->user_obj);
996 }
997
998 if (!$this->user_obj->getLanguage()) {
999 $this->user_obj->setLanguage($this->lng->getDefaultLanguage());
1000 }
1001
1002 $this->user_obj->setProfileIncomplete($this->checkProfileIncomplete($this->user_obj));
1003 $this->user_obj->create();
1004
1005 //insert user data in table user_data
1006 $this->user_obj->saveAsNew();
1007
1008 if (count($this->prefs)) {
1009 foreach ($this->prefs as $key => $value) {
1010 if ($key !== 'mail_incoming_type' &&
1011 $key !== 'mail_signature' &&
1012 $key !== 'mail_linebreak'
1013 ) {
1014 $this->user_obj->setPref($key, $value);
1015 }
1016 }
1017 }
1018
1019 if (!is_array($this->prefs) || !array_key_exists('chat_osc_accept_msg', $this->prefs)) {
1020 $this->user_obj->setPref('chat_osc_accept_msg', $this->settings->get('chat_osc_accept_msg', 'n'));
1021 }
1022 if (!is_array($this->prefs) || !array_key_exists('chat_broadcast_typing', $this->prefs)) {
1023 $this->user_obj->setPref('chat_broadcast_typing', $this->settings->get('chat_broadcast_typing', 'n'));
1024 }
1025 if (!is_array($this->prefs) || !array_key_exists('bs_allow_to_contact_me', $this->prefs)) {
1026 $this->user_obj->setPref('bs_allow_to_contact_me', $this->settings->get('bs_allow_to_contact_me', 'n'));
1027 }
1028
1029 $this->user_obj->update();
1030
1031 // update mail preferences, to be extended
1032 $this->updateMailPreferences($this->user_obj->getId());
1033
1034 if (is_array($this->personal_picture)) {
1035 if (strlen($this->personal_picture['content'])) {
1036 $extension = 'jpg';
1037 if (preg_match('/.*(png|jpg|gif|jpeg)$/', $this->personal_picture['imagetype'], $matches)) {
1038 $extension = $matches[1];
1039 }
1040 $tmp_name = $this->saveTempImage($this->personal_picture['content'], ".{$extension}");
1041 if (strlen($tmp_name)) {
1042 $this->user_obj->uploadPersonalPicture($tmp_name);
1043 unlink($tmp_name);
1044 }
1045 }
1046 }
1047
1048 //set role entries
1049 foreach ($this->roles as $role_id => $role) {
1050 if (isset($this->role_assign[$role_id]) && $this->role_assign[$role_id]) {
1051 $this->assignToRole($this->user_obj, (int) $this->role_assign[$role_id]);
1052 }
1053 }
1054
1055 $this->sendAccountMail();
1056 $this->logSuccess($this->user_obj->getLogin(), $this->user_obj->getId(), 'Insert');
1057 // reset account mail object
1058 $this->acc_mail->reset();
1059 }
1060 break;
1061
1062 case 'Update':
1063 if (!$user_id) {
1064 $this->logFailure($this->user_obj->getLogin(), $this->lng->txt('usrimport_cant_update'));
1065 } else {
1066 $update_user = new ilObjUser($user_id);
1067 $update_user->read();
1068 if ($this->current_user_password != null) {
1069 switch (strtoupper($this->current_user_password_type)) {
1070 case 'BCRYPT':
1071 $update_user->setPasswd($this->current_user_password, ilObjUser::PASSWD_CRYPTED);
1072 $update_user->setPasswordEncodingType('bcryptphp');
1073 $update_user->setPasswordSalt(null);
1074 break;
1075
1076 case 'PLAIN':
1077 $update_user->setPasswd($this->current_user_password, ilObjUser::PASSWD_PLAIN);
1078 $this->acc_mail->setUserPassword((string) $this->current_user_password);
1079 break;
1080
1081 default:
1082 $this->logFailure($this->user_obj->getLogin(), sprintf($this->lng->txt('usrimport_xml_attribute_value_illegal'), 'Type', 'Password', $this->stripTags($this->current_user_password_type)));
1083 break;
1084 }
1085 }
1086 if ($this->tagContained('Firstname')) {
1087 $update_user->setFirstname($this->user_obj->getFirstname());
1088 }
1089 if ($this->tagContained('Lastname')) {
1090 $update_user->setLastname($this->user_obj->getLastname());
1091 }
1092 if ($this->tagContained('Title')) {
1093 $update_user->setUTitle($this->user_obj->getUTitle());
1094 }
1095 if ($this->tagContained('Gender')) {
1096 $update_user->setGender($this->user_obj->getGender());
1097 }
1098 if ($this->tagContained('Email')) {
1099 $update_user->setEmail($this->user_obj->getEmail());
1100 }
1101 if ($this->tagContained('SecondEmail')) {
1102 $update_user->setSecondEmail($this->user_obj->getSecondEmail());
1103 }
1104 if ($this->tagContained('Birthday')) {
1105 $update_user->setBirthday($this->user_obj->getBirthday());
1106 }
1107 if ($this->tagContained('Institution')) {
1108 $update_user->setInstitution($this->user_obj->getInstitution());
1109 }
1110 if ($this->tagContained('Street')) {
1111 $update_user->setStreet($this->user_obj->getStreet());
1112 }
1113 if ($this->tagContained('City')) {
1114 $update_user->setCity($this->user_obj->getCity());
1115 }
1116 if ($this->tagContained('PostalCode')) {
1117 $update_user->setZipcode($this->user_obj->getZipcode());
1118 }
1119 if ($this->tagContained('SelCountry') && mb_strlen($this->cdata) === 2) {
1120 $update_user->setCountry($this->user_obj->getCountry());
1121 }
1122 if ($this->tagContained('PhoneOffice')) {
1123 $update_user->setPhoneOffice($this->user_obj->getPhoneOffice());
1124 }
1125 if ($this->tagContained('PhoneHome')) {
1126 $update_user->setPhoneHome($this->user_obj->getPhoneHome());
1127 }
1128 if ($this->tagContained('PhoneMobile')) {
1129 $update_user->setPhoneMobile($this->user_obj->getPhoneMobile());
1130 }
1131 if ($this->tagContained('Fax')) {
1132 $update_user->setFax($this->user_obj->getFax());
1133 }
1134 if ($this->tagContained('Hobby')) {
1135 $update_user->setHobby($this->user_obj->getHobby());
1136 }
1137 if ($this->tagContained('GeneralInterest')) {
1138 $update_user->setGeneralInterests($this->user_obj->getGeneralInterests());
1139 }
1140 if ($this->tagContained('OfferingHelp')) {
1141 $update_user->setOfferingHelp($this->user_obj->getOfferingHelp());
1142 }
1143 if ($this->tagContained('LookingForHelp')) {
1144 $update_user->setLookingForHelp($this->user_obj->getLookingForHelp());
1145 }
1146 if ($this->tagContained('Comment')) {
1147 $update_user->setComment($this->user_obj->getComment());
1148 }
1149 if ($this->tagContained('Department')) {
1150 $update_user->setDepartment($this->user_obj->getDepartment());
1151 }
1152 if ($this->tagContained('Matriculation')) {
1153 $update_user->setMatriculation($this->user_obj->getMatriculation());
1154 }
1155 if (!is_null($this->currActive)) {
1156 $update_user->setActive($this->currActive === 'true', is_object($this->user) ? $this->user->getId() : 0);
1157 }
1158 if ($this->tagContained('ClientIP')) {
1159 $update_user->setClientIP($this->user_obj->getClientIP());
1160 }
1161 if ($this->time_limit_set) {
1162 $update_user->setTimeLimitUnlimited($this->user_obj->getTimeLimitUnlimited());
1163 }
1164 if ($this->tagContained('TimeLimitFrom')) {
1165 $update_user->setTimeLimitFrom($this->user_obj->getTimeLimitFrom());
1166 }
1167 if ($this->tagContained('TimeLimitUntil')) {
1168 $update_user->setTimeLimitUntil($this->user_obj->getTimeLimitUntil());
1169 }
1170 if ($this->tagContained('ApproveDate')) {
1171 $update_user->setApproveDate($this->user_obj->getApproveDate());
1172 }
1173 if ($this->tagContained('AgreeDate')) {
1174 $update_user->setAgreeDate($this->user_obj->getAgreeDate());
1175 }
1176 if ($this->tagContained('Language')) {
1177 $update_user->setLanguage($this->user_obj->getLanguage());
1178 }
1179 if ($this->tagContained('ExternalAccount')) {
1180 $update_user->setExternalAccount($this->user_obj->getExternalAccount());
1181 }
1182
1183 // Fixed: if auth_mode is not set, it was always overwritten with auth_default
1184 #if (! is_null($this->userObj->getAuthMode())) $updateUser->setAuthMode($this->userObj->getAuthMode());
1185 if ($this->auth_mode_set) {
1186 $update_user->setAuthMode($this->user_obj->getAuthMode());
1187 }
1188
1189 // Special handlin since it defaults to 7 (USER_FOLDER_ID)
1190 if ($this->time_limit_owner_set) {
1191 $update_user->setTimeLimitOwner($this->user_obj->getTimeLimitOwner());
1192 }
1193
1194 if (count($this->prefs)) {
1195 foreach ($this->prefs as $key => $value) {
1196 if ($key !== 'mail_incoming_type' &&
1197 $key !== 'mail_signature' &&
1198 $key !== 'mail_linebreak'
1199 ) {
1200 $update_user->setPref($key, $value);
1201 }
1202 }
1203 }
1204
1205 // save user preferences (skin and style)
1206 if ($this->update_look_and_skin) {
1207 $update_user->setPref('skin', $this->user_obj->getPref('skin'));
1208 $update_user->setPref('style', $this->user_obj->getPref('style'));
1209 }
1210
1211 // update mail preferences, to be extended
1212 $this->updateMailPreferences($update_user->getId());
1213
1214 // #8759
1215 if ($this->udf_data !== []) {
1216 $update_user = $this->addUDFDataToUser($update_user);
1217 }
1218
1219 $update_user->setProfileIncomplete($this->checkProfileIncomplete($update_user));
1220 $update_user->setFullname();
1221 $update_user->setTitle($update_user->getFullname());
1222 $update_user->setDescription($update_user->getEmail());
1223 $update_user->update();
1224
1225 // update login
1226 if ($this->tagContained('Login') && $this->user_id != -1) {
1227 try {
1228 $update_user->updateLogin($this->user_obj->getLogin(), Context::UserAdministration);
1229 } catch (ilUserException $e) {
1230 }
1231 }
1232
1233
1234 // if language has changed
1235
1236 if (is_array($this->personal_picture)) {
1237 if (strlen($this->personal_picture['content'])) {
1238 $extension = 'jpg';
1239 if (preg_match('/.*(png|jpg|gif|jpeg)$/', $this->personal_picture['imagetype'], $matches)) {
1240 $extension = $matches[1];
1241 }
1242 $tmp_name = $this->saveTempImage($this->personal_picture['content'], ".{$extension}");
1243 if (strlen($tmp_name)) {
1244 $update_user->uploadPersonalPicture($tmp_name);
1245 unlink($tmp_name);
1246 }
1247 }
1248 }
1249
1250
1251 //update role entries
1252 //-------------------
1253 foreach ($this->roles as $role_id => $role) {
1254 if (array_key_exists($role_id, $this->role_assign)) {
1255 switch ($role['action']) {
1256 case 'Assign':
1257 $this->assignToRole($update_user, (int) $this->role_assign[$role_id]);
1258 break;
1259 case 'AssignWithParents':
1260 $this->assignToRoleWithParents($update_user, (int) $this->role_assign[$role_id]);
1261 break;
1262 case 'Detach':
1263 $this->detachFromRole($update_user, (int) $this->role_assign[$role_id]);
1264 break;
1265 }
1266 }
1267 }
1268 $this->logSuccess($update_user->getLogin(), $user_id, 'Update');
1269 }
1270 break;
1271 case 'Delete':
1272 if (!$user_id) {
1273 $this->logFailure($this->user_obj->getLogin(), $this->lng->txt('usrimport_cant_delete'));
1274 } else {
1275 $deleteUser = new ilObjUser($user_id);
1276 $deleteUser->delete();
1277
1278 $this->logSuccess($this->user_obj->getLogin(), $user_id, 'Delete');
1279 }
1280 break;
1281 }
1282
1283 // init role array for next user
1284 $this->roles = [];
1285 break;
1286
1287 case 'Login':
1288 $this->user_obj->setLogin($this->getCDataWithoutTags($this->cdata));
1289 break;
1290
1291 case 'Password':
1292 $this->current_user_password = $this->cdata;
1293 break;
1294
1295 case 'Firstname':
1296 $this->user_obj->setFirstname($this->getCDataWithoutTags($this->cdata));
1297 break;
1298
1299 case 'Lastname':
1300 $this->user_obj->setLastname($this->getCDataWithoutTags($this->cdata));
1301 break;
1302
1303 case 'Title':
1304 $this->user_obj->setUTitle($this->getCDataWithoutTags($this->cdata));
1305 break;
1306
1307 case 'Gender':
1308 $this->user_obj->setGender($this->cdata);
1309 break;
1310
1311 case 'Email':
1312 $this->user_obj->setEmail($this->getCDataWithoutTags($this->cdata));
1313 break;
1314 case 'SecondEmail':
1315 $this->user_obj->setSecondEmail($this->getCDataWithoutTags($this->cdata));
1316 break;
1317 case 'Birthday':
1318 $birthday = $this->getCDataWithoutTags($this->cdata);
1319 if (strtotime($birthday) !== false) {
1320 $this->user_obj->setBirthday($birthday);
1321 }
1322 break;
1323 case 'Institution':
1324 $this->user_obj->setInstitution($this->getCDataWithoutTags($this->cdata));
1325 break;
1326
1327 case 'Street':
1328 $this->user_obj->setStreet($this->getCDataWithoutTags($this->cdata));
1329 break;
1330
1331 case 'City':
1332 $this->user_obj->setCity($this->getCDataWithoutTags($this->cdata));
1333 break;
1334
1335 case 'PostalCode':
1336 $this->user_obj->setZipcode($this->getCDataWithoutTags($this->cdata));
1337 break;
1338
1339 case 'Country':
1340 case 'SelCountry':
1341 if (mb_strlen($this->cdata) !== 2) {
1342 break;
1343 }
1344 $this->user_obj->setCountry($this->getCDataWithoutTags($this->cdata));
1345 break;
1346
1347 case 'PhoneOffice':
1348 $this->user_obj->setPhoneOffice($this->getCDataWithoutTags($this->cdata));
1349 break;
1350
1351 case 'PhoneHome':
1352 $this->user_obj->setPhoneHome($this->getCDataWithoutTags($this->cdata));
1353 break;
1354
1355 case 'PhoneMobile':
1356 $this->user_obj->setPhoneMobile($this->getCDataWithoutTags($this->cdata));
1357 break;
1358
1359 case 'Fax':
1360 $this->user_obj->setFax($this->getCDataWithoutTags($this->cdata));
1361 break;
1362
1363 case 'Hobby':
1364 $this->user_obj->setHobby($this->getCDataWithoutTags($this->cdata));
1365 break;
1366
1367 case 'GeneralInterest':
1368 case 'OfferingHelp':
1369 case 'LookingForHelp':
1370 $this->multi_values[$a_name][] = $this->getCDataWithoutTags($this->cdata);
1371 break;
1372
1373 case 'Comment':
1374 $this->user_obj->setComment($this->getCDataWithoutTags($this->cdata));
1375 break;
1376
1377 case 'Department':
1378 $this->user_obj->setDepartment($this->getCDataWithoutTags($this->cdata));
1379 break;
1380
1381 case 'Matriculation':
1382 $this->user_obj->setMatriculation($this->getCDataWithoutTags($this->cdata));
1383 break;
1384
1385 case 'Active':
1386 $this->currActive = $this->cdata;
1387 break;
1388
1389 case 'ClientIP':
1390 $this->user_obj->setClientIP($this->getCDataWithoutTags($this->cdata));
1391 break;
1392
1393 case 'TimeLimitOwner':
1394 $this->time_limit_owner_set = true;
1395 $this->user_obj->setTimeLimitOwner((int) $this->cdata);
1396 break;
1397
1398 case 'TimeLimitUnlimited':
1399 $this->time_limit_set = true;
1400 $this->user_obj->setTimeLimitUnlimited((bool) $this->cdata);
1401 break;
1402
1403 case 'TimeLimitFrom':
1404 if (is_numeric($this->cdata)) {
1405 // Treat cdata as a unix timestamp
1406 $this->user_obj->setTimeLimitFrom((int) $this->cdata);
1407 } else {
1408 // Try to convert cdata into unix timestamp, or ignore it
1409 $timestamp = strtotime($this->cdata);
1410 if ($timestamp !== false && trim($this->cdata) !== '0000-00-00 00:00:00') {
1411 $this->user_obj->setTimeLimitFrom($timestamp);
1412 } elseif ($this->cdata === '0000-00-00 00:00:00') {
1413 $this->user_obj->setTimeLimitFrom(null);
1414 }
1415 }
1416 break;
1417
1418 case 'TimeLimitUntil':
1419 if (is_numeric($this->cdata)) {
1420 // Treat cdata as a unix timestamp
1421 $this->user_obj->setTimeLimitUntil((int) $this->cdata);
1422 } else {
1423 // Try to convert cdata into unix timestamp, or ignore it
1424 $timestamp = strtotime($this->cdata);
1425 if ($timestamp !== false && trim($this->cdata) !== '0000-00-00 00:00:00') {
1426 $this->user_obj->setTimeLimitUntil($timestamp);
1427 } elseif ($this->cdata === '0000-00-00 00:00:00') {
1428 $this->user_obj->setTimeLimitUntil(null);
1429 }
1430 }
1431 break;
1432
1433 case 'ApproveDate':
1434 $this->approve_date_set = true;
1435 if (is_numeric($this->cdata)) {
1436 // Treat cdata as a unix timestamp
1437 $tmp_date = new ilDateTime($this->cdata, IL_CAL_UNIX);
1438 $this->user_obj->setApproveDate($tmp_date->get(IL_CAL_DATETIME));
1439 } else {
1440 // Try to convert cdata into unix timestamp, or ignore it
1441 $timestamp = strtotime($this->cdata);
1442 if ($timestamp !== false && trim($this->cdata) !== '0000-00-00 00:00:00') {
1443 $tmp_date = new ilDateTime($timestamp, IL_CAL_UNIX);
1444 $this->user_obj->setApproveDate($tmp_date->get(IL_CAL_DATETIME));
1445 } elseif ($this->cdata === '0000-00-00 00:00:00') {
1446 $this->user_obj->setApproveDate(null);
1447 }
1448 }
1449 break;
1450
1451 case 'AgreeDate':
1452 if (is_numeric($this->cdata)) {
1453 // Treat cdata as a unix timestamp
1454 $tmp_date = new ilDateTime($this->cdata, IL_CAL_UNIX);
1455 $this->user_obj->setAgreeDate($tmp_date->get(IL_CAL_DATETIME));
1456 } else {
1457 // Try to convert cdata into unix timestamp, or ignore it
1458 $timestamp = strtotime($this->cdata);
1459 if ($timestamp !== false && trim($this->cdata) !== '0000-00-00 00:00:00') {
1460 $tmp_date = new ilDateTime($timestamp, IL_CAL_UNIX);
1461 $this->user_obj->setAgreeDate($tmp_date->get(IL_CAL_DATETIME));
1462 } elseif ($this->cdata === '0000-00-00 00:00:00') {
1463 $this->user_obj->setAgreeDate(null);
1464 }
1465 }
1466 break;
1467
1468 case 'ExternalAccount':
1469 $this->user_obj->setExternalAccount($this->getCDataWithoutTags($this->cdata));
1470 break;
1471
1472 case 'Look':
1473 $this->update_look_and_skin = false;
1474 if ($this->skin !== '' && $this->style !== '') {
1475 if (is_array($this->user_styles)) {
1476 if (in_array($this->skin . ':' . $this->style, $this->user_styles)) {
1477 $this->user_obj->setPref('skin', $this->skin);
1478 $this->user_obj->setPref('style', $this->style);
1479 $this->update_look_and_skin = true;
1480 }
1481 }
1482 }
1483 break;
1484
1485 case 'UserDefinedField':
1486 $field_id = $this->fetchFieldIdFromImportId($this->tmp_udf_id);
1487
1488 if ($field_id === null) {
1489 $field_id = $this->fetchFieldIdFromName($this->tmp_udf_name);
1490 }
1491
1492 if ($field_id === null) {
1493 break;
1494 }
1495
1496 $this->udf_data[$field_id] = strip_tags($this->cdata, ilRTESettings::_getUsedHTMLTags('textarea'));
1497
1498 break;
1499 case 'AccountInfo':
1500 if ($this->current_messenger_type === 'external') {
1501 $this->user_obj->setExternalAccount($this->cdata);
1502 }
1503 break;
1504 case 'Pref':
1505 if ($this->current_pref_key != null && strlen(trim($this->cdata)) > 0
1506 && ilUserXMLWriter::isPrefExportable($this->current_pref_key)) {
1507 $this->prefs[$this->current_pref_key] = trim($this->cdata);
1508 }
1509 $this->current_pref_key = null;
1510 break;
1511 }
1512 }
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:70
const IL_CAL_UNIX
const IL_CAL_DATETIME
static _getAuthModeName($a_auth_key)
@classDescription Date and time handling
const PASSWD_CRYPTED
static _lookupExternalAccount(int $a_user_id)
const PASSWD_PLAIN
static getUserIdByLogin(string $a_login)
static _checkExternalAuthAccount(string $a_auth, string $a_account, bool $tryFallback=true)
check whether external account and authentication method matches with a user
static _getUsedHTMLTags(string $module='')
detachFromRole(ilObjUser $a_user_obj, int $a_role_id)
Detaches a user from a role.
addUDFDataToUser(\ilObjUser $user)
logSuccess(string $aLogin, int $userid, string $action)
Writes a success log message to the protocol.
checkProfileIncomplete(ilObjUser $user_obj)
Check if profile is incomplete Will set the usr_data field profile_incomplete if any required field i...
assignToRoleWithParents(ilObjUser $a_user_obj, int $a_role_id)
Assigns a user to a role and to all parent roles.
sendAccountMail()
send account mail
saveTempImage(string $image_data, string $filename)
Saves binary image data to a temporary image file and returns the name of the image file on success.
logWarning(string $aLogin, string $aMessage)
Writes a warning log message to the protocol.
fetchFieldIdFromImportId(string $import_id)
static isPrefExportable(string $key)
returns wether a key from db is exportable or not
const SYSTEM_USER_ID
This file contains constants for PHPStan analyis, see: https://phpstan.org/config-reference#constants...
Definition: constants.php:26
const ANONYMOUS_USER_ID
Definition: constants.php:27

References Vendor\Package\$e, $timestamp, $user_id, ilObjUser\_checkExternalAuthAccount(), ilAuthUtils\_getAuthModeName(), ilRTESettings\_getUsedHTMLTags(), ilObjUser\_lookupExternalAccount(), ANONYMOUS_USER_ID, ilObjUser\getUserIdByLogin(), IL_CAL_DATETIME, IL_CAL_UNIX, ilUserXMLWriter\isPrefExportable(), ILIAS\Repository\lng(), ilObjUser\PASSWD_CRYPTED, ilObjUser\PASSWD_PLAIN, ILIAS\Repository\settings(), SYSTEM_USER_ID, and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ isFieldRequired()

ilUserImportParser::isFieldRequired ( string  $fieldname)
private

determine if a field $fieldname is to a required field (global setting)

Parameters
$fieldnamestring value of fieldname, e.g. gender
Returns
true, if field of required fields contains fieldname as key, false otherwise.

Definition at line 2061 of file class.ilUserImportParser.php.

2061 : bool
2062 {
2063 $requiredFields = $this->readRequiredFields();
2064 $fieldname = strtolower(trim($fieldname));
2065 return array_key_exists($fieldname, $requiredFields);
2066 }

◆ isSendMail()

ilUserImportParser::isSendMail ( )

Definition at line 2001 of file class.ilUserImportParser.php.

2001 : bool
2002 {
2003 return $this->send_mail;
2004 }

◆ isSuccess()

ilUserImportParser::isSuccess ( )

Returns true, if the import was successful.

Definition at line 1961 of file class.ilUserImportParser.php.

1961 : bool
1962 {
1963 return $this->error_level === self::IL_IMPORT_SUCCESS;
1964 }

◆ logFailure()

ilUserImportParser::logFailure ( string  $aLogin,
string  $aMessage 
)

Writes a failure log message to the protocol.

Definition at line 1895 of file class.ilUserImportParser.php.

1898 : void {
1899 if (!array_key_exists($aLogin, $this->protocol)) {
1900 $this->protocol[$aLogin] = [];
1901 }
1902 if ($aMessage) {
1903 $this->protocol[$aLogin][] = $aMessage;
1904 }
1905 $this->error_level = self::IL_IMPORT_FAILURE;
1906 }

◆ logSuccess()

ilUserImportParser::logSuccess ( string  $aLogin,
int  $userid,
string  $action 
)

Writes a success log message to the protocol.

Definition at line 1911 of file class.ilUserImportParser.php.

1915 : void {
1916 $this->user_mapping[$userid] = ['login' => $aLogin, 'action' => $action, 'message' => 'successful'];
1917 }

◆ logWarning()

ilUserImportParser::logWarning ( string  $aLogin,
string  $aMessage 
)

Writes a warning log message to the protocol.

Definition at line 1877 of file class.ilUserImportParser.php.

1880 : void {
1881 if (!array_key_exists($aLogin, $this->protocol)) {
1882 $this->protocol[$aLogin] = [];
1883 }
1884 if ($aMessage) {
1885 $this->protocol[$aLogin][] = $aMessage;
1886 }
1887 if ($this->error_level === self::IL_IMPORT_SUCCESS) {
1888 $this->error_level = self::IL_IMPORT_WARNING;
1889 }
1890 }

◆ readRequiredFields()

ilUserImportParser::readRequiredFields ( )
private
Returns
array[]

Definition at line 2032 of file class.ilUserImportParser.php.

2032 : array
2033 {
2034 if (is_array($this->required_fields)) {
2036 }
2037 foreach ($this->settings->getAll() as $field => $value) {
2038 if (strpos($field, 'require_') === 0 && $value == 1) {
2039 $value = substr($field, 8);
2040 $this->required_fields[$value] = $value;
2041 }
2042 }
2043 return $this->required_fields ?: [];
2044 }

References ILIAS\Repository\settings().

+ Here is the call graph for this function:

◆ saveTempImage()

ilUserImportParser::saveTempImage ( string  $image_data,
string  $filename 
)

Saves binary image data to a temporary image file and returns the name of the image file on success.

Definition at line 1518 of file class.ilUserImportParser.php.

1521 : string {
1522 $tempname = ilFileUtils::ilTempnam() . $filename;
1523 $fh = fopen($tempname, 'wb');
1524 if ($fh == false) {
1525 return '';
1526 }
1527 fwrite($fh, $image_data);
1528 fclose($fh);
1529 return $tempname;
1530 }
$filename
Definition: buildRTE.php:78
static ilTempnam(?string $a_temp_path=null)
Returns a unique and non existing Path for e temporary file or directory.

◆ sendAccountMail()

ilUserImportParser::sendAccountMail ( )

send account mail

Definition at line 1987 of file class.ilUserImportParser.php.

1987 : void
1988 {
1989 if ($this->req_send_mail != '' ||
1990 ($this->isSendMail() && $this->user_obj->getEmail() != '')) {
1991 $this->acc_mail->setUser($this->user_obj);
1992 $this->acc_mail->send();
1993 }
1994 }

◆ setFolderId()

ilUserImportParser::setFolderId ( int  $a_folder_id)

assign users to this folder (normally the usr_folder) But if called from local admin => the ref_id of the category

Definition at line 242 of file class.ilUserImportParser.php.

242 : void
243 {
244 $this->folder_id = $a_folder_id;
245 }

◆ setHandlers()

ilUserImportParser::setHandlers (   $a_xml_parser)

set event handler should be overwritten by inherited class @access private

Parameters
resource | \XMLParser$a_xml_parser

Reimplemented from ilSaxParser.

Definition at line 259 of file class.ilUserImportParser.php.

259 : void
260 {
261 xml_set_element_handler($a_xml_parser, $this->handlerBeginTag(...), $this->handlerEndTag(...));
262 xml_set_character_data_handler($a_xml_parser, $this->handlerCharacterData(...));
263 }
handlerBeginTag( $a_xml_parser, string $a_name, array $a_attribs)
handlerEndTag( $a_xml_parser, string $a_name)
handlerCharacterData( $a_xml_parser, string $a_data)
handler for character data

References handlerBeginTag(), handlerCharacterData(), and handlerEndTag().

+ Here is the call graph for this function:

◆ setRoleAssignment()

ilUserImportParser::setRoleAssignment ( array  $a_assign)

set import to local role assignemt

Parameters
arrayrole assignment (key: import id; value: local role id)

Definition at line 270 of file class.ilUserImportParser.php.

270 : void
271 {
272 $this->role_assign = $a_assign;
273 }

◆ setSendMail()

ilUserImportParser::setSendMail ( bool  $value)

Definition at line 1996 of file class.ilUserImportParser.php.

1996 : void
1997 {
1998 $this->send_mail = $value;
1999 }

◆ setUserMappingMode()

ilUserImportParser::setUserMappingMode ( int  $value)

write access to user mapping mode

Parameters
int$valuemust be one of IL_USER_MAPPING_ID or IL_USER_MAPPING_LOGIN, die otherwise

Definition at line 2011 of file class.ilUserImportParser.php.

2011 : void
2012 {
2013 if ($value === self::IL_USER_MAPPING_ID || $value === self::IL_USER_MAPPING_LOGIN) {
2014 $this->mapping_mode = $value;
2015 } else {
2016 die('wrong argument using methode setUserMappingMethod in ' . __FILE__);
2017 }
2018 }

◆ stripTags()

ilUserImportParser::stripTags ( string  $string)
private

Definition at line 2214 of file class.ilUserImportParser.php.

2214 : string
2215 {
2216 return $this->refinery->string()->stripTags()->transform($string);
2217 }

References ILIAS\Repository\refinery().

+ Here is the call graph for this function:

◆ tagContained()

ilUserImportParser::tagContained ( string  $tagname)
private

Definition at line 788 of file class.ilUserImportParser.php.

788 : bool
789 {
790 return in_array($tagname, $this->contained_tags, true);
791 }

◆ updateMailPreferences()

ilUserImportParser::updateMailPreferences ( int  $usr_id)
private

Definition at line 2169 of file class.ilUserImportParser.php.

2169 : void
2170 {
2171 if (array_key_exists('mail_incoming_type', $this->prefs) ||
2172 array_key_exists('mail_signature', $this->prefs) ||
2173 array_key_exists('mail_linebreak', $this->prefs)
2174 ) {
2175 $mailOptions = new ilMailOptions($usr_id);
2176
2177 $mailOptions->setSignature(array_key_exists('mail_signature', $this->prefs) ? $this->prefs['mail_signature'] : $mailOptions->getSignature());
2178 $mailOptions->setIncomingType(array_key_exists('mail_incoming_type', $this->prefs) ? (int) $this->prefs['mail_incoming_type'] : $mailOptions->getIncomingType());
2179 $mailOptions->updateOptions();
2180 }
2181 }

◆ verifyBeginTag()

ilUserImportParser::verifyBeginTag (   $a_xml_parser,
string  $a_name,
array  $a_attribs 
)
Parameters
\XMLParser | resource$a_xml_parser

Definition at line 493 of file class.ilUserImportParser.php.

497 : void {
498 switch ($a_name) {
499 case 'Role':
500 if ($a_attribs['Id'] == '') {
501 $this->logFailure($this->user_obj->getLogin(), sprintf($this->lng->txt('usrimport_xml_attribute_missing'), 'Role', 'Id'));
502 }
503 $this->current_role_id = $a_attribs['Id'];
504 $this->current_role_type = $a_attribs['Type'];
505 if ($this->current_role_type !== 'Global'
506 && $this->current_role_type !== 'Local') {
507 $this->logFailure($this->user_obj->getLogin(), sprintf($this->lng->txt('usrimport_xml_attribute_missing'), 'Role', 'Type'));
508 }
509 $this->current_role_action = (!isset($a_attribs['Action'])) ? 'Assign' : $a_attribs['Action'];
510 if ($this->current_role_action !== 'Assign'
511 && $this->current_role_action !== 'AssignWithParents'
512 && $this->current_role_action !== 'Detach') {
513 $this->logFailure($this->user_obj->getLogin(), sprintf($this->lng->txt('usrimport_xml_attribute_value_illegal'), 'Role', 'Action', $this->stripTags($a_attribs['Action'])));
514 }
515 if ($this->action === 'Insert'
516 && $this->current_role_action === 'Detach') {
517 $this->logFailure($this->user_obj->getLogin(), sprintf($this->lng->txt('usrimport_xml_attribute_value_inapplicable'), 'Role', 'Action', $this->stripTags($this->current_role_action), $this->stripTags($this->action)));
518 }
519 if ($this->action === 'Delete') {
520 $this->logFailure($this->user_obj->getLogin(), sprintf($this->lng->txt('usrimport_xml_element_inapplicable'), 'Role', 'Delete'));
521 }
522 break;
523
524 case 'User':
525 $this->user_count++;
526 $this->contained_tags = [];
527 $this->user_obj = new ilObjUser();
528 $this->user_obj->setLanguage($a_attribs['Language'] ?? '');
529 $this->user_obj->setImportId($a_attribs['Id'] ?? '');
530 $this->current_pref_key = null;
531 // if we have an object id, store it
532 $this->user_id = -1;
533
534 if (isset($a_attribs['Id']) && $this->getUserMappingMode() === self::IL_USER_MAPPING_ID) {
535 if (is_numeric($a_attribs['Id'])) {
536 $this->user_id = (int) $a_attribs['Id'];
537 } elseif (($id = (int) ilUtil::__extractId($a_attribs['Id'], (int) IL_INST_ID)) > 0) {
538 $this->user_id = $id;
539 }
540 }
541
542 $this->action = !isset($a_attribs['Action']) ? 'Insert' : $a_attribs['Action'];
543 if ($this->action !== 'Insert'
544 && $this->action !== 'Update'
545 && $this->action !== 'Delete') {
546 $this->logFailure($this->user_obj->getImportId(), sprintf($this->lng->txt('usrimport_xml_attribute_value_illegal'), 'User', 'Action', $this->stripTags($a_attribs['Action'])));
547 }
548 $this->current_user_password = null;
549 $this->current_user_password_type = null;
550 break;
551
552 case 'Password':
553 $this->current_user_password_type = $a_attribs['Type'];
554 break;
555 case 'AuthMode':
556 if (array_key_exists('type', $a_attribs)) {
557 switch ($a_attribs['type']) {
558 case 'saml':
559 case 'ldap':
560 if (strcmp('saml', $a_attribs['type']) === 0) {
562 if (count($list) !== 1) {
563 $this->logFailure(
564 $this->user_obj->getImportId(),
565 sprintf($this->lng->txt('usrimport_xml_attribute_value_illegal'), 'AuthMode', 'type', $this->stripTags($a_attribs['type']))
566 );
567 }
568 break;
569 }
570 if (strcmp('ldap', $a_attribs['type']) === 0) {
571 // no server id provided
573 if (count($list) != 1) {
574 $this->logFailure(
575 $this->user_obj->getImportId(),
576 sprintf($this->lng->txt('usrimport_xml_attribute_value_illegal'), 'AuthMode', 'type', $this->stripTags($a_attribs['type']))
577 );
578 }
579 }
580 break;
581
582 case 'default':
583 case 'local':
584 case 'shibboleth':
585 case 'script':
586 case 'soap':
587 case 'openid':
588 // begin-patch auth_plugin
589 default:
590 $this->user_obj->setAuthMode($a_attribs['type']);
591 break;
592 }
593 } else {
594 $this->logFailure($this->user_obj->getImportId(), sprintf($this->lng->txt('usrimport_xml_attribute_value_illegal'), 'AuthMode', 'type', ''));
595 }
596 break;
597 case 'Pref':
598 $this->current_pref_key = $a_attribs['key'];
599 break;
600 }
601 }

References $id, ilUtil\__extractId(), ilLDAPServer\_getActiveServerList(), ilSamlIdp\getActiveIdpList(), IL_INST_ID, ILIAS\Repository\int(), and ILIAS\Repository\lng().

Referenced by handlerBeginTag().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ verifyEndTag()

ilUserImportParser::verifyEndTag (   $a_xml_parser,
string  $a_name 
)

handler for end of element when in verify mode.

Definition at line 1535 of file class.ilUserImportParser.php.

1538 : void {
1539 $externalAccountHasChanged = false;
1540
1541 switch ($a_name) {
1542 case 'Role':
1543 $this->roles[$this->current_role_id]['name'] = $this->cdata;
1544 $this->roles[$this->current_role_id]['type'] = $this->current_role_type;
1545 $this->roles[$this->current_role_id]['action'] = $this->current_role_action;
1546 break;
1547
1548 case 'User':
1549 $this->user_obj->setFullname();
1550 if ($this->user_id != -1 && ($this->action === 'Update' || $this->action === 'Delete')) {
1552 $user_exists = !is_null(ilObjUser::_lookupLogin($user_id));
1553 } else {
1554 $user_id = ilObjUser::getUserIdByLogin($this->user_obj->getLogin());
1555 $user_exists = $user_id != 0;
1556 }
1557 if (is_null($this->user_obj->getLogin())) {
1558 $this->logFailure('---', sprintf($this->lng->txt('usrimport_xml_element_for_action_required'), 'Login', 'Insert'));
1559 }
1560
1561 if ($user_id === (int) ANONYMOUS_USER_ID || $user_id === (int) SYSTEM_USER_ID) {
1562 $this->logWarning($this->user_obj->getLogin(), $this->lng->txt('usrimport_xml_anonymous_or_root_not_allowed'));
1563 break;
1564 }
1565
1566 switch ($this->action) {
1567 case 'Insert':
1568 if ($user_exists and $this->conflict_rule === self::IL_FAIL_ON_CONFLICT) {
1569 $this->logWarning($this->user_obj->getLogin(), $this->lng->txt('usrimport_cant_insert'));
1570 }
1571 if (is_null($this->user_obj->getGender()) && $this->isFieldRequired('gender')) {
1572 $this->logFailure($this->user_obj->getLogin(), sprintf($this->lng->txt('usrimport_xml_element_for_action_required'), 'Gender', 'Insert'));
1573 }
1574 if (is_null($this->user_obj->getFirstname())) {
1575 $this->logFailure($this->user_obj->getLogin(), sprintf($this->lng->txt('usrimport_xml_element_for_action_required'), 'Firstname', 'Insert'));
1576 }
1577 if (is_null($this->user_obj->getLastname())) {
1578 $this->logFailure($this->user_obj->getLogin(), sprintf($this->lng->txt('usrimport_xml_element_for_action_required'), 'Lastname', 'Insert'));
1579 }
1580 if (count($this->roles) == 0) {
1581 $this->logFailure($this->user_obj->getLogin(), sprintf($this->lng->txt('usrimport_xml_element_for_action_required'), 'Role', 'Insert'));
1582 } else {
1583 $has_global_role = false;
1584 foreach ($this->roles as $role) {
1585 if ($role['type'] === 'Global') {
1586 $has_global_role = true;
1587 break;
1588 }
1589 }
1590 if (!$has_global_role) {
1591 $this->logFailure($this->user_obj->getLogin(), sprintf($this->lng->txt('usrimport_global_role_for_action_required'), 'Insert'));
1592 }
1593 }
1594 break;
1595 case 'Update':
1596 if (!$user_exists) {
1597 $this->logWarning($this->user_obj->getLogin(), $this->lng->txt('usrimport_cant_update'));
1598 } elseif ($this->user_id != -1 && $this->tagContained('Login')) {
1599 // check if someone owns the new login name!
1600 $someonesId = ilObjUser::_lookupId($this->user_obj->getLogin());
1601
1602 if (is_numeric($someonesId) && $someonesId != $this->user_id) {
1603 $this->logFailure($this->user_obj->getLogin(), $this->lng->txt('usrimport_login_is_not_unique'));
1604 }
1605 }
1606 break;
1607 case 'Delete':
1608 if (!$user_exists) {
1609 $this->logWarning($this->user_obj->getLogin(), $this->lng->txt('usrimport_cant_delete'));
1610 }
1611 break;
1612 }
1613
1614 // init role array for next user
1615 $this->roles = [];
1616 break;
1617
1618 case 'Login':
1619 if (array_key_exists($this->cdata, $this->logins)) {
1620 $this->logWarning($this->cdata, $this->lng->txt('usrimport_login_is_not_unique'));
1621 } else {
1622 $this->logins[$this->cdata] = $this->cdata;
1623 }
1624 $this->user_obj->setLogin($this->stripTags($this->cdata));
1625 break;
1626
1627 case 'Password':
1628 switch ($this->current_user_password_type) {
1629 case 'BCRYPT':
1630 $this->user_obj->setPasswd($this->cdata, ilObjUser::PASSWD_CRYPTED);
1631 $this->user_obj->setPasswordEncodingType('bcryptphp');
1632 $this->user_obj->setPasswordSalt(null);
1633 break;
1634
1635 case 'PLAIN':
1636 $this->user_obj->setPasswd($this->cdata, ilObjUser::PASSWD_PLAIN);
1637 $this->acc_mail->setUserPassword((string) $this->current_user_password);
1638 break;
1639
1640 default:
1641 $this->logFailure($this->user_obj->getLogin(), sprintf($this->lng->txt('usrimport_xml_attribute_value_illegal'), 'Type', 'Password', $this->stripTags($this->current_user_password_type)));
1642 break;
1643 }
1644 break;
1645
1646 case 'Firstname':
1647 $this->user_obj->setFirstname($this->cdata);
1648 break;
1649
1650 case 'Lastname':
1651 $this->user_obj->setLastname($this->cdata);
1652 break;
1653
1654 case 'Title':
1655 $this->user_obj->setUTitle($this->cdata);
1656 break;
1657
1658 case 'Gender':
1659 if (!in_array(strtolower($this->cdata), ['n', 'm', 'f', ''])) {
1660 $this->logFailure(
1661 $this->user_obj->getLogin(),
1662 sprintf($this->lng->txt('usrimport_xml_element_content_illegal'), 'Gender', $this->stripTags($this->cdata))
1663 );
1664 }
1665 $this->user_obj->setGender($this->cdata);
1666 break;
1667
1668 case 'Email':
1669 $this->user_obj->setEmail($this->cdata);
1670 break;
1671 case 'SecondEmail':
1672 $this->user_obj->setSecondEmail($this->cdata);
1673 break;
1674 case 'Institution':
1675 $this->user_obj->setInstitution($this->cdata);
1676 break;
1677
1678 case 'Street':
1679 $this->user_obj->setStreet($this->cdata);
1680 break;
1681
1682 case 'City':
1683 $this->user_obj->setCity($this->cdata);
1684 break;
1685
1686 case 'PostalCode':
1687 $this->user_obj->setZipcode($this->cdata);
1688 break;
1689
1690 case 'Country':
1691 case 'SelCountry':
1692 if (mb_strlen($this->cdata) !== 2) {
1693 break;
1694 }
1695 $this->user_obj->setCountry($this->cdata);
1696 break;
1697
1698 case 'PhoneOffice':
1699 $this->user_obj->setPhoneOffice($this->cdata);
1700 break;
1701
1702 case 'PhoneHome':
1703 $this->user_obj->setPhoneHome($this->cdata);
1704 break;
1705
1706 case 'PhoneMobile':
1707 $this->user_obj->setPhoneMobile($this->cdata);
1708 break;
1709
1710 case 'Fax':
1711 $this->user_obj->setFax($this->cdata);
1712 break;
1713
1714 case 'Hobby':
1715 $this->user_obj->setHobby($this->cdata);
1716 break;
1717
1718 case 'GeneralInterest':
1719 case 'OfferingHelp':
1720 case 'LookingForHelp':
1721 $this->multi_values[$a_name][] = $this->cdata;
1722 break;
1723
1724 case 'Comment':
1725 $this->user_obj->setComment($this->cdata);
1726 break;
1727
1728 case 'Department':
1729 $this->user_obj->setDepartment($this->cdata);
1730 break;
1731
1732 case 'Matriculation':
1733 $this->user_obj->setMatriculation($this->cdata);
1734 break;
1735
1736 case 'ExternalAccount':
1737 $am = ($this->user_obj->getAuthMode() === 'default' || $this->user_obj->getAuthMode() == '')
1738 ? ilAuthUtils::_getAuthModeName($this->settings->get('auth_mode'))
1739 : $this->user_obj->getAuthMode();
1740 $loginForExternalAccount = (trim($this->cdata) == '')
1741 ? ''
1742 : ilObjUser::_checkExternalAuthAccount($am, trim($this->cdata));
1743 switch ($this->action) {
1744 case 'Insert':
1745 if ($loginForExternalAccount != '') {
1746 $this->logWarning($this->user_obj->getLogin(), $this->lng->txt('usrimport_no_insert_ext_account_exists') . ' (' . $this->stripTags($this->cdata) . ')');
1747 }
1748 break;
1749
1750 case 'Update':
1751 if ($loginForExternalAccount != '') {
1752 $externalAccountHasChanged = trim($this->cdata) != ilObjUser::_lookupExternalAccount($this->user_id);
1753 if ($externalAccountHasChanged && trim($loginForExternalAccount) != trim($this->user_obj->getLogin())) {
1754 $this->logWarning(
1755 $this->user_obj->getLogin(),
1756 $this->lng->txt('usrimport_no_update_ext_account_exists') . ' (' . $this->stripTags($this->cdata) . ' for ' . $this->stripTags($loginForExternalAccount) . ')'
1757 );
1758 }
1759 }
1760 break;
1761 }
1762 if ($externalAccountHasChanged) {
1763 $this->user_obj->setExternalAccount(trim($this->cdata));
1764 }
1765 break;
1766
1767 case 'Active':
1768 if ($this->cdata !== 'true'
1769 && $this->cdata !== 'false') {
1770 $this->logFailure(
1771 $this->user_obj->getLogin(),
1772 sprintf($this->lng->txt('usrimport_xml_element_content_illegal'), 'Active', $this->stripTags($this->cdata))
1773 );
1774 }
1775 $this->currActive = $this->cdata;
1776 break;
1777 case 'TimeLimitOwner':
1778 if (!preg_match('/\d+/', $this->cdata)) {
1779 $this->logFailure(
1780 $this->user_obj->getLogin(),
1781 sprintf($this->lng->txt('usrimport_xml_element_content_illegal'), 'TimeLimitOwner', $this->stripTags($this->cdata))
1782 );
1783 } elseif (!$this->access->checkAccess('cat_administrate_users', '', (int) $this->cdata)) {
1784 $this->logFailure(
1785 $this->user_obj->getLogin(),
1786 sprintf($this->lng->txt('usrimport_xml_element_content_illegal'), 'TimeLimitOwner', $this->stripTags($this->cdata))
1787 );
1788 } elseif ($this->object_data_cache->lookupType($this->object_data_cache->lookupObjId((int) $this->cdata)) !== 'cat' && !(int) $this->cdata == USER_FOLDER_ID) {
1789 $this->logFailure(
1790 $this->user_obj->getLogin(),
1791 sprintf($this->lng->txt('usrimport_xml_element_content_illegal'), 'TimeLimitOwner', $this->stripTags($this->cdata))
1792 );
1793 }
1794 $this->user_obj->setTimeLimitOwner((int) $this->cdata);
1795 break;
1796 case 'TimeLimitUnlimited':
1797 switch (strtolower($this->cdata)) {
1798 case 'true':
1799 case '1':
1800 $this->user_obj->setTimeLimitUnlimited(true);
1801 break;
1802 case 'false':
1803 case '0':
1804 $this->user_obj->setTimeLimitUnlimited(false);
1805 break;
1806 default:
1807 $this->logFailure($this->user_obj->getLogin(), sprintf($this->lng->txt('usrimport_xml_element_content_illegal'), 'TimeLimitUnlimited', $this->stripTags($this->cdata)));
1808 break;
1809 }
1810 break;
1811 case 'TimeLimitFrom':
1812 // Accept datetime or Unix timestamp
1813 if (strtotime($this->cdata) === false && !is_numeric($this->cdata)) {
1814 $this->logFailure($this->user_obj->getLogin(), sprintf($this->lng->txt('usrimport_xml_element_content_illegal'), 'TimeLimitFrom', $this->stripTags($this->cdata)));
1815 }
1816 $this->user_obj->setTimeLimitFrom((int) $this->cdata);
1817 break;
1818 case 'TimeLimitUntil':
1819 // Accept datetime or Unix timestamp
1820 if (strtotime($this->cdata) === false && !is_numeric($this->cdata)) {
1821 $this->logFailure($this->user_obj->getLogin(), sprintf($this->lng->txt('usrimport_xml_element_content_illegal'), 'TimeLimitUntil', $this->stripTags($this->cdata)));
1822 }
1823 $this->user_obj->setTimeLimitUntil((int) $this->cdata);
1824 break;
1825 case 'ApproveDate':
1826 // Accept datetime or Unix timestamp
1827 if (strtotime($this->cdata) === false && !is_numeric($this->cdata) && !$this->cdata === '0000-00-00 00:00:00') {
1828 $this->logFailure($this->user_obj->getLogin(), sprintf($this->lng->txt('usrimport_xml_element_content_illegal'), 'ApproveDate', $this->stripTags($this->cdata)));
1829 }
1830 break;
1831 case 'AgreeDate':
1832 // Accept datetime or Unix timestamp
1833 if (strtotime($this->cdata) === false && !is_numeric($this->cdata) && !$this->cdata === '0000-00-00 00:00:00') {
1834 $this->logFailure($this->user_obj->getLogin(), sprintf($this->lng->txt('usrimport_xml_element_content_illegal'), 'AgreeDate', $this->stripTags($this->cdata)));
1835 }
1836 break;
1837 case 'Pref':
1838 if ($this->current_pref_key != null) {
1839 $this->verifyPref($this->current_pref_key, $this->cdata);
1840 }
1841 }
1842 }
static _lookupId(string|array $a_user_str)
static _lookupLogin(int $a_user_id)
verifyPref(string $key, string $value)
const USER_FOLDER_ID
Definition: constants.php:33

References $user_id, ilObjUser\_checkExternalAuthAccount(), ilAuthUtils\_getAuthModeName(), ilObjUser\_lookupExternalAccount(), ilObjUser\_lookupId(), ilObjUser\_lookupLogin(), ILIAS\Repository\access(), ANONYMOUS_USER_ID, ilObjUser\getUserIdByLogin(), ILIAS\Repository\lng(), ilObjUser\PASSWD_CRYPTED, ilObjUser\PASSWD_PLAIN, ILIAS\Repository\settings(), SYSTEM_USER_ID, and USER_FOLDER_ID.

+ Here is the call graph for this function:

◆ verifyPref()

ilUserImportParser::verifyPref ( string  $key,
string  $value 
)
private

Definition at line 2068 of file class.ilUserImportParser.php.

2068 : void
2069 {
2070 switch ($key) {
2071 case 'mail_linebreak':
2072 case 'language':
2073 case 'skin':
2074 case 'style':
2075 case 'ilPageEditor_HTMLMode':
2076 case 'ilPageEditor_JavaScript':
2077 case 'ilPageEditor_MediaMode':
2078 case 'tst_javascript':
2079 case 'tst_lastquestiontype':
2080 case 'tst_multiline_answers':
2081 case 'tst_use_previous_answers':
2082 case 'graphicalAnswerSetting':
2083 case 'priv_feed_pass':
2084 $this->logFailure('---', "Preference {$this->stripTags($key)} is not supported.");
2085 break;
2086 case 'public_city':
2087 case 'public_country':
2088 case 'public_department':
2089 case 'public_email':
2090 case 'public_second_email':
2091 case 'public_fax':
2092 case 'public_hobby':
2093 case 'public_institution':
2094 case 'public_matriculation':
2095 case 'public_phone':
2096 case 'public_phone_home':
2097 case 'public_phone_mobile':
2098 case 'public_phone_office':
2099 case 'public_street':
2100 case 'public_upload':
2101 case 'public_avatar':
2102 case 'public_zip':
2103 case 'public_interests_general':
2104 case 'public_interests_help_offered':
2105 case 'public_interests_help_looking':
2106 case 'send_info_mails':
2107 case 'bs_allow_to_contact_me':
2108 case 'chat_osc_accept_msg':
2109 case 'chat_broadcast_typing':
2110 case 'hide_own_online_status':
2111 if (!in_array($value, ['y', 'n', ''])) {
2112 $this->logFailure('---', "Wrong value '{$this->stripTags($value)}': Value 'y' or 'n' expected for preference {$this->stripTags($key)}.");
2113 }
2114 break;
2115 case 'public_profile':
2116 if (!in_array($value, ['y', 'n', 'g'])) {
2117 $this->logFailure('---', "Wrong value '{$this->stripTags($value)}': Value 'y', 'g' or 'n' expected for preference {$this->stripTags($key)}.");
2118 }
2119 break;
2120 case 'show_users_online':
2121 if (!in_array($value, ['y', 'n', 'associated'])) {
2122 $this->logFailure('---', "Wrong value '{$this->stripTags($value)}': Value 'y' or 'n' or 'associated' expected for preference {$this->stripTags($key)}.");
2123 }
2124 break;
2125 case 'mail_incoming_type':
2126 if (!in_array((int) $value, ['0','1','2'])) {
2127 $this->logFailure('---', "Wrong value '{$this->stripTags($value)}': Value '0' (LOCAL),'1' (EMAIL) or '2' (BOTH) expected for preference {$this->stripTags($key)}.");
2128 }
2129 break;
2130 case 'weekstart':
2131 if (!in_array($value, ['0','1'])) {
2132 $this->logFailure('---', "Wrong value '{$this->stripTags($value)}': Value '0' (Sunday) or '1' (Monday) expected for preference {$this->stripTags($key)}.");
2133 }
2134 break;
2135
2136 case 'mail_signature':
2137 break;
2138 case 'user_tz':
2139 try {
2141 return;
2142 } catch (ilTimeZoneException $tze) {
2143 $this->logFailure('---', "Wrong value '{$this->stripTags($value)}': Invalid timezone $value detected for preference {$this->stripTags($key)}.");
2144 }
2145 break;
2146 default:
2148 $this->logFailure('---', "Preference {$this->stripTags($key)} is not supported.");
2149 }
2150 break;
2151 }
2152 }
Class for TimeZone exceptions.
static _getInstance(string $a_tz='')
get instance by timezone

References ilTimeZone\_getInstance(), and ilUserXMLWriter\isPrefExportable().

+ Here is the call graph for this function:

Field Documentation

◆ $acc_mail

ilAccountMail ilUserImportParser::$acc_mail
private

Definition at line 68 of file class.ilUserImportParser.php.

◆ $access

ilAccess ilUserImportParser::$access
private

Definition at line 50 of file class.ilUserImportParser.php.

◆ $action

string ilUserImportParser::$action
private

Definition at line 77 of file class.ilUserImportParser.php.

◆ $approve_date_set

bool ilUserImportParser::$approve_date_set = false
private

Definition at line 70 of file class.ilUserImportParser.php.

◆ $auth_mode_set

bool ilUserImportParser::$auth_mode_set
private

Definition at line 59 of file class.ilUserImportParser.php.

◆ $cdata

string ilUserImportParser::$cdata
private

Definition at line 65 of file class.ilUserImportParser.php.

◆ $conflict_rule

int ilUserImportParser::$conflict_rule
private

Definition at line 82 of file class.ilUserImportParser.php.

◆ $contained_tags

array ilUserImportParser::$contained_tags = []
private

Definition at line 79 of file class.ilUserImportParser.php.

◆ $currActive

string ilUserImportParser::$currActive = null
private

Definition at line 149 of file class.ilUserImportParser.php.

◆ $current_messenger_type

string ilUserImportParser::$current_messenger_type
private

Definition at line 172 of file class.ilUserImportParser.php.

◆ $current_pref_key

string ilUserImportParser::$current_pref_key = null
private

Definition at line 60 of file class.ilUserImportParser.php.

◆ $current_role_action

string ilUserImportParser::$current_role_action
private

Definition at line 62 of file class.ilUserImportParser.php.

◆ $current_role_id

string ilUserImportParser::$current_role_id = '0'
private

Definition at line 64 of file class.ilUserImportParser.php.

◆ $current_role_type

string ilUserImportParser::$current_role_type
private

Definition at line 63 of file class.ilUserImportParser.php.

◆ $current_user_password

string ilUserImportParser::$current_user_password
private

Definition at line 148 of file class.ilUserImportParser.php.

◆ $current_user_password_type

string ilUserImportParser::$current_user_password_type
private

Definition at line 147 of file class.ilUserImportParser.php.

◆ $error_level

int ilUserImportParser::$error_level
private

This variable is used to report the error level of the validation process or the importing process.

Values: IL_IMPORT_SUCCESS IL_IMPORT_WARNING IL_IMPORT_FAILURE

Meaning of the values when in validation mode: IL_IMPORT_WARNING Some of the entity actions can not be processed as specified in the XML file. One or more of the following conflicts have occurred:

  • An "Insert" action has been specified for a user who is already in the database.
  • An "Update" action has been specified for a user who is not in the database.
  • A "Delete" action has been specified for a user who is not in the database. IL_IMPORT_FAILURE Some of the XML elements are invalid.

Meaning of the values when in import mode: IL_IMPORT_WARNING Some of the entity actions have not beeen processed as specified in the XML file.

In IL_UPDATE_ON_CONFLICT mode, the following may have occured:

  • An "Insert" action has been replaced by a "Update" action for a user who is already in the database.
    • An "Update" action has been replaced by a "Insert" action for a user who is not in the database.
  • A "Delete" action has been replaced by a "Ignore" action for a user who is not in the database.

In IL_IGNORE_ON_CONFLICT mode, the following may have occured:

  • An "Insert" action has been replaced by a "Ignore" action for a user who is already in the database.
  • An "Update" action has been replaced by a "Ignore" action for a user who is not in the database.
    • A "Delete" action has been replaced by a "Ignore" action for a user who is not in the database.

IL_IMPORT_FAILURE The import could not be completed.

In IL_FAIL_ON_CONFLICT mode, the following may have occured:

  • An "Insert" action has failed for a user who is already in the database.
  • An "Update" action has failed for a user who is not in the database.
  • A "Delete" action has failed for a user who is not in the database.

Definition at line 146 of file class.ilUserImportParser.php.

◆ $folder_id

int ilUserImportParser::$folder_id
private

Definition at line 75 of file class.ilUserImportParser.php.

Referenced by getFolderId().

◆ $ilias

ILIAS ilUserImportParser::$ilias
private

Definition at line 45 of file class.ilUserImportParser.php.

◆ $local_role_cache

array ilUserImportParser::$local_role_cache
private

Definition at line 157 of file class.ilUserImportParser.php.

◆ $logins

array ilUserImportParser::$logins
private

Definition at line 81 of file class.ilUserImportParser.php.

◆ $mapping_mode

int ilUserImportParser::$mapping_mode
private

Definition at line 156 of file class.ilUserImportParser.php.

◆ $mode

int ilUserImportParser::$mode
private

Definition at line 69 of file class.ilUserImportParser.php.

◆ $multi_values

array ilUserImportParser::$multi_values
private

Definition at line 57 of file class.ilUserImportParser.php.

◆ $object_data_cache

ilObjectDataCache ilUserImportParser::$object_data_cache
private

Definition at line 47 of file class.ilUserImportParser.php.

◆ $parent_roles_cache

array ilUserImportParser::$parent_roles_cache
private

Definition at line 162 of file class.ilUserImportParser.php.

◆ $personal_picture

array ilUserImportParser::$personal_picture = null
private

Definition at line 161 of file class.ilUserImportParser.php.

◆ $prefs

array ilUserImportParser::$prefs
private

Definition at line 61 of file class.ilUserImportParser.php.

◆ $protocol

array ilUserImportParser::$protocol
private

Definition at line 80 of file class.ilUserImportParser.php.

◆ $rbac_admin

ilRbacAdmin ilUserImportParser::$rbac_admin
private

Definition at line 49 of file class.ilUserImportParser.php.

◆ $rbac_review

ilRbacReview ilUserImportParser::$rbac_review
private

Definition at line 48 of file class.ilUserImportParser.php.

◆ $recommended_content_manager

ilRecommendedContentManager ilUserImportParser::$recommended_content_manager
private

Definition at line 173 of file class.ilUserImportParser.php.

◆ $refinery

Refinery ilUserImportParser::$refinery
private

Definition at line 174 of file class.ilUserImportParser.php.

◆ $req_send_mail

string ilUserImportParser::$req_send_mail
private

Definition at line 67 of file class.ilUserImportParser.php.

◆ $required_fields

array ilUserImportParser::$required_fields = []
private

Definition at line 78 of file class.ilUserImportParser.php.

◆ $role_assign

array ilUserImportParser::$role_assign
private

Definition at line 66 of file class.ilUserImportParser.php.

◆ $roles

array ilUserImportParser::$roles
private

Definition at line 76 of file class.ilUserImportParser.php.

◆ $send_mail

bool ilUserImportParser::$send_mail
private

Definition at line 83 of file class.ilUserImportParser.php.

◆ $settings

ilSetting ilUserImportParser::$settings
private

Definition at line 46 of file class.ilUserImportParser.php.

◆ $skin

string ilUserImportParser::$skin = ''
private

Definition at line 163 of file class.ilUserImportParser.php.

◆ $style

string ilUserImportParser::$style = ''
private

Definition at line 164 of file class.ilUserImportParser.php.

◆ $time_limit_owner_set

bool ilUserImportParser::$time_limit_owner_set = false
private

Definition at line 72 of file class.ilUserImportParser.php.

◆ $time_limit_set

bool ilUserImportParser::$time_limit_set = false
private

Definition at line 71 of file class.ilUserImportParser.php.

◆ $tmp_udf_id

string ilUserImportParser::$tmp_udf_id = null
private

Definition at line 56 of file class.ilUserImportParser.php.

◆ $tmp_udf_name

string ilUserImportParser::$tmp_udf_name = null
private

Definition at line 55 of file class.ilUserImportParser.php.

◆ $udf_data

array ilUserImportParser::$udf_data
private

Definition at line 58 of file class.ilUserImportParser.php.

◆ $update_look_and_skin

bool ilUserImportParser::$update_look_and_skin = false
private

Definition at line 74 of file class.ilUserImportParser.php.

◆ $user

ilObjUser ilUserImportParser::$user
private

Definition at line 51 of file class.ilUserImportParser.php.

◆ $user_count

int ilUserImportParser::$user_count
private

Definition at line 150 of file class.ilUserImportParser.php.

◆ $user_id

int ilUserImportParser::$user_id
private

Definition at line 170 of file class.ilUserImportParser.php.

◆ $user_mapping

array ilUserImportParser::$user_mapping = []
private

Definition at line 155 of file class.ilUserImportParser.php.

◆ $user_obj

ilObjUser ilUserImportParser::$user_obj
private

Definition at line 171 of file class.ilUserImportParser.php.

◆ $user_profile

Profile ilUserImportParser::$user_profile
private

Definition at line 53 of file class.ilUserImportParser.php.

◆ $user_styles

array ilUserImportParser::$user_styles
private

Definition at line 168 of file class.ilUserImportParser.php.

◆ IL_EXTRACT_ROLES

const ilUserImportParser::IL_EXTRACT_ROLES = 1

◆ IL_FAIL_ON_CONFLICT

const ilUserImportParser::IL_FAIL_ON_CONFLICT = 1

Definition at line 34 of file class.ilUserImportParser.php.

Referenced by ilSoapUserAdministration\importUsers().

◆ IL_IGNORE_ON_CONFLICT

const ilUserImportParser::IL_IGNORE_ON_CONFLICT = 3

◆ IL_IMPORT_FAILURE

const ilUserImportParser::IL_IMPORT_FAILURE = 3

◆ IL_IMPORT_SUCCESS

const ilUserImportParser::IL_IMPORT_SUCCESS = 1

◆ IL_IMPORT_WARNING

const ilUserImportParser::IL_IMPORT_WARNING = 2

◆ IL_UPDATE_ON_CONFLICT

const ilUserImportParser::IL_UPDATE_ON_CONFLICT = 2

◆ IL_USER_IMPORT

const ilUserImportParser::IL_USER_IMPORT = 2

◆ IL_USER_MAPPING_ID

const ilUserImportParser::IL_USER_MAPPING_ID = 2

◆ IL_USER_MAPPING_LOGIN

const ilUserImportParser::IL_USER_MAPPING_LOGIN = 1
private

Definition at line 42 of file class.ilUserImportParser.php.

◆ IL_VERIFY

const ilUserImportParser::IL_VERIFY = 3

The documentation for this class was generated from the following file: