ILIAS
Release_3_10_x_branch Revision 61812
|
Public Member Functions | |
ilUserImportParser ($a_xml_file= '', $a_mode=IL_USER_IMPORT, $a_conflict_rule=IL_FAIL_ON_CONFLICT) | |
Constructor. | |
setFolderId ($a_folder_id) | |
assign users to this folder (normally the usr_folder) But if called from local admin => the ref_id of the category public | |
getFolderId () | |
setHandlers ($a_xml_parser) | |
set event handler should be overwritten by inherited class private | |
startParsing () | |
start the parser | |
setRoleAssignment ($a_assign) | |
set import to local role assignemt | |
buildTag ($type, $name, $attr="") | |
generate a tag with given name and attributes | |
handlerBeginTag ($a_xml_parser, $a_name, $a_attribs) | |
handler for begin of element | |
extractRolesBeginTag ($a_xml_parser, $a_name, $a_attribs) | |
handler for begin of element in extract roles mode | |
importBeginTag ($a_xml_parser, $a_name, $a_attribs) | |
handler for begin of element in user import mode | |
verifyBeginTag ($a_xml_parser, $a_name, $a_attribs) | |
handler for begin of element | |
handlerEndTag ($a_xml_parser, $a_name) | |
handler for end of element | |
extractRolesEndTag ($a_xml_parser, $a_name) | |
handler for end of element when in extract roles mode. | |
getRoleObject ($a_role_id) | |
Returns the parent object of the role folder object which contains the specified role. | |
getCourseMembersObjectForRole ($a_role_id) | |
Returns the parent object of the role folder object which contains the specified role. | |
assignToRole ($a_user_obj, $a_role_id) | |
Assigns a user to a role. | |
getParentRoleIds ($a_role_id) | |
Get array of parent role ids from cache. | |
assignToRoleWithParents ($a_user_obj, $a_role_id) | |
Assigns a user to a role and to all parent roles. | |
detachFromRole ($a_user_obj, $a_role_id) | |
Detachs a user from a role. | |
importEndTag ($a_xml_parser, $a_name) | |
handler for end of element when in import user mode. | |
saveTempImage ($image_data, $filename) | |
Saves binary image data to a temporary image file and returns the name of the image file on success. | |
verifyEndTag ($a_xml_parser, $a_name) | |
handler for end of element when in verify mode. | |
handlerCharacterData ($a_xml_parser, $a_data) | |
handler for character data | |
getCollectedRoles () | |
get collected roles | |
getUserCount () | |
get count of User elements | |
logWarning ($aLogin, $aMessage) | |
Writes a warning log message to the protocol. | |
logFailure ($aLogin, $aMessage) | |
Writes a failure log message to the protocol. | |
logSuccess ($aLogin, $userid, $action) | |
Writes a success log message to the protocol. | |
getProtocol () | |
Returns the protocol. | |
getProtocolAsHTML ($a_log_title) | |
Returns the protocol as a HTML table. | |
isSuccess () | |
Returns true, if the import was successful. | |
getErrorLevel () | |
Returns the error level. | |
getUserMapping () | |
returns a map user_id <=> login | |
sendAccountMail () | |
send account mail | |
setSendMail ($value) | |
write access to property send mail | |
isSendMail () | |
read access to property send mail | |
setUserMappingMode ($value) | |
write access to user mapping mode | |
getUserMappingMode () | |
read access to user mapping mode | |
Public Member Functions inherited from ilSaxParser | |
ilSaxParser ($a_xml_file= '', $throwException=false) | |
Constructor setup ILIAS global object public. | |
setXMLContent ($a_xml_content) | |
getXMLContent () | |
getInputType () | |
createParser () | |
create parser | |
setOptions ($a_xml_parser) | |
set parser options | |
openXMLFile () | |
open xml file | |
parse ($a_xml_parser, $a_fp=null) | |
parse xml file | |
freeParser ($a_xml_parser) | |
free xml parser handle | |
setThrowException ($throwException) | |
set error handling |
Data Fields | |
$approve_date_set = false | |
$time_limit_set = false | |
$time_limit_owner_set = false | |
$updateLookAndSkin = false | |
boolean to determine if look and skin should be updated | |
$folder_id | |
$roles | |
$action | |
The Action attribute determines what to do for the current User element. | |
$protocol | |
The variable holds the protocol of the import. | |
$logins | |
This variable is used to collect each login that we encounter in the import data. | |
$conflict_rule | |
Conflict handling rule. | |
$send_mail | |
$error_level | |
This variable is used to report the error level of the validation process or the importing process. | |
$currPasswordType | |
The password type of the current user. | |
$currPassword | |
The password of the current user. | |
$currActive | |
The active state of the current user. | |
$userCount | |
The count of user elements in the XML file. | |
$user_mapping | |
$mapping_mode | |
$localRoleCache | |
Cached local roles. | |
$personalPicture | |
Cached personal picture of the actual user This is used because the ilObjUser object has no field for the personal picture. | |
$ilincdata | |
Cached iLinc data. | |
$parentRolesCache | |
Cached parent roles. | |
$skin | |
ILIAS skin. | |
$style | |
ILIAS style. | |
$userStyles | |
User assigned styles. | |
$hideSkin | |
Indicates if the skins are hidden. | |
$disableSkin | |
Indicates if the skins are enabled. | |
$user_id | |
Data Fields inherited from ilSaxParser | |
$input_type = null | |
$xml_content = '' | |
$ilias | |
$lng | |
$xml_file | |
$throwException = false |
Protected Member Functions | |
isFieldRequired ($fieldname) | |
determine if a field $fieldname is to a required field (global setting) | |
Protected Member Functions inherited from ilSaxParser | |
handleError ($message, $code) | |
use given error handler to handle error message or internal ilias error message handle |
Private Member Functions | |
readRequiredFields () | |
read required fields | |
checkProfileIncomplete ($user_obj) | |
Check if profile is incomplete Will set the usr_data field profile_incomplete if any required field is missing. | |
verifyPref ($key, $value) | |
updateMailPreferences ($usr_id) |
Private Attributes | |
$userObj | |
$current_messenger_type |
User Import Parser.
Definition at line 49 of file class.ilUserImportParser.php.
ilUserImportParser::assignToRole | ( | $a_user_obj, | |
$a_role_id | |||
) |
Assigns a user to a role.
Definition at line 774 of file class.ilUserImportParser.php.
References $ref_id, ilObjUser\_addDesktopItem(), ilObject\_getAllReferences(), and ilObject\_lookupType().
Referenced by assignToRoleWithParents(), and importEndTag().
ilUserImportParser::assignToRoleWithParents | ( | $a_user_obj, | |
$a_role_id | |||
) |
Assigns a user to a role and to all parent roles.
Definition at line 870 of file class.ilUserImportParser.php.
References assignToRole(), and getParentRoleIds().
Referenced by importEndTag().
ilUserImportParser::buildTag | ( | $type, | |
$name, | |||
$attr = "" |
|||
) |
generate a tag with given name and attributes
string | "start" | "end" for starting or ending tag |
string | element/tag name |
array | array of attributes |
Definition at line 400 of file class.ilUserImportParser.php.
|
private |
Check if profile is incomplete Will set the usr_data field profile_incomplete if any required field is missing.
private
Definition at line 2273 of file class.ilUserImportParser.php.
References readRequiredFields().
Referenced by importEndTag().
ilUserImportParser::detachFromRole | ( | $a_user_obj, | |
$a_role_id | |||
) |
Detachs a user from a role.
Definition at line 883 of file class.ilUserImportParser.php.
References getRoleObject().
Referenced by importEndTag().
ilUserImportParser::extractRolesBeginTag | ( | $a_xml_parser, | |
$a_name, | |||
$a_attribs | |||
) |
handler for begin of element in extract roles mode
Definition at line 444 of file class.ilUserImportParser.php.
References ilUtil\__extractId().
Referenced by handlerBeginTag().
ilUserImportParser::extractRolesEndTag | ( | $a_xml_parser, | |
$a_name | |||
) |
handler for end of element when in extract roles mode.
Definition at line 716 of file class.ilUserImportParser.php.
Referenced by handlerEndTag().
ilUserImportParser::getCollectedRoles | ( | ) |
get collected roles
Definition at line 2049 of file class.ilUserImportParser.php.
References $roles.
ilUserImportParser::getCourseMembersObjectForRole | ( | $a_role_id | ) |
Returns the parent object of the role folder object which contains the specified role.
Definition at line 749 of file class.ilUserImportParser.php.
References ilCourseParticipants\_getInstanceByObjId().
ilUserImportParser::getErrorLevel | ( | ) |
Returns the error level.
Definition at line 2171 of file class.ilUserImportParser.php.
References $error_level.
ilUserImportParser::getFolderId | ( | ) |
Definition at line 358 of file class.ilUserImportParser.php.
References $folder_id.
Referenced by importEndTag().
ilUserImportParser::getParentRoleIds | ( | $a_role_id | ) |
Get array of parent role ids from cache.
If necessary, create a new cache entry.
Definition at line 816 of file class.ilUserImportParser.php.
References getRoleObject().
Referenced by assignToRoleWithParents().
ilUserImportParser::getProtocol | ( | ) |
Returns the protocol.
The protocol is an associative array. Keys are login names. Values are non-associative arrays. Each array element contains an error message.
Definition at line 2122 of file class.ilUserImportParser.php.
References $protocol.
Referenced by getProtocolAsHTML().
ilUserImportParser::getProtocolAsHTML | ( | $a_log_title | ) |
Returns the protocol as a HTML table.
Definition at line 2129 of file class.ilUserImportParser.php.
References ilSaxParser\$lng, and getProtocol().
ilUserImportParser::getRoleObject | ( | $a_role_id | ) |
Returns the parent object of the role folder object which contains the specified role.
Definition at line 731 of file class.ilUserImportParser.php.
Referenced by detachFromRole(), and getParentRoleIds().
ilUserImportParser::getUserCount | ( | ) |
get count of User elements
Definition at line 2056 of file class.ilUserImportParser.php.
References $userCount.
ilUserImportParser::getUserMapping | ( | ) |
returns a map user_id <=> login
Definition at line 2181 of file class.ilUserImportParser.php.
References $user_mapping.
ilUserImportParser::getUserMappingMode | ( | ) |
read access to user mapping mode
Definition at line 2235 of file class.ilUserImportParser.php.
References $mapping_mode.
Referenced by importBeginTag(), and verifyBeginTag().
ilUserImportParser::handlerBeginTag | ( | $a_xml_parser, | |
$a_name, | |||
$a_attribs | |||
) |
handler for begin of element
Definition at line 423 of file class.ilUserImportParser.php.
References extractRolesBeginTag(), IL_EXTRACT_ROLES, IL_USER_IMPORT, IL_VERIFY, importBeginTag(), and verifyBeginTag().
ilUserImportParser::handlerCharacterData | ( | $a_xml_parser, | |
$a_data | |||
) |
handler for character data
Definition at line 2033 of file class.ilUserImportParser.php.
ilUserImportParser::handlerEndTag | ( | $a_xml_parser, | |
$a_name | |||
) |
handler for end of element
Definition at line 697 of file class.ilUserImportParser.php.
References extractRolesEndTag(), IL_EXTRACT_ROLES, IL_USER_IMPORT, IL_VERIFY, importEndTag(), and verifyEndTag().
ilUserImportParser::ilUserImportParser | ( | $a_xml_file = '' , |
|
$a_mode = IL_USER_IMPORT , |
|||
$a_conflict_rule = IL_FAIL_ON_CONFLICT |
|||
) |
Constructor.
string | $a_xml_file | xml file |
int | $a_mode | IL_EXTRACT_ROLES | IL_USER_IMPORT | IL_VERIFY |
int | $a_conflict_rue | IL_FAIL_ON_CONFLICT | IL_UPDATE_ON_CONFLICT | IL_IGNORE_ON_CONFLICT |
public
Definition at line 281 of file class.ilUserImportParser.php.
References ilSaxParser\$ilias, ilSaxParser\$lng, $style, ilStyleDefinition\_getAllTemplates(), ilObjStyleSettings\_lookupActivatedStyle(), IL_IMPORT_SUCCESS, IL_USER_MAPPING_LOGIN, and ilSaxParser\ilSaxParser().
ilUserImportParser::importBeginTag | ( | $a_xml_parser, | |
$a_name, | |||
$a_attribs | |||
) |
handler for begin of element in user import mode
Definition at line 463 of file class.ilUserImportParser.php.
References ilSaxParser\$ilias, ilSaxParser\$lng, ilUtil\__extractId(), getUserMappingMode(), IL_USER_MAPPING_ID, and logFailure().
Referenced by handlerBeginTag().
ilUserImportParser::importEndTag | ( | $a_xml_parser, | |
$a_name | |||
) |
handler for end of element when in import user mode.
Definition at line 935 of file class.ilUserImportParser.php.
References ilSaxParser\$ilias, $ilincdata, $ilSetting, ilSaxParser\$lng, $timestamp, $user_id, ilObjUser\_checkExternalAuthAccount(), ilAuthUtils\_getAuthModeName(), ilUserDefinedFields\_getInstance(), ilObjUser\_lookupExternalAccount(), ilObjUser\_uploadPersonalPicture(), assignToRole(), assignToRoleWithParents(), checkProfileIncomplete(), detachFromRole(), getFolderId(), ilObjUser\getUserIdByLogin(), IL_FAIL_ON_CONFLICT, IL_IGNORE_ON_CONFLICT, IL_PASSWD_CRYPT, IL_PASSWD_MD5, IL_PASSWD_PLAIN, IL_UPDATE_ON_CONFLICT, ilUserXMLWriter\isPrefExportable(), logFailure(), logSuccess(), logWarning(), saveTempImage(), sendAccountMail(), ilUserDefinedData\set(), and updateMailPreferences().
Referenced by handlerEndTag().
|
protected |
determine if a field $fieldname is to a required field (global setting)
$fieldname | string value of fieldname, e.g. gender |
Definition at line 2404 of file class.ilUserImportParser.php.
References readRequiredFields().
Referenced by verifyEndTag().
ilUserImportParser::isSendMail | ( | ) |
read access to property send mail
Definition at line 2214 of file class.ilUserImportParser.php.
References $send_mail.
Referenced by sendAccountMail().
ilUserImportParser::isSuccess | ( | ) |
Returns true, if the import was successful.
Definition at line 2162 of file class.ilUserImportParser.php.
References IL_IMPORT_SUCCESS.
ilUserImportParser::logFailure | ( | $aLogin, | |
$aMessage | |||
) |
Writes a failure log message to the protocol.
string | login |
string | message |
Definition at line 2088 of file class.ilUserImportParser.php.
References IL_IMPORT_FAILURE.
Referenced by importBeginTag(), importEndTag(), verifyBeginTag(), verifyEndTag(), and verifyPref().
ilUserImportParser::logSuccess | ( | $aLogin, | |
$userid, | |||
$action | |||
) |
Writes a success log message to the protocol.
string | login |
string | userid |
string | action |
Definition at line 2108 of file class.ilUserImportParser.php.
References $action.
Referenced by importEndTag().
ilUserImportParser::logWarning | ( | $aLogin, | |
$aMessage | |||
) |
Writes a warning log message to the protocol.
string | login |
string | message |
Definition at line 2067 of file class.ilUserImportParser.php.
References IL_IMPORT_SUCCESS, and IL_IMPORT_WARNING.
Referenced by importEndTag(), and verifyEndTag().
|
private |
read required fields
private
Definition at line 2246 of file class.ilUserImportParser.php.
References $ilSetting.
Referenced by checkProfileIncomplete(), and isFieldRequired().
ilUserImportParser::saveTempImage | ( | $image_data, | |
$filename | |||
) |
Saves binary image data to a temporary image file and returns the name of the image file on success.
Definition at line 1662 of file class.ilUserImportParser.php.
References $filename, and ilUtil\ilTempnam().
Referenced by importEndTag().
ilUserImportParser::sendAccountMail | ( | ) |
send account mail
Definition at line 2188 of file class.ilUserImportParser.php.
References isSendMail().
Referenced by importEndTag().
ilUserImportParser::setFolderId | ( | $a_folder_id | ) |
assign users to this folder (normally the usr_folder) But if called from local admin => the ref_id of the category public
Definition at line 353 of file class.ilUserImportParser.php.
ilUserImportParser::setHandlers | ( | $a_xml_parser | ) |
set event handler should be overwritten by inherited class private
Reimplemented from ilSaxParser.
Definition at line 368 of file class.ilUserImportParser.php.
ilUserImportParser::setRoleAssignment | ( | $a_assign | ) |
set import to local role assignemt
array | role assignment (key: import id; value: local role id) |
Definition at line 388 of file class.ilUserImportParser.php.
ilUserImportParser::setSendMail | ( | $value | ) |
write access to property send mail
mixed | $value |
Definition at line 2205 of file class.ilUserImportParser.php.
ilUserImportParser::setUserMappingMode | ( | $value | ) |
write access to user mapping mode
int | $value | must be one of IL_USER_MAPPING_ID or IL_USER_MAPPING_LOGIN, die otherwise |
Definition at line 2223 of file class.ilUserImportParser.php.
References IL_USER_MAPPING_ID, and IL_USER_MAPPING_LOGIN.
ilUserImportParser::startParsing | ( | ) |
start the parser
Reimplemented from ilSaxParser.
Definition at line 378 of file class.ilUserImportParser.php.
|
private |
Definition at line 2484 of file class.ilUserImportParser.php.
Referenced by importEndTag().
ilUserImportParser::verifyBeginTag | ( | $a_xml_parser, | |
$a_name, | |||
$a_attribs | |||
) |
handler for begin of element
Definition at line 590 of file class.ilUserImportParser.php.
References $action, ilSaxParser\$lng, ilUtil\__extractId(), getUserMappingMode(), IL_USER_MAPPING_ID, and logFailure().
Referenced by handlerBeginTag().
ilUserImportParser::verifyEndTag | ( | $a_xml_parser, | |
$a_name | |||
) |
handler for end of element when in verify mode.
Definition at line 1678 of file class.ilUserImportParser.php.
References $currPasswordType, $ilSetting, ilSaxParser\$lng, $user_id, ilObjUser\_checkExternalAuthAccount(), ilAuthUtils\_getAuthModeName(), ilObjUser\_lookupExternalAccount(), ilObjUser\_lookupId(), ilObjUser\_lookupLogin(), ilObjUser\getUserIdByLogin(), IL_FAIL_ON_CONFLICT, IL_PASSWD_CRYPT, IL_PASSWD_MD5, IL_PASSWD_PLAIN, isFieldRequired(), logFailure(), logWarning(), USER_FOLDER_ID, and verifyPref().
Referenced by handlerEndTag().
|
private |
Definition at line 2411 of file class.ilUserImportParser.php.
References ilTimeZone\_getInstance(), ilUserXMLWriter\isPrefExportable(), and logFailure().
Referenced by verifyEndTag().
ilUserImportParser::$action |
The Action attribute determines what to do for the current User element.
This variable supports the following values: "Insert","Update","Delete".
Definition at line 65 of file class.ilUserImportParser.php.
Referenced by logSuccess(), and verifyBeginTag().
ilUserImportParser::$approve_date_set = false |
Definition at line 51 of file class.ilUserImportParser.php.
ilUserImportParser::$conflict_rule |
Conflict handling rule.
Values: IL_FAIL_ON_CONFLICT IL_UPDATE_ON_CONFLICT IL_IGNORE_ON_CONFLICT
Definition at line 93 of file class.ilUserImportParser.php.
ilUserImportParser::$currActive |
The active state of the current user.
Definition at line 177 of file class.ilUserImportParser.php.
|
private |
Definition at line 270 of file class.ilUserImportParser.php.
ilUserImportParser::$currPassword |
The password of the current user.
Definition at line 173 of file class.ilUserImportParser.php.
ilUserImportParser::$currPasswordType |
The password type of the current user.
Definition at line 169 of file class.ilUserImportParser.php.
Referenced by verifyEndTag().
ilUserImportParser::$disableSkin |
Indicates if the skins are enabled.
Definition at line 250 of file class.ilUserImportParser.php.
ilUserImportParser::$error_level |
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:
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:
In IL_IGNORE_ON_CONFLICT mode, the following may have occured:
IL_IMPORT_FAILURE The import could not be completed.
In IL_FAIL_ON_CONFLICT mode, the following may have occured:
Definition at line 164 of file class.ilUserImportParser.php.
Referenced by getErrorLevel().
ilUserImportParser::$folder_id |
Definition at line 59 of file class.ilUserImportParser.php.
Referenced by getFolderId().
ilUserImportParser::$hideSkin |
Indicates if the skins are hidden.
Definition at line 245 of file class.ilUserImportParser.php.
ilUserImportParser::$ilincdata |
Cached iLinc data.
Definition at line 216 of file class.ilUserImportParser.php.
Referenced by importEndTag().
ilUserImportParser::$localRoleCache |
Cached local roles.
This is used to speed up access to local roles. This is an associative array. The key is either a role_id or a role_id with the string "_courseMembersObject" appended. The value is a role object or the course members object for which the role is defined
Definition at line 205 of file class.ilUserImportParser.php.
ilUserImportParser::$logins |
This variable is used to collect each login that we encounter in the import data.
This variable is needed to detect duplicate logins in the import data. The variable is an associative array. (I would prefer using a set, but PHP does not appear to support sets.) Keys are logins. Values are logins.
Definition at line 84 of file class.ilUserImportParser.php.
ilUserImportParser::$mapping_mode |
Definition at line 196 of file class.ilUserImportParser.php.
Referenced by getUserMappingMode().
ilUserImportParser::$parentRolesCache |
Cached parent roles.
This is used to speed up assignment to local roles with parents. This is an associative array. The key is a role_id . The value is an array of role_ids containing all parent roles.
Definition at line 225 of file class.ilUserImportParser.php.
ilUserImportParser::$personalPicture |
Cached personal picture of the actual user This is used because the ilObjUser object has no field for the personal picture.
Definition at line 211 of file class.ilUserImportParser.php.
ilUserImportParser::$protocol |
The variable holds the protocol of the import.
This variable is an associative array.
Definition at line 74 of file class.ilUserImportParser.php.
Referenced by getProtocol().
ilUserImportParser::$roles |
Definition at line 60 of file class.ilUserImportParser.php.
Referenced by getCollectedRoles().
ilUserImportParser::$send_mail |
Definition at line 101 of file class.ilUserImportParser.php.
Referenced by isSendMail().
ilUserImportParser::$skin |
ILIAS skin.
Definition at line 230 of file class.ilUserImportParser.php.
ilUserImportParser::$style |
ILIAS style.
Definition at line 235 of file class.ilUserImportParser.php.
Referenced by ilUserImportParser().
ilUserImportParser::$time_limit_owner_set = false |
Definition at line 53 of file class.ilUserImportParser.php.
ilUserImportParser::$time_limit_set = false |
Definition at line 52 of file class.ilUserImportParser.php.
ilUserImportParser::$updateLookAndSkin = false |
boolean to determine if look and skin should be updated
Definition at line 58 of file class.ilUserImportParser.php.
ilUserImportParser::$user_id |
Definition at line 257 of file class.ilUserImportParser.php.
Referenced by importEndTag(), and verifyEndTag().
ilUserImportParser::$user_mapping |
Definition at line 188 of file class.ilUserImportParser.php.
Referenced by getUserMapping().
ilUserImportParser::$userCount |
The count of user elements in the XML file.
Definition at line 181 of file class.ilUserImportParser.php.
Referenced by getUserCount().
|
private |
Definition at line 263 of file class.ilUserImportParser.php.
ilUserImportParser::$userStyles |
User assigned styles.
Definition at line 240 of file class.ilUserImportParser.php.