ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
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 2170 of file class.ilUserImportParser.php.

2170 : \ilObjUser
2171 {
2172 return $user->withProfileData(
2173 array_reduce(
2174 array_keys($this->udf_data),
2175 fn(ProfileData $c, string $v): ProfileData =>
2176 $c->withAdditionalFieldByIdentifier(
2177 $v,
2178 $this->udf_data[$v]
2179 ),
2180 $this->user_obj->getProfileData()
2181 )
2182 );
2183 }
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 673 of file class.ilUserImportParser.php.

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

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

2066 : bool
2067 {
2068 return $this->user_profile->isProfileIncomplete($user_obj);
2069 }

◆ detachFromRole()

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

Detaches a user from a role.

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

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

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

◆ fetchFieldIdFromImportId()

ilUserImportParser::fetchFieldIdFromImportId ( string  $import_id)
private

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

2199 : ?string
2200 {
2201 if ($import_id === '') {
2202 return null;
2203 }
2204
2205 $parts = explode('_', $import_id);
2206 if (($parts[0] ?? '') !== 'il'
2207 || ($parts[1] ?? '') !== 'udf'
2208 || ($parts[2] ?? '') === ''
2209 || $this->user_profile->getFieldByIdentifier($parts[2]) === null) {
2210 return null;
2211 }
2212 return $parts[2];
2213 }
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 2215 of file class.ilUserImportParser.php.

2215 : ?string
2216 {
2217 foreach ($this->user_profile->getAllUserDefinedFields() as $field) {
2218 if ($field->getLabel($this->lng) === $name) {
2219 return $field->getIdentifier();
2220 }
2221 }
2222 return null;
2223 }

◆ getCDataWithoutTags()

ilUserImportParser::getCDataWithoutTags ( )
private

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

2225 : string
2226 {
2227 return $this->stripTags($this->cdata);
2228 }

◆ getCollectedRoles()

ilUserImportParser::getCollectedRoles ( )
Returns
array[]

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

1880 : array
1881 {
1882 return $this->roles;
1883 }

◆ getCourseMembersObjectForRole()

ilUserImportParser::getCourseMembersObjectForRole ( int  $a_role_id)

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

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

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

1986 : int
1987 {
1988 return $this->error_level;
1989 }
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 709 of file class.ilUserImportParser.php.

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

1943 : array
1944 {
1945 return $this->protocol;
1946 }

◆ getProtocolAsHTML()

ilUserImportParser::getProtocolAsHTML ( string  $a_log_title)

Returns the protocol as a HTML table.

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

1951 : string
1952 {
1953 $block = new ilTemplate('tpl.usr_import_log_block.html', true, true, 'components/ILIAS/User');
1954 $block->setVariable('TXT_LOG_TITLE', $a_log_title);
1955 $block->setVariable('TXT_MESSAGE_ID', $this->lng->txt('login'));
1956 $block->setVariable('TXT_MESSAGE_TEXT', $this->lng->txt('message'));
1957 foreach ($this->getProtocol() as $login => $messages) {
1958 $block->setCurrentBlock('log_row');
1959 $reason = '';
1960 foreach ($messages as $message) {
1961 if ($reason == '') {
1962 $reason = $message;
1963 } else {
1964 $reason .= '<br>' . $message;
1965 }
1966 }
1967 $block->setVariable('MESSAGE_ID', $login);
1968 $block->setVariable('MESSAGE_TEXT', $reason);
1969 $block->parseCurrentBlock();
1970 }
1971 return $block->get();
1972 }
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 641 of file class.ilUserImportParser.php.

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

◆ getUserCount()

ilUserImportParser::getUserCount ( )

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

1885 : int
1886 {
1887 return $this->user_count;
1888 }

◆ getUserMapping()

ilUserImportParser::getUserMapping ( )

returns a map user_id <=> login

Returns
array with user_id as key and login as value

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

1995 : array
1996 {
1997 return $this->user_mapping;
1998 }

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

2040 : int
2041 {
2042 return $this->mapping_mode;
2043 }

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

1867 : void {
1868 if ($a_data !== "\n") {
1869 $a_data = preg_replace('/\t+/', ' ', $a_data);
1870 }
1871
1872 if (strlen($a_data) > 0) {
1873 $this->cdata .= $a_data;
1874 }
1875 }

Referenced by setHandlers().

+ Here is the caller graph for this function:

◆ handlerEndTag()

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

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

608 : void {
609 switch ($this->mode) {
611 $this->extractRolesEndTag($a_xml_parser, $a_name);
612 break;
614 $this->importEndTag($a_xml_parser, $a_name);
615 break;
616 case self::IL_VERIFY:
617 $this->verifyEndTag($a_xml_parser, $a_name);
618 break;
619 }
620 }
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 = isset($a_attribs['Action'])
417 ? $a_attribs['Action']
418 : 'Insert';
419 $this->current_user_password = null;
420 $this->current_user_password_type = null;
421 $this->currActive = null;
422 $this->multi_values = [];
423 break;
424
425 case 'Password':
426 $this->current_user_password_type = $a_attribs['Type'];
427 break;
428 case 'AuthMode':
429 if (array_key_exists('type', $a_attribs)) {
430 switch ($a_attribs['type']) {
431 case 'saml':
432 case 'ldap':
433 if (strcmp('saml', $a_attribs['type']) === 0) {
435 if (count($list) === 1) {
436 $this->auth_mode_set = true;
437 $idp = current($list);
438 $this->user_obj->setAuthMode('saml_' . $idp->getIdpId());
439 }
440 break;
441 }
442 if (strcmp('ldap', $a_attribs['type']) === 0) {
443 // no server id provided => use default server
445 if (count($list) == 1) {
446 $this->auth_mode_set = true;
447 $ldap_id = current($list);
448 $this->user_obj->setAuthMode('ldap_' . $ldap_id);
449 }
450 }
451 break;
452
453 case 'default':
454 case 'local':
455 case 'shibboleth':
456 case 'script':
457 case 'soap':
458 case 'openid':
459 // begin-patch auth_plugin
460 default:
461 $this->auth_mode_set = true;
462 $this->user_obj->setAuthMode($a_attribs['type']);
463 break;
464 }
465 } else {
466 $this->logFailure(
467 $this->user_obj->getLogin(),
468 sprintf($this->lng->txt('usrimport_xml_element_inapplicable'), 'AuthMode', $this->stripTags($a_attribs['type']))
469 );
470 }
471 break;
472
473 case 'UserDefinedField':
474 $this->tmp_udf_id = $a_attribs['Id'];
475 $this->tmp_udf_name = $a_attribs['Name'];
476 break;
477
478 case 'AccountInfo':
479 $this->current_messenger_type = strtolower($a_attribs['Type']);
480 break;
481 case 'GMapInfo':
482 $this->user_obj->setLatitude($a_attribs['latitude']);
483 $this->user_obj->setLongitude($a_attribs['longitude']);
484 $this->user_obj->setLocationZoom($a_attribs['zoom']);
485 break;
486 case 'Pref':
487 $this->current_pref_key = $a_attribs['key'];
488 break;
489 }
490 }
$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 798 of file class.ilUserImportParser.php.

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

2077 : bool
2078 {
2079 $requiredFields = $this->readRequiredFields();
2080 $fieldname = strtolower(trim($fieldname));
2081 return array_key_exists($fieldname, $requiredFields);
2082 }

◆ isSendMail()

ilUserImportParser::isSendMail ( )

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

2017 : bool
2018 {
2019 return $this->send_mail;
2020 }

◆ isSuccess()

ilUserImportParser::isSuccess ( )

Returns true, if the import was successful.

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

1977 : bool
1978 {
1979 return $this->error_level === self::IL_IMPORT_SUCCESS;
1980 }

◆ logFailure()

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

Writes a failure log message to the protocol.

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

1914 : void {
1915 if (!array_key_exists($aLogin, $this->protocol)) {
1916 $this->protocol[$aLogin] = [];
1917 }
1918 if ($aMessage) {
1919 $this->protocol[$aLogin][] = $aMessage;
1920 }
1921 $this->error_level = self::IL_IMPORT_FAILURE;
1922 }

◆ logSuccess()

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

Writes a success log message to the protocol.

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

1931 : void {
1932 $this->user_mapping[$userid] = ['login' => $aLogin, 'action' => $action, 'message' => 'successful'];
1933 }

◆ logWarning()

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

Writes a warning log message to the protocol.

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

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

◆ readRequiredFields()

ilUserImportParser::readRequiredFields ( )
private
Returns
array[]

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

2048 : array
2049 {
2050 if (is_array($this->required_fields)) {
2052 }
2053 foreach ($this->settings->getAll() as $field => $value) {
2054 if (strpos($field, 'require_') === 0 && $value == 1) {
2055 $value = substr($field, 8);
2056 $this->required_fields[$value] = $value;
2057 }
2058 }
2059 return $this->required_fields ?: [];
2060 }

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

1531 : string {
1532 $tempname = ilFileUtils::ilTempnam() . $filename;
1533 $fh = fopen($tempname, 'wb');
1534 if ($fh == false) {
1535 return '';
1536 }
1537 fwrite($fh, $image_data);
1538 fclose($fh);
1539 return $tempname;
1540 }
$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 2003 of file class.ilUserImportParser.php.

2003 : void
2004 {
2005 if ($this->req_send_mail != '' ||
2006 ($this->isSendMail() && $this->user_obj->getEmail() != '')) {
2007 $this->acc_mail->setUser($this->user_obj);
2008 $this->acc_mail->send();
2009 }
2010 }

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

2012 : void
2013 {
2014 $this->send_mail = $value;
2015 }

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

2027 : void
2028 {
2029 if ($value === self::IL_USER_MAPPING_ID || $value === self::IL_USER_MAPPING_LOGIN) {
2030 $this->mapping_mode = $value;
2031 } else {
2032 die('wrong argument using methode setUserMappingMethod in ' . __FILE__);
2033 }
2034 }

◆ stripTags()

ilUserImportParser::stripTags ( string  $string)
private

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

2230 : string
2231 {
2232 return $this->refinery->string()->stripTags()->transform($string);
2233 }

References ILIAS\Repository\refinery().

+ Here is the call graph for this function:

◆ tagContained()

ilUserImportParser::tagContained ( string  $tagname)
private

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

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

◆ updateMailPreferences()

ilUserImportParser::updateMailPreferences ( int  $usr_id)
private

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

2185 : void
2186 {
2187 if (array_key_exists('mail_incoming_type', $this->prefs) ||
2188 array_key_exists('mail_signature', $this->prefs) ||
2189 array_key_exists('mail_linebreak', $this->prefs)
2190 ) {
2191 $mailOptions = new ilMailOptions($usr_id);
2192
2193 $mailOptions->setSignature(array_key_exists('mail_signature', $this->prefs) ? $this->prefs['mail_signature'] : $mailOptions->getSignature());
2194 $mailOptions->setIncomingType(array_key_exists('mail_incoming_type', $this->prefs) ? (int) $this->prefs['mail_incoming_type'] : $mailOptions->getIncomingType());
2195 $mailOptions->updateOptions();
2196 }
2197 }

◆ verifyBeginTag()

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

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

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

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

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

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