ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 27 of file class.ilUserImportParser.php.

Member Function Documentation

◆ addUDFDataToUser()

ilUserImportParser::addUDFDataToUser ( \ilObjUser  $user)
private

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

2158 : \ilObjUser
2159 {
2160 return $user->withProfileData(
2161 array_reduce(
2162 array_keys($this->udf_data),
2163 fn(ProfileData $c, string $v): ProfileData =>
2164 $c->withAdditionalFieldByIdentifier(
2165 $v,
2166 $this->udf_data[$v]
2167 ),
2168 $this->user_obj->getProfileData()
2169 )
2170 );
2171 }
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 670 of file class.ilUserImportParser.php.

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

754 : void {
755 $this->assignToRole($a_user_obj, $a_role_id);
756
757 $parent_role_ids = $this->getParentRoleIds($a_role_id);
758 foreach ($parent_role_ids as $parent_role_id) {
759 $this->assignToRole($a_user_obj, $parent_role_id);
760 }
761 }
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 277 of file class.ilUserImportParser.php.

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

◆ 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 2055 of file class.ilUserImportParser.php.

2055 : bool
2056 {
2057 return $this->user_profile->isProfileIncomplete($user_obj);
2058 }

◆ detachFromRole()

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

Detaches a user from a role.

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

769 : void {
770 $this->rbac_admin->deassignUser($a_role_id, $a_user_obj->getId());
771
772 if (substr(ilObject::_lookupTitle($a_role_id), 0, 6) !== 'il_crs'
773 && substr(ilObject::_lookupTitle($a_role_id), 0, 6) !== 'il_grp') {
774 return;
775 }
776
778 $this->rbac_review->getObjectOfRole($a_role_id)
779 );
780 $ref_id = end($ref);
781 if (!$ref_id) {
782 return;
783 }
784 $this->recommended_content_manager->removeObjectRecommendation($a_user_obj->getId(), $ref_id);
785 }
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 321 of file class.ilUserImportParser.php.

325 : void {
326 switch ($a_name) {
327 case 'Role':
328 // detect numeric, ilias id (then extract role id) or alphanumeric
329 $current_role_id = $a_attribs['Id'];
330 if (($internal_id = ilUtil::__extractId($current_role_id, (int) IL_INST_ID)) > 0) {
331 $current_role_id = $internal_id;
332 }
333 $this->current_role_id = $this->refinery->kindlyTo()->string()->transform($current_role_id);
334 $this->current_role_type = $a_attribs['Type'];
335 break;
336 }
337 }
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 622 of file class.ilUserImportParser.php.

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

◆ fetchFieldIdFromImportId()

ilUserImportParser::fetchFieldIdFromImportId ( string  $import_id)
private

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

2187 : ?string
2188 {
2189 if ($import_id === '') {
2190 return null;
2191 }
2192
2193 $parts = explode('_', $import_id);
2194 if (($parts[0] ?? '') !== 'il'
2195 || ($parts[1] ?? '') !== 'udf'
2196 || ($parts[2] ?? '') === ''
2197 || $this->user_profile->getFieldByIdentifier($parts[2]) === null) {
2198 return null;
2199 }
2200 return $parts[2];
2201 }
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 2203 of file class.ilUserImportParser.php.

2203 : ?string
2204 {
2205 foreach ($this->user_profile->getAllUserDefinedFields() as $field) {
2206 if ($field->getLabel($this->lng) === $name) {
2207 return $field->getIdentifier();
2208 }
2209 }
2210 return null;
2211 }

◆ getCDataWithoutTags()

ilUserImportParser::getCDataWithoutTags ( )
private

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

2213 : string
2214 {
2215 return $this->stripTags($this->cdata);
2216 }

◆ getCollectedRoles()

ilUserImportParser::getCollectedRoles ( )
Returns
array[]

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

1869 : array
1870 {
1871 return $this->roles;
1872 }

◆ getCourseMembersObjectForRole()

ilUserImportParser::getCourseMembersObjectForRole ( int  $a_role_id)

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

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

654 {
655 if (array_key_exists($a_role_id . '_courseMembersObject', $this->local_role_cache)) {
656 return $this->local_role_cache[$a_role_id . '_courseMembersObject'];
657 } else {
658 $course_refs = $this->rbac_review->getFoldersAssignedToRole($a_role_id, true);
659 $course_ref = $course_refs[0];
660 $course_obj = new ilObjCourse($course_ref, true);
661 $crsmembers_obj = ilCourseParticipants::_getInstanceByObjId($course_obj->getId());
662 $this->local_role_cache[$a_role_id . '_courseMembersObject'] = $crsmembers_obj;
663 return $crsmembers_obj;
664 }
665 }
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 1975 of file class.ilUserImportParser.php.

1975 : int
1976 {
1977 return $this->error_level;
1978 }
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 246 of file class.ilUserImportParser.php.

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

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 706 of file class.ilUserImportParser.php.

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

1932 : array
1933 {
1934 return $this->protocol;
1935 }

◆ getProtocolAsHTML()

ilUserImportParser::getProtocolAsHTML ( string  $a_log_title)

Returns the protocol as a HTML table.

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

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

References $message, $messages, and 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 638 of file class.ilUserImportParser.php.

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

◆ getUserCount()

ilUserImportParser::getUserCount ( )

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

1874 : int
1875 {
1876 return $this->user_count;
1877 }

◆ getUserMapping()

ilUserImportParser::getUserMapping ( )

returns a map user_id <=> login

Returns
array with user_id as key and login as value

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

1984 : array
1985 {
1986 return $this->user_mapping;
1987 }

◆ 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 2029 of file class.ilUserImportParser.php.

2029 : int
2030 {
2031 return $this->mapping_mode;
2032 }

◆ handlerBeginTag()

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

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

302 : void {
303 switch ($this->mode) {
305 $this->extractRolesBeginTag($a_xml_parser, $a_name, $a_attribs);
306 break;
308 $this->importBeginTag($a_xml_parser, $a_name, $a_attribs);
309 break;
310 case self::IL_VERIFY:
311 $this->verifyBeginTag($a_xml_parser, $a_name, $a_attribs);
312 break;
313 }
314
315 $this->cdata = '';
316 }
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 1853 of file class.ilUserImportParser.php.

1856 : void {
1857 if ($a_data !== "\n") {
1858 $a_data = preg_replace('/\t+/', ' ', $a_data);
1859 }
1860
1861 if (strlen($a_data) > 0) {
1862 $this->cdata .= $a_data;
1863 }
1864 }

Referenced by setHandlers().

+ Here is the caller graph for this function:

◆ handlerEndTag()

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

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

605 : void {
606 switch ($this->mode) {
608 $this->extractRolesEndTag($a_xml_parser, $a_name);
609 break;
611 $this->importEndTag($a_xml_parser, $a_name);
612 break;
613 case self::IL_VERIFY:
614 $this->verifyEndTag($a_xml_parser, $a_name);
615 break;
616 }
617 }
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 342 of file class.ilUserImportParser.php.

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

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

2066 : bool
2067 {
2068 $requiredFields = $this->readRequiredFields();
2069 $fieldname = strtolower(trim($fieldname));
2070 return array_key_exists($fieldname, $requiredFields);
2071 }

◆ isSendMail()

ilUserImportParser::isSendMail ( )

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

2006 : bool
2007 {
2008 return $this->send_mail;
2009 }

◆ isSuccess()

ilUserImportParser::isSuccess ( )

Returns true, if the import was successful.

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

1966 : bool
1967 {
1968 return $this->error_level === self::IL_IMPORT_SUCCESS;
1969 }

◆ logFailure()

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

Writes a failure log message to the protocol.

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

1903 : void {
1904 if (!array_key_exists($aLogin, $this->protocol)) {
1905 $this->protocol[$aLogin] = [];
1906 }
1907 if ($aMessage) {
1908 $this->protocol[$aLogin][] = $aMessage;
1909 }
1910 $this->error_level = self::IL_IMPORT_FAILURE;
1911 }

◆ logSuccess()

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

Writes a success log message to the protocol.

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

1920 : void {
1921 $this->user_mapping[$userid] = ['login' => $aLogin, 'action' => $action, 'message' => 'successful'];
1922 }

◆ logWarning()

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

Writes a warning log message to the protocol.

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

1885 : void {
1886 if (!array_key_exists($aLogin, $this->protocol)) {
1887 $this->protocol[$aLogin] = [];
1888 }
1889 if ($aMessage) {
1890 $this->protocol[$aLogin][] = $aMessage;
1891 }
1892 if ($this->error_level === self::IL_IMPORT_SUCCESS) {
1893 $this->error_level = self::IL_IMPORT_WARNING;
1894 }
1895 }

◆ readRequiredFields()

ilUserImportParser::readRequiredFields ( )
private
Returns
array[]

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

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

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 1517 of file class.ilUserImportParser.php.

1520 : string {
1521 $tempname = ilFileUtils::ilTempnam() . $filename;
1522 $fh = fopen($tempname, 'wb');
1523 if ($fh == false) {
1524 return '';
1525 }
1526 fwrite($fh, $image_data);
1527 fclose($fh);
1528 return $tempname;
1529 }
$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 1992 of file class.ilUserImportParser.php.

1992 : void
1993 {
1994 if ($this->req_send_mail != '' ||
1995 ($this->isSendMail() && $this->user_obj->getEmail() != '')) {
1996 $this->acc_mail->setUser($this->user_obj);
1997 $this->acc_mail->send();
1998 }
1999 }

◆ 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 241 of file class.ilUserImportParser.php.

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

◆ 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 258 of file class.ilUserImportParser.php.

258 : void
259 {
260 xml_set_element_handler($a_xml_parser, $this->handlerBeginTag(...), $this->handlerEndTag(...));
261 xml_set_character_data_handler($a_xml_parser, $this->handlerCharacterData(...));
262 }
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 269 of file class.ilUserImportParser.php.

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

◆ setSendMail()

ilUserImportParser::setSendMail ( bool  $value)

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

2001 : void
2002 {
2003 $this->send_mail = $value;
2004 }

◆ 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 2016 of file class.ilUserImportParser.php.

2016 : void
2017 {
2018 if ($value === self::IL_USER_MAPPING_ID || $value === self::IL_USER_MAPPING_LOGIN) {
2019 $this->mapping_mode = $value;
2020 } else {
2021 die('wrong argument using methode setUserMappingMethod in ' . __FILE__);
2022 }
2023 }

◆ stripTags()

ilUserImportParser::stripTags ( string  $string)
private

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

2218 : string
2219 {
2220 return $this->refinery->string()->stripTags()->transform($string);
2221 }

References ILIAS\Repository\refinery().

+ Here is the call graph for this function:

◆ tagContained()

ilUserImportParser::tagContained ( string  $tagname)
private

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

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

◆ updateMailPreferences()

ilUserImportParser::updateMailPreferences ( int  $usr_id)
private

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

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

◆ verifyBeginTag()

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

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

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

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 1534 of file class.ilUserImportParser.php.

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

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

◆ $access

ilAccess ilUserImportParser::$access
private

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

◆ $action

string ilUserImportParser::$action
private

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

◆ $approve_date_set

bool ilUserImportParser::$approve_date_set = false
private

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

◆ $auth_mode_set

bool ilUserImportParser::$auth_mode_set
private

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

◆ $cdata

string ilUserImportParser::$cdata
private

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

◆ $conflict_rule

int ilUserImportParser::$conflict_rule
private

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

◆ $contained_tags

array ilUserImportParser::$contained_tags = []
private

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

◆ $currActive

string ilUserImportParser::$currActive = null
private

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

◆ $current_messenger_type

string ilUserImportParser::$current_messenger_type
private

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

◆ $current_pref_key

string ilUserImportParser::$current_pref_key = null
private

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

◆ $current_role_action

string ilUserImportParser::$current_role_action
private

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

◆ $current_role_id

string ilUserImportParser::$current_role_id = '0'
private

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

◆ $current_role_type

string ilUserImportParser::$current_role_type
private

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

◆ $current_user_password

string ilUserImportParser::$current_user_password
private

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

◆ $current_user_password_type

string ilUserImportParser::$current_user_password_type
private

Definition at line 146 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 145 of file class.ilUserImportParser.php.

◆ $folder_id

int ilUserImportParser::$folder_id
private

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

Referenced by getFolderId().

◆ $ilias

ILIAS ilUserImportParser::$ilias
private

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

◆ $local_role_cache

array ilUserImportParser::$local_role_cache
private

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

◆ $logins

array ilUserImportParser::$logins
private

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

◆ $mapping_mode

int ilUserImportParser::$mapping_mode
private

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

◆ $mode

int ilUserImportParser::$mode
private

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

◆ $multi_values

array ilUserImportParser::$multi_values
private

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

◆ $object_data_cache

ilObjectDataCache ilUserImportParser::$object_data_cache
private

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

◆ $parent_roles_cache

array ilUserImportParser::$parent_roles_cache
private

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

◆ $personal_picture

array ilUserImportParser::$personal_picture = null
private

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

◆ $prefs

array ilUserImportParser::$prefs
private

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

◆ $protocol

array ilUserImportParser::$protocol
private

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

◆ $rbac_admin

ilRbacAdmin ilUserImportParser::$rbac_admin
private

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

◆ $rbac_review

ilRbacReview ilUserImportParser::$rbac_review
private

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

◆ $recommended_content_manager

ilRecommendedContentManager ilUserImportParser::$recommended_content_manager
private

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

◆ $refinery

Refinery ilUserImportParser::$refinery
private

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

◆ $req_send_mail

string ilUserImportParser::$req_send_mail
private

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

◆ $required_fields

array ilUserImportParser::$required_fields = []
private

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

◆ $role_assign

array ilUserImportParser::$role_assign
private

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

◆ $roles

array ilUserImportParser::$roles
private

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

◆ $send_mail

bool ilUserImportParser::$send_mail
private

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

◆ $settings

ilSetting ilUserImportParser::$settings
private

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

◆ $skin

string ilUserImportParser::$skin = ''
private

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

◆ $style

string ilUserImportParser::$style = ''
private

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

◆ $time_limit_owner_set

bool ilUserImportParser::$time_limit_owner_set = false
private

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

◆ $time_limit_set

bool ilUserImportParser::$time_limit_set = false
private

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

◆ $tmp_udf_id

string ilUserImportParser::$tmp_udf_id = null
private

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

◆ $tmp_udf_name

string ilUserImportParser::$tmp_udf_name = null
private

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

◆ $udf_data

array ilUserImportParser::$udf_data
private

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

◆ $update_look_and_skin

bool ilUserImportParser::$update_look_and_skin = false
private

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

◆ $user

ilObjUser ilUserImportParser::$user
private

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

◆ $user_count

int ilUserImportParser::$user_count
private

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

◆ $user_id

int ilUserImportParser::$user_id
private

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

◆ $user_mapping

array ilUserImportParser::$user_mapping = []
private

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

◆ $user_obj

ilObjUser ilUserImportParser::$user_obj
private

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

◆ $user_profile

Profile ilUserImportParser::$user_profile
private

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

◆ $user_styles

array ilUserImportParser::$user_styles
private

Definition at line 167 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 33 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 41 of file class.ilUserImportParser.php.

◆ IL_VERIFY

const ilUserImportParser::IL_VERIFY = 3

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