ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilObjUserFolderGUI Class Reference
+ Inheritance diagram for ilObjUserFolderGUI:
+ Collaboration diagram for ilObjUserFolderGUI:

Public Member Functions

 setUserOwnerId (int $a_id)
 
 getUserOwnerId ()
 
 executeCommand ()
 
 resetFilterObject ()
 
 addUserObject ()
 Add new user. More...
 
 applyFilterObject ()
 
 viewObject ()
 list users More...
 
 filterUserIdsByRbacOrPositionOfCurrentUser (array $user_ids)
 
 chooseLetterObject ()
 
 cancelUserFolderActionObject ()
 
 cancelSearchActionObject ()
 
 confirmactivateObject ()
 
 confirmdeactivateObject ()
 
 setAccessRestrictionObject (?ilPropertyFormGUI $a_form=null, bool $a_from_search=false)
 
 confirmdeleteObject ()
 
 showActionConfirmation (string $action, bool $a_from_search=false)
 
 deleteUsersObject ()
 
 activateUsersObject ()
 
 deactivateUsersObject ()
 
 restrictAccessObject ()
 
 freeAccessObject ()
 
 userActionObject ()
 
 importUserFormObject ()
 
 initUserImportForm ()
 
 importCancelledObject ()
 
 getImportDir ()
 
 importUserRoleAssignmentObject ()
 display form for user import with new FileSystem implementation More...
 
 verifyXmlData (ilUserImportParser $import_parser)
 
 importUsersObject ()
 Import Users with new form implementation. More...
 
 downloadExportFileObject ()
 Download selected export files Sends a selected export file for download. More...
 
 confirmDeleteExportFileObject ()
 
 cancelDeleteExportFileObject ()
 
 deleteExportFileObject ()
 
 exportObject ()
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 jumpToUserObject ()
 Jump to edit screen for user. More...
 
 searchUserAccessFilterCallable (array $a_user_ids)
 
 searchResultHandler (array $a_usr_ids, string $a_cmd)
 Handles multi command from repository search gui. More...
 
 getUserMultiCommands (bool $a_search_form=false)
 
 addToExternalSettingsForm (int $a_form_id)
 
- Public Member Functions inherited from ilObjectGUI
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 If true, a creation screen is displayed the current [ref_id] does belong to the parent class The mode is determined in ilRepositoryGUI. More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 editAvailabilityPeriodObject ()
 
 saveAvailabilityPeriodObject ()
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, ?int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Static Public Member Functions

static _goto (string $a_user)
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 

Data Fields

const USER_FIELD_TRANSLATION_MAPPING
 
- Data Fields inherited from ilObjectGUI
const ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 
const SUPPORTED_IMPORT_MIME_TYPES = [MimeType::APPLICATION__ZIP, MimeType::APPLICATION__X_ZIP_COMPRESSED]
 

Protected Member Functions

 addUserAutoCompleteObject ()
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) overwritten to prevent displaying of role templates in local role folders More...
 
 confirmaccessFreeObject ()
 
 initAccessRestrictionForm (bool $a_from_search=false)
 
 confirmaccessRestrictObject ()
 
 getActionUserIds ()
 Get selected items for table action. More...
 
 inAdministration ()
 
 performExportObject ()
 
 getTabs ()
 @abstract overwrite in derived GUI class of your object type More...
 
 usrExportX86Object ()
 
 usrExportCsvObject ()
 
 usrExportXmlObject ()
 
 mailObject ()
 
 addToClipboardObject ()
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 createActionDispatcherGUI ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 getCreationFormsHTML (StandardForm|ilPropertyFormGUI|array $form)
 
 getTitleForCreationFormPage ()
 
 getCreationFormTitle ()
 
 initCreateForm (string $new_type)
 
 didacticTemplatesToForm ()
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 retrieveAdditionalDidacticTemplateOptions ()
 
 addAdoptContentLinkToToolbar ()
 
 addImportButtonToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 parseDidacticTemplateVar (string $var, string $type)
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 routeImportCmdObject ()
 
 importFile (string $file_to_import, string $path_to_uploaded_file_in_temp_dir)
 
 deleteUploadedImportFile (string $path_to_uploaded_file_in_temp_dir)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 @abstract overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current ["ref_id"] value of the request More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 getCreatableObjectTypes ()
 
 buildAddNewItemElements (array $subtypes, string $create_target_class=ilRepositoryGUI::class, ?int $redirect_target_ref_id=null,)
 
 buildGroup (string $create_target_class, array $obj_types_in_group, string $title, array $subtypes)
 

Private Member Functions

 checkUserManipulationAccessBool ()
 
 initUserRoleAssignmentForm (string $xml_file_full_path)
 
 handleUploadedFiles ()
 
 redirectOnRoleWithMissingWrite (int $role_id, array $roles_of_user, array $global_roles, string $import_dir)
 
 redirectAfterImport ()
 
 checkbox (string $name)
 
 raiseErrorOnMissingWrite ()
 

Private Attributes

ilPropertyFormGUI $form
 
array $requested_ids
 
string $selected_action
 
UserGUIRequest $user_request
 
AdminTabs $admin_tabs
 
int $user_owner_id = 0
 
ilDBInterface $db
 
ilMustacheFactory $mail_mustache_factory
 
ilLogger $log
 
ilAppEventHandler $event
 
Filesystem $filesystem
 
FileUpload $upload
 
LegacyArchives $archives
 
ResourceStorage $irss
 
NewAccountMailRepository $account_mail_repo
 
UserSettingsRepository $user_settings_repo
 
ProfileConfigurationRepository $profile_configuration_repo
 
array $profile_field_change_listeners
 

Additional Inherited Members

- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
GlobalHttpState $http
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Refinery $refinery
 
ilFavouritesManager $favourites
 
CustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
Filesystem $temp_file_system
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Detailed Description

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Sascha Hofmann sasch.nosp@m.ahof.nosp@m.mann@.nosp@m.gmx..nosp@m.de
Helmut Schottmüller helmu.nosp@m.t.sc.nosp@m.hottm.nosp@m.uell.nosp@m.er@ma.nosp@m.c.co.nosp@m.m @ilCtrl_Calls ilObjUserFolderGUI: ilPermissionGUI, ilUserTableGUI, ilRepositorySearchGUI, ilExportGUI @ilCtrl_Calls ilObjUserFolderGUI: ILIAS\User\Settings\Administration\SettingsGUI @ilCtrl_Calls ilObjUserFolderGUI: ILIAS\User\Settings\ConfigurationGUI @ilCtrl_Calls ilObjUserFolderGUI: ILIAS\User\Settings\NewAccountMail\SettingsGUI @ilCtrl_Calls ilObjUserFolderGUI: ILIAS\User\Settings\StartingPoint\SettingsGUI @ilCtrl_Calls ilObjUserFolderGUI: ILIAS\User\Profile\Fields\ConfigurationGUI @ilCtrl_Calls ilObjUserFolderGUI: ILIAS\User\Profile\Fields\CustomFieldsGUI @ilCtrl_Calls ilObjUserFolderGUI: ILIAS\User\Profile\Prompt\SettingsGUI

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

Member Function Documentation

◆ _goto()

static ilObjUserFolderGUI::_goto ( string  $a_user)
static

Definition at line 1963 of file class.ilObjUserFolderGUI.php.

1963 : void
1964 {
1965 global $DIC;
1966
1967 $a_user = (int) $a_user;
1968 $main_tpl = $DIC->ui()->mainTemplate();
1969
1970 $ilAccess = $DIC['ilAccess'];
1971 $ilErr = $DIC['ilErr'];
1972 $lng = $DIC['lng'];
1973 $ctrl = $DIC['ilCtrl'];
1974
1975 $a_target = USER_FOLDER_ID;
1976
1977 if ($ilAccess->checkAccess(
1978 'read',
1979 '',
1980 $a_target
1981 )) {
1982 $ctrl->redirectToURL('ilias.php?baseClass=ilAdministrationGUI&ref_id=' . $a_target . '&jmpToUser=' . $a_user);
1983 exit;
1984 } else {
1985 if ($ilAccess->checkAccess(
1986 'read',
1987 '',
1989 )) {
1990 $main_tpl->setOnScreenMessage('failure', sprintf(
1991 $lng->txt('msg_no_perm_read_item'),
1993 ), true);
1995 }
1996 }
1997 $ilErr->raiseError(
1998 $lng->txt('msg_no_perm_read'),
1999 $ilErr->FATAL
2000 );
2001 }
redirectToURL(string $target_url)
@inheritDoc
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
ilLanguage $lng
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
const USER_FOLDER_ID
Definition: constants.php:33
const ROOT_FOLDER_ID
Definition: constants.php:32
exit
$ilErr
Definition: raiseError.php:33
global $DIC
Definition: shib_login.php:26

References $DIC, $ilErr, $lng, ilObjectGUI\_gotoRepositoryRoot(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), exit, ILIAS\Repository\int(), ROOT_FOLDER_ID, and USER_FOLDER_ID.

+ Here is the call graph for this function:

◆ activateUsersObject()

ilObjUserFolderGUI::activateUsersObject ( )

Definition at line 1005 of file class.ilObjUserFolderGUI.php.

1005 : void
1006 {
1007 $this->raiseErrorOnMissingWrite();
1008 $this->showActionConfirmation('activate');
1009 }
showActionConfirmation(string $action, bool $a_from_search=false)

◆ addToClipboardObject()

ilObjUserFolderGUI::addToClipboardObject ( )
protected

Definition at line 2349 of file class.ilObjUserFolderGUI.php.

2349 : void
2350 {
2351 $users = $this->getActionUserIds();
2352 if (!count($users)) {
2353 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'), true);
2354 $this->ctrl->redirect(
2355 $this,
2356 'view'
2357 );
2358 }
2359 $clip = ilUserClipboard::getInstance($GLOBALS['DIC']['ilUser']->getId());
2360 $clip->add($users);
2361 $clip->save();
2362
2363 $this->tpl->setOnScreenMessage('success', $this->lng->txt('clipboard_user_added'), true);
2364 $this->ctrl->redirect(
2365 $this,
2366 'view'
2367 );
2368 }
getActionUserIds()
Get selected items for table action.
static getInstance(int $a_usr_id)
$GLOBALS["DIC"]
Definition: wac.php:54

References $GLOBALS, ILIAS\Repository\ctrl(), ILIAS\Survey\Mode\getId(), ilUserClipboard\getInstance(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ addToExternalSettingsForm()

ilObjUserFolderGUI::addToExternalSettingsForm ( int  $a_form_id)

Definition at line 2287 of file class.ilObjUserFolderGUI.php.

2287 : array // Missing array type.
2288 {
2289 switch ($a_form_id) {
2292
2293 $fields = [];
2294
2295 $subitems = [
2296 'ps_password_change_on_first_login_enabled' => [
2297 $security->isPasswordChangeOnFirstLoginEnabled(),
2299 ],
2300 'ps_password_must_not_contain_loginame' => [
2301 $security->getPasswordMustNotContainLoginnameStatus(),
2303 ],
2304 'ps_password_chars_and_numbers_enabled' => [
2305 $security->isPasswordCharsAndNumbersEnabled(),
2307 ],
2308 'ps_password_special_chars_enabled' => [
2309 $security->isPasswordSpecialCharsEnabled(),
2311 ],
2312 'ps_password_min_length' => $security->getPasswordMinLength(),
2313 'ps_password_max_length' => $security->getPasswordMaxLength(),
2314 'ps_password_uppercase_chars_num' => $security->getPasswordNumberOfUppercaseChars(),
2315 'ps_password_lowercase_chars_num' => $security->getPasswordNumberOfLowercaseChars(),
2316 'ps_password_max_age' => $security->getPasswordMaxAge()
2317 ];
2318 $fields['ps_password_settings'] = [null, null, $subitems];
2319
2320 $subitems = [
2321 'ps_login_max_attempts' => $security->getLoginMaxAttempts(),
2322 'ps_prevent_simultaneous_logins' => [
2323 $security->isPreventionOfSimultaneousLoginsEnabled(),
2325 ]
2326 ];
2327 $fields['ps_security_protection'] = [null, null, $subitems];
2328
2329 return [['generalSettings', $fields]];
2330 }
2331 return [];
2332 }
static _getInstance()
Get instance of ilSecuritySettings.

References ilSecuritySettings\_getInstance(), ilAdministrationSettingsFormHandler\FORM_SECURITY, and ilAdministrationSettingsFormHandler\VALUE_BOOL.

+ Here is the call graph for this function:

◆ addUserAutoCompleteObject()

ilObjUserFolderGUI::addUserAutoCompleteObject ( )
protected

Definition at line 433 of file class.ilObjUserFolderGUI.php.

433 : void
434 {
435 $auto = new ilUserAutoComplete();
436 $auto->addUserAccessFilterCallable(\Closure::fromCallable([$this, 'filterUserIdsByRbacOrPositionOfCurrentUser']));
437 $auto->setSearchFields(['login', 'firstname', 'lastname', 'email', 'second_email']);
438 $auto->enableFieldSearchableCheck(false);
439 $auto->setMoreLinkAvailable(true);
440
441 if ($this->user_request->getFetchAll()) {
442 $auto->setLimit(ilUserAutoComplete::MAX_ENTRIES);
443 }
444
445 echo $auto->getList($this->user_request->getTerm());
446 exit();
447 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References exit, and ilUserAutoComplete\MAX_ENTRIES.

◆ addUserObject()

ilObjUserFolderGUI::addUserObject ( )

Add new user.

Definition at line 357 of file class.ilObjUserFolderGUI.php.

357 : void
358 {
359 $this->ctrl->setParameterByClass(
360 'ilobjusergui',
361 'new_type',
362 'usr'
363 );
364 $this->ctrl->redirectByClass(
365 ['iladministrationgui', 'ilobjusergui'],
366 'create'
367 );
368 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ applyFilterObject()

ilObjUserFolderGUI::applyFilterObject ( )

Definition at line 370 of file class.ilObjUserFolderGUI.php.

370 : void
371 {
372 $utab = new ilUserTableGUI(
373 $this,
374 'view'
375 );
376 $utab->resetOffset();
377 $utab->writeFilterToSession();
378 $this->viewObject();
379 }
TableGUI class for user administration.

References viewObject().

+ Here is the call graph for this function:

◆ cancelDeleteExportFileObject()

ilObjUserFolderGUI::cancelDeleteExportFileObject ( )

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

1877 : void
1878 {
1879 $this->ctrl->redirectByClass(
1880 'ilobjuserfoldergui',
1881 'export'
1882 );
1883 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ cancelSearchActionObject()

ilObjUserFolderGUI::cancelSearchActionObject ( )

Definition at line 536 of file class.ilObjUserFolderGUI.php.

536 : void
537 {
538 $this->ctrl->redirectByClass(
539 'ilrepositorysearchgui',
540 'showSearchResults'
541 );
542 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ cancelUserFolderActionObject()

ilObjUserFolderGUI::cancelUserFolderActionObject ( )

Definition at line 528 of file class.ilObjUserFolderGUI.php.

528 : void
529 {
530 $this->ctrl->redirect(
531 $this,
532 'view'
533 );
534 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ checkbox()

ilObjUserFolderGUI::checkbox ( string  $name)
private

Definition at line 2370 of file class.ilObjUserFolderGUI.php.

2371 {
2372 $checkbox = new ilCheckboxInputGUI($this->lng->txt($name), $name);
2373 $checkbox->setInfo($this->lng->txt($name . '_desc'));
2374 $checkbox->setValue('1');
2375
2376 return $checkbox;
2377 }
This class represents a checkbox property in a property form.

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ checkUserManipulationAccessBool()

ilObjUserFolderGUI::checkUserManipulationAccessBool ( )
private

Definition at line 885 of file class.ilObjUserFolderGUI.php.

885 : bool
886 {
887 return $this->access->checkRbacOrPositionPermissionAccess(
888 'write',
891 );
892 }

References ILIAS\Repository\access(), ilObjUserFolder\ORG_OP_EDIT_USER_ACCOUNTS, and USER_FOLDER_ID.

+ Here is the call graph for this function:

◆ chooseLetterObject()

ilObjUserFolderGUI::chooseLetterObject ( )

Definition at line 462 of file class.ilObjUserFolderGUI.php.

462 : void
463 {
464 $this->ctrl->redirect(
465 $this,
466 'view'
467 );
468 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ confirmaccessFreeObject()

ilObjUserFolderGUI::confirmaccessFreeObject ( )
protected

Definition at line 625 of file class.ilObjUserFolderGUI.php.

625 : void
626 {
627 if (!$this->checkUserManipulationAccessBool()) {
628 $this->ilias->raiseError(
629 $this->lng->txt('msg_no_perm_write'),
630 $this->ilias->error_obj->WARNING
631 );
632 }
633
634 foreach ($this->getActionUserIds() as $id) {
636 $id,
637 false
638 );
639 if ($obj instanceof \ilObjUser) {
640 $obj->setTimeLimitUnlimited(true);
641 $obj->setTimeLimitFrom(null);
642 $obj->setTimeLimitUntil(null);
643 $obj->update();
644 }
645 }
646
647 // Feedback
648 $this->tpl->setOnScreenMessage('success', $this->lng->txt('access_free_granted'), true);
649
650 if ($this->user_request->getFrSearch()) {
651 $this->ctrl->redirectByClass(
652 'ilRepositorySearchGUI',
653 'show'
654 );
655 } else {
656 $this->ctrl->redirect(
657 $this,
658 'view'
659 );
660 }
661 }
User class.
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
Class ilObjForumAdministration.

References $id, ILIAS\Repository\ctrl(), ilObjectFactory\getInstanceByObjId(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ confirmaccessRestrictObject()

ilObjUserFolderGUI::confirmaccessRestrictObject ( )
protected
Exceptions
ilCtrlException
ilDatabaseException
ilObjectNotFoundException

Definition at line 741 of file class.ilObjUserFolderGUI.php.

741 : bool
742 {
744 if (!$form->checkInput()) {
745 return $this->setAccessRestrictionObject($form);
746 }
747
748 $timefrom = $form->getItemByPostVar('from')->getDate()->get(IL_CAL_UNIX);
749 $timeuntil = $form->getItemByPostVar('to')->getDate()->get(IL_CAL_UNIX);
750 if ($timeuntil <= $timefrom) {
751 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('time_limit_not_valid'));
752 return $this->setAccessRestrictionObject($form);
753 }
754
755 if (!$this->checkUserManipulationAccessBool()) {
756 $this->ilias->raiseError(
757 $this->lng->txt('msg_no_perm_write'),
758 $this->ilias->error_obj->WARNING
759 );
760 }
761 foreach ($this->getActionUserIds() as $id) {
763 $id,
764 false
765 );
766 if ($obj instanceof \ilObjUser) {
767 $obj->setTimeLimitUnlimited(false);
768 $obj->setTimeLimitFrom((int) $timefrom);
769 $obj->setTimeLimitUntil((int) $timeuntil);
770 $obj->update();
771 }
772 }
773 $this->tpl->setOnScreenMessage('success', $this->lng->txt('access_restricted'), true);
774
775 if ($this->user_request->getFrSearch()) {
776 $this->ctrl->redirectByClass(
777 'ilRepositorySearchGUI',
778 'show'
779 );
780 } else {
781 $this->ctrl->redirect(
782 $this,
783 'view'
784 );
785 }
786 return false;
787 }
const IL_CAL_UNIX
setAccessRestrictionObject(?ilPropertyFormGUI $a_form=null, bool $a_from_search=false)
initAccessRestrictionForm(bool $a_from_search=false)
getItemByPostVar(string $a_post_var)

References $id, ilPropertyFormGUI\checkInput(), ILIAS\Repository\ctrl(), ilObjectFactory\getInstanceByObjId(), ilPropertyFormGUI\getItemByPostVar(), IL_CAL_UNIX, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ confirmactivateObject()

ilObjUserFolderGUI::confirmactivateObject ( )

Definition at line 544 of file class.ilObjUserFolderGUI.php.

544 : void
545 {
546 if (!$this->checkUserManipulationAccessBool()) {
547 $this->ilias->raiseError(
548 $this->lng->txt('msg_no_perm_write'),
549 $this->ilias->error_obj->WARNING
550 );
551 }
552
553 // FOR ALL SELECTED OBJECTS
554 foreach ($this->getActionUserIds() as $id) {
556 $id,
557 false
558 );
559 if ($obj instanceof \ilObjUser) {
560 if (!$obj->getActive()) {
561 $obj->setLoginAttempts(0);
562 }
563 $obj->setActive(
564 true,
565 $this->user->getId()
566 );
567 $obj->update();
568 }
569 }
570
571 $this->tpl->setOnScreenMessage('success', $this->lng->txt('user_activated'), true);
572
573 if ($this->user_request->getFrSearch()) {
574 $this->ctrl->redirectByClass(
575 'ilRepositorySearchGUI',
576 'show'
577 );
578 } else {
579 $this->ctrl->redirect(
580 $this,
581 'view'
582 );
583 }
584 }

References $id, ILIAS\Repository\ctrl(), ilObjectFactory\getInstanceByObjId(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ confirmdeactivateObject()

ilObjUserFolderGUI::confirmdeactivateObject ( )

Definition at line 586 of file class.ilObjUserFolderGUI.php.

586 : void
587 {
588 if (!$this->checkUserManipulationAccessBool()) {
589 $this->ilias->raiseError(
590 $this->lng->txt('msg_no_perm_write'),
591 $this->ilias->error_obj->WARNING
592 );
593 }
594 // FOR ALL SELECTED OBJECTS
595 foreach ($this->getActionUserIds() as $id) {
597 $id,
598 false
599 );
600 if ($obj instanceof \ilObjUser) {
601 $obj->setActive(
602 false,
603 $this->user->getId()
604 );
605 $obj->update();
606 }
607 }
608
609 // Feedback
610 $this->tpl->setOnScreenMessage('success', $this->lng->txt('user_deactivated'), true);
611
612 if ($this->user_request->getFrSearch()) {
613 $this->ctrl->redirectByClass(
614 'ilRepositorySearchGUI',
615 'show'
616 );
617 } else {
618 $this->ctrl->redirect(
619 $this,
620 'view'
621 );
622 }
623 }

References $id, ILIAS\Repository\ctrl(), ilObjectFactory\getInstanceByObjId(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ confirmDeleteExportFileObject()

ilObjUserFolderGUI::confirmDeleteExportFileObject ( )

Definition at line 1841 of file class.ilObjUserFolderGUI.php.

1841 : void
1842 {
1843 $files = $this->user_request->getFiles();
1844 if (count($files) == 0) {
1845 $this->ilias->raiseError(
1846 $this->lng->txt('no_checkbox'),
1847 $this->ilias->error_obj->MESSAGE
1848 );
1849 }
1850
1851 $cgui = new ilConfirmationGUI();
1852 $cgui->setFormAction($this->ctrl->getFormAction($this));
1853 $cgui->setHeaderText($this->lng->txt('info_delete_sure'));
1854 $cgui->setCancel(
1855 $this->lng->txt('cancel'),
1856 'cancelDeleteExportFile'
1857 );
1858 $cgui->setConfirm(
1859 $this->lng->txt('confirm'),
1860 'deleteExportFile'
1861 );
1862
1863 // BEGIN TABLE DATA
1864 foreach ($files as $file) {
1865 $cgui->addItem(
1866 'file[]',
1867 $file,
1868 $file,
1869 ilObject::_getIcon($this->object->getId()),
1870 $this->lng->txt('obj_usrf')
1871 );
1872 }
1873
1874 $this->tpl->setContent($cgui->getHTML());
1875 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.

References ilObject\_getIcon(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ confirmdeleteObject()

ilObjUserFolderGUI::confirmdeleteObject ( )

Definition at line 789 of file class.ilObjUserFolderGUI.php.

789 : void
790 {
791 if (!$this->rbac_system->checkAccess(
792 'delete',
793 $this->object->getRefId()
794 )) {
795 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('msg_no_perm_delete'), true);
796 $this->ctrl->redirect(
797 $this,
798 'view'
799 );
800 }
801
802 $ids = $this->user_request->getIds();
803 if (in_array(
804 $this->user->getId(),
805 $ids
806 )) {
807 $this->ilias->raiseError(
808 $this->lng->txt('msg_no_delete_yourself'),
809 $this->ilias->error_obj->WARNING
810 );
811 }
812
813 // FOR ALL SELECTED OBJECTS
814 foreach ($ids as $id) {
815 // instatiate correct object class (usr)
817 $obj->delete();
818 }
819
820 // Feedback
821 $this->tpl->setOnScreenMessage('success', $this->lng->txt('user_deleted'), true);
822
823 if ($this->user_request->getFrSearch()) {
824 $this->ctrl->redirectByClass(
825 'ilRepositorySearchGUI',
826 'show'
827 );
828 } else {
829 $this->ctrl->redirect(
830 $this,
831 'view'
832 );
833 }
834 }

References $id, ILIAS\Repository\ctrl(), ilObjectFactory\getInstanceByObjId(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ deactivateUsersObject()

ilObjUserFolderGUI::deactivateUsersObject ( )

Definition at line 1011 of file class.ilObjUserFolderGUI.php.

1011 : void
1012 {
1013 $this->raiseErrorOnMissingWrite();
1014 if (in_array($this->user->getId(), $this->getActionUserIds())) {
1015 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('no_deactivate_yourself'));
1016 $this->viewObject();
1017 return;
1018 }
1019 $this->showActionConfirmation('deactivate');
1020 }

References ILIAS\Repository\lng(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ deleteExportFileObject()

ilObjUserFolderGUI::deleteExportFileObject ( )

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

1885 : void
1886 {
1887 $this->raiseErrorOnMissingWrite();
1888 $files = $this->user_request->getFiles();
1889 $export_dir = $this->object->getExportDirectory();
1890 foreach ($files as $file) {
1891 $file = basename($file);
1892
1893 $exp_file = $export_dir . '/' . $file;
1894 if (is_file($exp_file)) {
1895 unlink($exp_file);
1896 }
1897 }
1898 $this->ctrl->redirectByClass(
1899 'ilobjuserfoldergui',
1900 'export'
1901 );
1902 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ deleteUsersObject()

ilObjUserFolderGUI::deleteUsersObject ( )

Definition at line 984 of file class.ilObjUserFolderGUI.php.

984 : void
985 {
986 if (!$this->access->checkRbacOrPositionPermissionAccess(
987 'delete',
990 )) {
991 $this->ilias->raiseError(
992 $this->lng->txt('permission_denied'),
993 $this->ilias->error_obj->MESSAGE
994 );
995 }
996
997 if (in_array($this->user->getId(), $this->getActionUserIds())) {
998 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('msg_no_delete_yourself'));
999 $this->viewObject();
1000 return;
1001 }
1002 $this->showActionConfirmation('delete');
1003 }

References ILIAS\Repository\access(), ILIAS\Repository\lng(), ilObjUserFolder\ORG_OP_EDIT_USER_ACCOUNTS, ILIAS\Repository\user(), and USER_FOLDER_ID.

+ Here is the call graph for this function:

◆ downloadExportFileObject()

ilObjUserFolderGUI::downloadExportFileObject ( )

Download selected export files Sends a selected export file for download.

Definition at line 1815 of file class.ilObjUserFolderGUI.php.

1815 : void
1816 {
1817 $files = $this->user_request->getFiles();
1818 if (count($files) == 0) {
1819 $this->ilias->raiseError(
1820 $this->lng->txt('no_checkbox'),
1821 $this->ilias->error_obj->MESSAGE
1822 );
1823 }
1824
1825 if (count($files) > 1) {
1826 $this->ilias->raiseError(
1827 $this->lng->txt('select_max_one_item'),
1828 $this->ilias->error_obj->MESSAGE
1829 );
1830 }
1831
1832 $file = basename($files[0]);
1833
1834 $export_dir = $this->object->getExportDirectory();
1836 $export_dir . '/' . $file,
1837 $file
1838 );
1839 }
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)

References ilFileDelivery\deliverFileLegacy(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ executeCommand()

ilObjUserFolderGUI::executeCommand ( )

Reimplemented from ilObjectGUI.

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

173 : void
174 {
175 $next_class = $this->ctrl->getNextClass($this);
176 $cmd = $this->ctrl->getCmd();
177 $this->prepareOutput();
178
179 switch ($next_class) {
180 case strtolower(ilUserTableGUI::class):
181 $u_table = new ilUserTableGUI(
182 $this,
183 'view'
184 );
185 $u_table->initFilter();
186 $this->ctrl->setReturn(
187 $this,
188 'view'
189 );
190 $this->ctrl->forwardCommand($u_table);
191 break;
192 case strtolower(ilRepositorySearchGUI::class):
193 if (!$this->access->checkRbacOrPositionPermissionAccess(
194 'read',
195 \ilObjUserFolder::ORG_OP_EDIT_USER_ACCOUNTS,
197 )) {
198 $this->ilias->raiseError(
199 $this->lng->txt('permission_denied'),
200 $this->ilias->error_obj->MESSAGE
201 );
202 }
203
204 $user_search = new ilRepositorySearchGUI();
205 $user_search->setTitle($this->lng->txt('search_user_extended')); // #17502
206 $user_search->enableSearchableCheck(false);
207 $user_search->setUserLimitations(false);
208 $user_search->setCallback(
209 $this,
210 'searchResultHandler',
211 $this->getUserMultiCommands(true)
212 );
213 $user_search->addUserAccessFilterCallable([$this, 'searchUserAccessFilterCallable']);
214 $this->ctrl->setReturn(
215 $this,
216 'view'
217 );
218 $this->ctrl->forwardCommand($user_search);
219 break;
220 case strtolower(AdminSettingsGUI::class):
222 $this->ctrl->forwardCommand(
223 new AdminSettingsGUI(
224 $this->lng,
225 $this->ctrl,
226 $this->access,
227 $this->settings,
228 $this->tpl,
229 $this->ui_factory,
230 $this->ui_renderer,
231 $this->refinery,
232 $this->request,
233 $this->profile_configuration_repo
234 )
235 );
236 break;
237 case strtolower(UserSettingsConfigurationGUI::class):
239 $this->ctrl->forwardCommand(
240 new UserSettingsConfigurationGUI(
241 $this->lng,
242 $this->ctrl,
243 $this->access,
244 $this->tpl,
245 $this->ui_factory,
246 $this->ui_renderer,
247 $this->refinery,
248 $this->request,
249 $this->request_wrapper,
250 $this->http,
251 $this->user_settings_repo
252 )
253 );
254 break;
255 case strtolower(NewAccountMailSettingsGUI::class):
257 $this->ctrl->forwardCommand(
258 new NewAccountMailSettingsGUI(
259 $this->lng,
260 $this->ctrl,
261 $this->access,
262 $this->tpl,
263 $this->mail_mustache_factory,
264 $this->ui_factory,
265 $this->ui_renderer,
266 $this->refinery,
267 $this->request,
268 $this->irss,
269 $this->account_mail_repo
270 )
271 );
272 break;
273 case strtolower(StartingPointSettingsGUI::class):
275 $this->ctrl->forwardCommand(
276 new StartingPointSettingsGUI($this->ref_id)
277 );
278 break;
279 case strtolower(ProfileFieldsConfigurationGUI::class):
281 $this->ctrl->forwardCommand(
282 new ProfileFieldsConfigurationGUI(
283 $this->lng,
284 $this->ctrl,
285 $this->event,
286 $this->access,
287 $this->toolbar,
288 $this->tpl,
289 $this->ui_factory,
290 $this->ui_renderer,
291 $this->refinery,
292 $this->request,
293 $this->request_wrapper,
294 $this->post_wrapper,
295 $this->http,
296 $this->profile_field_change_listeners,
297 $this->profile_configuration_repo
298 )
299 );
300 break;
301 case strtolower(CustomFieldsGUI::class):
303 $this->ctrl->forwardCommand(
304 new CustomFieldsGUI(
305 $this->requested_ref_id,
306 $this->user_request->getFieldId()
307 )
308 );
309 break;
310 case strtolower(ProfileSettingsGUI::class):
312 $this->ctrl->forwardCommand(
313 new ProfileSettingsGUI(
314 $this->ctrl,
315 $this->lng,
316 $this->ui_factory,
317 $this->ui_renderer,
318 $this->tpl,
319 $this->request,
320 $this->refinery,
321 new PromptRepository(
322 $this->db,
323 $this->lng,
324 new ilSetting('user')
325 )
326 )
327 );
328 break;
329 case strtolower(ilPermissionGUI::class):
330 $perm_gui = new ilPermissionGUI($this);
331 $this->ctrl->forwardCommand($perm_gui);
332 break;
333 default:
334 if (!$cmd) {
335 $cmd = 'view';
336 }
337 $cmd .= 'Object';
338 $this->$cmd();
339 break;
340 }
341 }
getUserMultiCommands(bool $a_search_form=false)
Class ilObjUserFolder.
prepareOutput(bool $show_sub_objects=true)
ILIAS Setting Class.
static http()
Fetches the global http state from ILIAS.
if(!file_exists('../ilias.ini.php'))

References ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ILIAS\Repository\event(), getUserMultiCommands(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ilObjUserFolder\ORG_OP_EDIT_USER_ACCOUNTS, ilObjectGUI\prepareOutput(), raiseErrorOnMissingWrite(), ILIAS\Repository\refinery(), ILIAS\Repository\settings(), ILIAS\Repository\toolbar(), and USER_FOLDER_ID.

+ Here is the call graph for this function:

◆ exportObject()

ilObjUserFolderGUI::exportObject ( )

Definition at line 1919 of file class.ilObjUserFolderGUI.php.

1919 : void
1920 {
1921 $this->checkPermission('write,read');
1922
1923 $export_types = [
1924 'userfolder_export_excel_x86',
1925 'userfolder_export_xml'
1926 ];
1927 $options = [];
1928 foreach ($export_types as $type) {
1929 $this->ctrl->setParameterByClass(self::class, 'export_type', $type);
1930 $options[] = $this->ui_factory->button()->shy(
1931 $this->lng->txt($type),
1932 $this->ctrl->getLinkTargetByClass(self::class, 'performExport')
1933 );
1934 }
1935 $type_selection = $this->ui_factory->dropdown()->standard($options)
1936 ->withLabel($this->lng->txt('create_export_file'));
1937
1938 $this->toolbar->addComponent(
1939 $type_selection,
1940 true
1941 );
1942
1943 $table = new \ilUserExportFileTableGUI(
1944 $this,
1945 'export'
1946 );
1947 $table->init();
1948 $table->parse($this->object->getExportFiles());
1949
1950 $this->tpl->setContent($table->getHTML());
1951 }
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and ILIAS\Repository\toolbar().

+ Here is the call graph for this function:

◆ filterUserIdsByRbacOrPositionOfCurrentUser()

ilObjUserFolderGUI::filterUserIdsByRbacOrPositionOfCurrentUser ( array  $user_ids)
Parameters
array<int>$user_ids

Definition at line 452 of file class.ilObjUserFolderGUI.php.

452 : array
453 {
454 return $this->access->filterUserIdsByRbacOrPositionOfCurrentUser(
455 'read',
458 $user_ids
459 );
460 }

References ILIAS\Repository\access(), ilObjUserFolder\ORG_OP_EDIT_USER_ACCOUNTS, and USER_FOLDER_ID.

+ Here is the call graph for this function:

◆ freeAccessObject()

ilObjUserFolderGUI::freeAccessObject ( )

Definition at line 1028 of file class.ilObjUserFolderGUI.php.

1028 : void
1029 {
1030 $this->raiseErrorOnMissingWrite();
1031 $this->showActionConfirmation('accessFree');
1032 }

◆ getActionUserIds()

ilObjUserFolderGUI::getActionUserIds ( )
protected

Get selected items for table action.

Returns
array<int>

Definition at line 840 of file class.ilObjUserFolderGUI.php.

840 : array
841 {
842 if ($this->getSelectAllPostArray()['select_cmd_all']) {
843 $utab = new ilUserTableGUI(
844 $this,
845 'view',
847 false
848 );
849
850 if (!$this->access->checkAccess(
851 'read',
852 '',
854 ) &&
855 $this->access->checkRbacOrPositionPermissionAccess(
856 'read',
859 )) {
861 $filtered_users = $this->access->filterUserIdsByRbacOrPositionOfCurrentUser(
862 'read',
865 $users
866 );
867
868 $utab->addFilterItemValue(
869 'user_ids',
870 $filtered_users
871 );
872 }
873
874 return $utab->getUserIdsForFilter();
875 } else {
876 return $this->access->filterUserIdsByRbacOrPositionOfCurrentUser(
877 'read',
880 $this->requested_ids
881 );
882 }
883 }
static _getUserFolderId()
static _getAllUserIds(int $a_filter=0)

References ilLocalUser\_getAllUserIds(), ilLocalUser\_getUserFolderId(), ILIAS\Repository\access(), ilUserTableGUI\MODE_USER_FOLDER, ilObjUserFolder\ORG_OP_EDIT_USER_ACCOUNTS, and USER_FOLDER_ID.

+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjUserFolderGUI::getAdminTabs ( )

administration tabs show only permissions and trash folder

Reimplemented from ilObjectGUI.

Definition at line 1953 of file class.ilObjUserFolderGUI.php.

1953 : void
1954 {
1955 $this->getTabs();
1956 }
getTabs()
@abstract overwrite in derived GUI class of your object type

◆ getImportDir()

ilObjUserFolderGUI::getImportDir ( )

Definition at line 1112 of file class.ilObjUserFolderGUI.php.

1112 : string
1113 {
1114 // For each user session a different directory must be used to prevent
1115 // that one user session overwrites the import data that another session
1116 // is currently importing.
1117
1118 $importDir = 'user_import/usr_' . $this->user->getId() . '_' . mb_substr(session_id(), 0, 8);
1119
1120 return $importDir;
1121 }

References ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ getTabs()

ilObjUserFolderGUI::getTabs ( )
protected

@abstract overwrite in derived GUI class of your object type

Reimplemented from ilObjectGUI.

Definition at line 1958 of file class.ilObjUserFolderGUI.php.

1958 : void
1959 {
1960 $this->admin_tabs->initializeTabs();
1961 }

◆ getUserMultiCommands()

ilObjUserFolderGUI::getUserMultiCommands ( bool  $a_search_form = false)

Definition at line 2062 of file class.ilObjUserFolderGUI.php.

2062 : array // Missing array type.
2063 {
2064 $cmds = [];
2065 // see searchResultHandler()
2066 if ($a_search_form) {
2067 if ($this->rbac_system->checkAccess('write', $this->object->getRefId())) {
2068 $cmds = [
2069 'activate' => $this->lng->txt('activate'),
2070 'deactivate' => $this->lng->txt('deactivate'),
2071 'accessRestrict' => $this->lng->txt('accessRestrict'),
2072 'accessFree' => $this->lng->txt('accessFree')
2073 ];
2074 }
2075
2076 if ($this->rbac_system->checkAccess('delete', $this->object->getRefId())) {
2077 $cmds['delete'] = $this->lng->txt('delete');
2078 }
2079 } else {
2080 if ($this->rbac_system->checkAccess('write', $this->object->getRefId())) {
2081 $cmds = [
2082 'activateUsers' => $this->lng->txt('activate'),
2083 'deactivateUsers' => $this->lng->txt('deactivate'),
2084 'restrictAccess' => $this->lng->txt('accessRestrict'),
2085 'freeAccess' => $this->lng->txt('accessFree')
2086 ];
2087 }
2088
2089 if ($this->rbac_system->checkAccess('delete', $this->object->getRefId())) {
2090 $cmds['deleteUsers'] = $this->lng->txt('delete');
2091 }
2092 }
2093
2094 if ($this->rbac_system->checkAccess('write', $this->object->getRefId())) {
2095 $export_types = [
2096 'userfolder_export_excel_x86',
2097 'userfolder_export_xml'
2098 ];
2099 foreach ($export_types as $type) {
2100 $cmd = explode(
2101 '_',
2102 $type
2103 );
2104 $cmd = array_pop($cmd);
2105 $cmds['usrExport' . ucfirst($cmd)] = $this->lng->txt('export') . ' - ' .
2106 $this->lng->txt($type);
2107 }
2108 }
2109
2110 // check if current user may send mails
2111 $mail = new ilMail($this->user->getId());
2112 if ($this->rbac_system->checkAccess(
2113 'internal_mail',
2114 $mail->getMailObjectReferenceId()
2115 )) {
2116 $cmds['mail'] = $this->lng->txt('send_mail');
2117 }
2118
2119 $cmds['addToClipboard'] = $this->lng->txt('clipboard_add_btn');
2120
2121 return $cmds;
2122 }

References ILIAS\Repository\lng(), and ILIAS\Repository\user().

Referenced by executeCommand().

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

◆ getUserOwnerId()

ilObjUserFolderGUI::getUserOwnerId ( )

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

168 : int
169 {
170 return $this->user_owner_id ?: USER_FOLDER_ID;
171 }

References USER_FOLDER_ID.

◆ handleUploadedFiles()

ilObjUserFolderGUI::handleUploadedFiles ( )
private

Definition at line 1516 of file class.ilObjUserFolderGUI.php.

1516 : string
1517 {
1518 $subdir = '';
1519 $xml_file = '';
1520
1521 $import_dir = $this->getImportDir();
1522
1523 if (!$this->upload->hasBeenProcessed()) {
1524 $this->upload->process();
1525 }
1526
1527 // recreate user import directory
1528 if ($this->filesystem->hasDir($import_dir)) {
1529 $this->filesystem->deleteDir($import_dir);
1530 }
1531 $this->filesystem->createDir($import_dir);
1532
1533 foreach ($this->upload->getResults() as $single_file_upload) {
1534 $file_name = $single_file_upload->getName();
1535 $parts = pathinfo($file_name);
1536
1537 //check if upload status is ok
1538 if (!$single_file_upload->isOK()) {
1539 $this->filesystem->deleteDir($import_dir);
1540 $this->ilias->raiseError(
1541 $this->lng->txt('no_import_file_found'),
1542 $this->ilias->error_obj->MESSAGE
1543 );
1544 }
1545
1546 // move uploaded file to user import directory
1547 $this->upload->moveFilesTo(
1548 $import_dir,
1549 \ILIAS\FileUpload\Location::STORAGE
1550 );
1551
1552 // handle zip file
1553 if ($single_file_upload->getMimeType() == 'application/zip') {
1554 // Workaround: unzip function needs full path to file. Should be replaced once Filesystem has own unzip implementation
1555 $full_path = ilFileUtils::getDataDir() . '/user_import/usr_'
1556 . $this->user->getId() . '_' . session_id() . '/' . $file_name;
1557 $this->archives->unzip($full_path);
1558
1559 $xml_file = null;
1560 $file_list = $this->filesystem->listContents($import_dir);
1561
1562 foreach ($file_list as $key => $a_file) {
1563 if (substr(
1564 $a_file->getPath(),
1565 -4
1566 ) == '.xml') {
1567 unset($file_list[$key]);
1568 $xml_file = $a_file->getPath();
1569 break;
1570 }
1571 }
1572
1573 //Removing all files except the one to be imported, to make sure to get the right one in import-function
1574 foreach ($file_list as $a_file) {
1575 $this->filesystem->delete($a_file->getPath());
1576 }
1577
1578 if (is_null($xml_file)) {
1579 $subdir = basename(
1580 $parts['basename'],
1581 '.' . $parts['extension']
1582 );
1583 $xml_file = $import_dir . '/' . $subdir . '/' . $subdir . '.xml';
1584 }
1585 } // handle xml file
1586 else {
1587 $a = $this->filesystem->listContents($import_dir);
1588 $file = end($a);
1589 $xml_file = $file->getPath();
1590 }
1591
1592 // check xml file
1593 if (!$this->filesystem->has($xml_file)) {
1594 $this->filesystem->deleteDir($import_dir);
1595 $this->ilias->raiseError(
1596 $this->lng->txt('no_xml_file_found_in_zip')
1597 . ' ' . $subdir . '/' . $subdir . '.xml',
1598 $this->ilias->error_obj->MESSAGE
1599 );
1600 }
1601 }
1602
1603 return $xml_file;
1604 }
static getDataDir()
get data directory (outside webspace)
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:61
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples

References Vendor\Package\$a, $parts, ILIAS\Repository\filesystem(), ilFileUtils\getDataDir(), ILIAS\Repository\lng(), ILIAS\Repository\upload(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ importCancelledObject()

ilObjUserFolderGUI::importCancelledObject ( )

Definition at line 1092 of file class.ilObjUserFolderGUI.php.

1092 : void
1093 {
1094 $import_dir = $this->getImportDir();
1095 if ($this->filesystem->hasDir($import_dir)) {
1096 $this->filesystem->deleteDir($import_dir);
1097 }
1098
1099 if ($this->inAdministration()) {
1100 $this->ctrl->redirect(
1101 $this,
1102 'view'
1103 );
1104 } else {
1105 $this->ctrl->redirectByClass(
1106 'ilobjcategorygui',
1107 'listUsers'
1108 );
1109 }
1110 }

References ILIAS\Repository\ctrl(), and ILIAS\Repository\filesystem().

+ Here is the call graph for this function:

◆ importUserFormObject()

ilObjUserFolderGUI::importUserFormObject ( )

Definition at line 1040 of file class.ilObjUserFolderGUI.php.

1040 : void
1041 {
1042 $this->tabs_gui->clearTargets();
1043 $this->tabs_gui->setBackTarget(
1044 $this->lng->txt('usrf'),
1045 $this->ctrl->getLinkTarget(
1046 $this,
1047 'view'
1048 )
1049 );
1050 if (
1051 !$this->rbac_system->checkAccess('create_usr', $this->object->getRefId())
1052 && !$this->access->checkAccess('cat_administrate_users', '', $this->object->getRefId())
1053 ) {
1054 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('permission_denied'));
1055 return;
1056 }
1057 $this->initUserImportForm();
1058 $this->tpl->setContent($this->form->getHTML());
1059 }
form( $class_path, string $cmd, string $submit_caption="")

References ILIAS\Repository\form(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ importUserRoleAssignmentObject()

ilObjUserFolderGUI::importUserRoleAssignmentObject ( )

display form for user import with new FileSystem implementation

Definition at line 1126 of file class.ilObjUserFolderGUI.php.

1126 : void
1127 {
1128 $this->tabs_gui->clearTargets();
1129 $this->tabs_gui->setBackTarget(
1130 $this->lng->txt('usrf'),
1131 $this->ctrl->getLinkTarget(
1132 $this,
1133 'view'
1134 )
1135 );
1136
1137 $this->initUserImportForm();
1138 if ($this->form->checkInput()) {
1139 $xml_file = $this->handleUploadedFiles();
1140 $xml_file_full_path = ilFileUtils::getDataDir() . '/' . $xml_file;
1141
1142 list($form, $message) = $this->initUserRoleAssignmentForm($xml_file_full_path);
1143
1144 $this->tpl->setContent($message . $this->ui_renderer->render($form));
1145 } else {
1146 $this->form->setValuesByPost();
1147 $this->tpl->setContent($this->form->getHTML());
1148 }
1149 }
initUserRoleAssignmentForm(string $xml_file_full_path)
$message
Definition: xapiexit.php:31

References $message, ILIAS\Repository\form(), ilFileUtils\getDataDir(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ importUsersObject()

ilObjUserFolderGUI::importUsersObject ( )

Import Users with new form implementation.

Definition at line 1630 of file class.ilObjUserFolderGUI.php.

1630 : void
1631 {
1632 $result = [];
1633 $xml_file = '';
1634 $import_dir = $this->getImportDir();
1635
1636 $file_list = $this->filesystem->listContents($import_dir);
1637
1638 if (count($file_list) > 1) {
1639 $this->filesystem->deleteDir($import_dir);
1640 $this->tpl->setOnScreenMessage($this->lng->txt('usrimport_wrong_file_count'), true);
1641 $this->redirectAfterImport();
1642 }
1643 $xml_file = $file_list[0]->getPath();
1644
1645 //Need full path to xml file to initialise form
1646 $xml_path = ilFileUtils::getDataDir() . '/' . $xml_file;
1647
1648 if (!$this->user_request->isPost()) {
1649 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('usrimport_form_not_evaluabe'), true);
1650 $this->redirectAfterImport();
1651 }
1652
1653 $form = $this->initUserRoleAssignmentForm($xml_path)[0]->withRequest($this->user_request->getRequest());
1654 $result = $form->getData();
1655
1656 if ($result === null) {
1657 $this->tpl->setContent($this->ui_renderer->render($form));
1658 return;
1659 }
1660
1661 $rule = $result['conflict_action'][0] ?? 1;
1662
1663 //If local roles exist, merge the roles that are to be assigned, otherwise just take the array that has global roles
1664 $local_role_selection = (array) ($result['local_role_selection'] ?? []);
1665 $global_role_selection = (array) ($result['global_role_selection'] ?? []);
1666 $roles = array_merge(
1667 $local_role_selection,
1668 $global_role_selection
1669 );
1670
1671 $role_assignment = [];
1672 foreach ($roles as $value) {
1673 $keys = explode(
1674 '-',
1675 $value
1676 );
1677 if (count($keys) === 2) {
1678 $role_assignment[$keys[0]] = $keys[1];
1679 }
1680 }
1681
1682 $import_parser = new ilUserImportParser(
1683 $xml_path,
1685 (int) $rule
1686 );
1687 $import_parser->setFolderId($this->getUserOwnerId());
1688
1689 // Catch hack attempts
1690 // We check here again, if the role folders are in the tree, and if the
1691 // user has permission on the roles.
1692 if (!empty($role_assignment)) {
1693 $global_roles = $this->rbac_review->getGlobalRoles();
1694 $roles_of_user = $this->rbac_review->assignedRoles($this->user->getId());
1695 foreach ($role_assignment as $role_id_string) {
1696 $role_id = $this->refinery->byTrying([
1697 $this->refinery->kindlyTo()->int(),
1698 $this->refinery->always(null)
1699 ])->transform($role_id_string);
1700 if ($role_id === null) {
1701 continue;
1702 }
1704 $role_id,
1705 $roles_of_user,
1706 $global_roles,
1707 $xml_path
1708 );
1709 }
1710 }
1711
1712 if (isset($result['send_mail'])) {
1713 $import_parser->setSendMail($result['send_mail'][0]);
1714 }
1715
1716 $import_parser->setRoleAssignment($role_assignment);
1717 $import_parser->startParsing();
1718
1719 // purge user import directory
1720 $this->filesystem->deleteDir($import_dir);
1721
1722 switch ($import_parser->getErrorLevel()) {
1724 $this->tpl->setOnScreenMessage(
1725 'success',
1726 $this->lng->txt('user_imported'),
1727 true
1728 );
1729 break;
1731 $this->tpl->setOnScreenMessage(
1732 'success',
1733 $this->lng->txt('user_imported_with_warnings')
1734 . $import_parser->getProtocolAsHTML(
1735 $this->lng->txt('import_warning_log')
1736 ),
1737 true
1738 );
1739 break;
1741 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('user_import_failed'), true);
1742 $this->redirectAfterImport();
1743 break;
1744 }
1745
1746 if ($this->inAdministration()) {
1747 $this->ctrl->redirect(
1748 $this,
1749 'view'
1750 );
1751 } else {
1752 $this->ctrl->redirectByClass(
1753 'ilobjcategorygui',
1754 'listUsers'
1755 );
1756 }
1757 }
redirectOnRoleWithMissingWrite(int $role_id, array $roles_of_user, array $global_roles, string $import_dir)

References ILIAS\Repository\ctrl(), ILIAS\Repository\filesystem(), ilFileUtils\getDataDir(), ilUserImportParser\IL_IMPORT_FAILURE, ilUserImportParser\IL_IMPORT_SUCCESS, ilUserImportParser\IL_IMPORT_WARNING, ilUserImportParser\IL_USER_IMPORT, ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ inAdministration()

ilObjUserFolderGUI::inAdministration ( )
protected

Definition at line 1087 of file class.ilObjUserFolderGUI.php.

1087 : bool
1088 {
1089 return (strtolower($this->user_request->getBaseClass()) === 'iladministrationgui');
1090 }

◆ initAccessRestrictionForm()

ilObjUserFolderGUI::initAccessRestrictionForm ( bool  $a_from_search = false)
protected

Definition at line 676 of file class.ilObjUserFolderGUI.php.

679 $user_ids = $this->getActionUserIds();
680 if (!$user_ids) {
681 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'));
682 $this->viewObject();
683 return null;
684 }
685
686 $form = new ilPropertyFormGUI();
687 $form->setTitle($this->lng->txt('time_limit_add_time_limit_for_selected'));
689 $this->ctrl->getFormAction(
690 $this,
691 'confirmaccessRestrict'
692 )
693 );
694
695 $from = new ilDateTimeInputGUI(
696 $this->lng->txt('access_from'),
697 'from'
698 );
699 $from->setShowTime(true);
700 $from->setRequired(true);
701 $form->addItem($from);
702
703 $to = new ilDateTimeInputGUI(
704 $this->lng->txt('access_until'),
705 'to'
706 );
707 $to->setRequired(true);
708 $to->setShowTime(true);
709 $form->addItem($to);
710
712 'confirmaccessRestrict',
713 $this->lng->txt('confirm')
714 );
716 'view',
717 $this->lng->txt('cancel')
718 );
719
720 foreach ($user_ids as $user_id) {
721 $ufield = new ilHiddenInputGUI('id[]');
722 $ufield->setValue((string) $user_id);
723 $form->addItem($ufield);
724 }
725
726 // return to search?
727 if ($a_from_search || $this->user_request->getFrSearch()) {
728 $field = new ilHiddenInputGUI('frsrch');
729 $field->setValue('1');
730 $form->addItem($field);
731 }
732
733 return $form;
734 }
This class represents a date/time property in a property form.
setFormAction(string $a_formaction)
This class represents a hidden form property in a property form.
This class represents a property form user interface.
addCommandButton(string $a_cmd, string $a_text, string $a_id="")

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ initUserImportForm()

ilObjUserFolderGUI::initUserImportForm ( )

Definition at line 1061 of file class.ilObjUserFolderGUI.php.

1061 : void
1062 {
1063 $this->form = new ilPropertyFormGUI();
1064
1065 // Import File
1066 $fi = new ilFileInputGUI(
1067 $this->lng->txt('import_file'),
1068 'importFile'
1069 );
1070 $fi->setSuffixes(['xml']);
1071 $fi->setRequired(true);
1072 $this->form->addItem($fi);
1073
1074 $this->form->addCommandButton(
1075 'importUserRoleAssignment',
1076 $this->lng->txt('import')
1077 );
1078 $this->form->addCommandButton(
1079 'importCancelled',
1080 $this->lng->txt('cancel')
1081 );
1082
1083 $this->form->setTitle($this->lng->txt('import_users'));
1084 $this->form->setFormAction($this->ctrl->getFormAction($this));
1085 }
This class represents a file property in a property form.

References ILIAS\Repository\ctrl(), ILIAS\Repository\form(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ initUserRoleAssignmentForm()

ilObjUserFolderGUI::initUserRoleAssignmentForm ( string  $xml_file_full_path)
private
Exceptions
ilCtrlException
Returns
array<\ILIAS\UI\Component\Input\Container\Form\Standard, string>

Definition at line 1155 of file class.ilObjUserFolderGUI.php.

1155 : array
1156 {
1157 $global_roles_assignment_info = null;
1158 $local_roles_assignment_info = null;
1159
1160 $import_parser = new ilUserImportParser(
1161 $xml_file_full_path,
1163 );
1164 $import_parser->startParsing();
1165
1166 $message = $this->verifyXmlData($import_parser);
1167
1168 $xml_file_name = explode(
1169 '/',
1170 $xml_file_full_path
1171 );
1172 $roles_import_filename = $this->ui_factory->input()->field()
1173 ->text($this->lng->txt('import_file'))
1174 ->withDisabled(true)
1175 ->withValue(end($xml_file_name));
1176
1177 $roles_import_count = $this->ui_factory->input()->field()
1178 ->numeric($this->lng->txt('num_users'))
1179 ->withDisabled(true)
1180 ->withValue($import_parser->getUserCount());
1181
1182 $import_parser = new ilUserImportParser(
1183 $xml_file_full_path,
1185 );
1186 $import_parser->startParsing();
1187
1188 $roles = $import_parser->getCollectedRoles();
1189 $all_gl_roles = $this->rbac_review->getRoleListByObject(ROLE_FOLDER_ID);
1190 $gl_roles = [];
1191 $roles_of_user = $this->rbac_review->assignedRoles($this->user->getId());
1192 foreach ($all_gl_roles as $obj_data) {
1193 // check assignment permission if called from local admin
1194 if ($this->object->getRefId() != USER_FOLDER_ID
1195 && !in_array(SYSTEM_ROLE_ID, $roles_of_user)
1196 && !ilObjRole::_getAssignUsersStatus($obj_data['obj_id'])
1197 ) {
1198 continue;
1199 }
1200 // exclude anonymous role from list
1201 if ($obj_data['obj_id'] != ANONYMOUS_ROLE_ID
1202 && ($obj_data['obj_id'] != SYSTEM_ROLE_ID
1203 || in_array(SYSTEM_ROLE_ID, $roles_of_user))
1204 ) {
1205 $gl_roles[$obj_data['obj_id']] = $obj_data['title'];
1206 }
1207 }
1208
1209 // global roles
1210 $got_globals = false;
1211 $global_selects = [];
1212 foreach ($roles as $role_id => $role) {
1213 if ($role['type'] === 'Global') {
1214 $select_options = [];
1215 if (!$got_globals) {
1216 $global_roles_assignment_info = $this->ui_factory->input()->field()
1217 ->text($this->lng->txt('roles_of_import_global'))
1218 ->withDisabled(true)
1219 ->withValue($this->lng->txt('assign_global_role'));
1220 } else {
1221 $select_options[] = $this->lng->txt('usrimport_ignore_role');
1222 }
1223
1224 foreach ($gl_roles as $key => $value) {
1225 $select_options[$role_id . '-' . $key] = $value;
1226 }
1227
1228 // pre selection for role
1229 $pre_select = array_search(
1230 $role['name'],
1231 $select_options
1232 );
1233 if (!$pre_select) {
1234 switch ($role['name']) {
1235 case 'Administrator': // ILIAS 2/3 Administrator
1236 $pre_select = array_search(
1237 'Administrator',
1238 $select_options
1239 );
1240 break;
1241
1242 case 'Autor': // ILIAS 2 Author
1243 $pre_select = array_search(
1244 'User',
1245 $select_options
1246 );
1247 break;
1248
1249 case 'Lerner': // ILIAS 2 Learner
1250 $pre_select = array_search(
1251 'User',
1252 $select_options
1253 );
1254 break;
1255
1256 case 'Gast': // ILIAS 2 Guest
1257 $pre_select = array_search(
1258 'Guest',
1259 $select_options
1260 );
1261 break;
1262
1263 case 'User':
1264 $pre_select = array_search(
1265 'User',
1266 $select_options
1267 );
1268 break;
1269 }
1270 }
1271
1272 $select = $this->ui_factory->input()->field()
1273 ->select(
1274 $role['name'],
1275 $select_options
1276 )
1277 ->withValue($pre_select);
1278
1279 if (!$got_globals) {
1280 $got_globals = true;
1281 $global_selects[] = $select->withRequired(true);
1282 } else {
1283 $global_selects[] = $select;
1284 }
1285 }
1286 }
1287
1288 // Check if local roles need to be assigned
1289 $got_locals = false;
1290 foreach ($roles as $role_id => $role) {
1291 if ($role['type'] == 'Local') {
1292 $got_locals = true;
1293 break;
1294 }
1295 }
1296
1297 if ($got_locals) {
1298 $local_roles_assignment_info = $this->ui_factory->input()->field()
1299 ->text($this->lng->txt('roles_of_import_local'))
1300 ->withDisabled(true)
1301 ->withValue($this->lng->txt('assign_local_role'));
1302
1303 // get local roles
1304 if ($this->object->getRefId() == USER_FOLDER_ID) {
1305 // The import function has been invoked from the user folder
1306 // object. In this case, we show only matching roles,
1307 // because the user folder object is considered the parent of all
1308 // local roles and may contains thousands of roles on large ILIAS
1309 // installations.
1310 $loc_roles = [];
1311
1312 $roleMailboxSearch = new ilRoleMailboxSearch(new ilMailRfc822AddressParserFactory());
1313 foreach ($roles as $role_id => $role) {
1314 if ($role['type'] == 'Local') {
1315 $searchName = (strpos($role['name'], '#') === 0) ? $role['name'] : '#' . $role['name'];
1316 $matching_role_ids = $roleMailboxSearch->searchRoleIdsByAddressString($searchName);
1317 foreach ($matching_role_ids as $mid) {
1318 if (!in_array(
1319 $mid,
1320 $loc_roles
1321 )) {
1322 $loc_roles[] = $mid;
1323 }
1324 }
1325 }
1326 }
1327 } else {
1328 // The import function has been invoked from a locally
1329 // administrated category. In this case, we show all roles
1330 // contained in the subtree of the category.
1331 $loc_roles = $this->rbac_review->getAssignableRolesInSubtree($this->object->getRefId());
1332 }
1333 $l_roles = [];
1334
1335 // create a search array with .
1336 foreach ($loc_roles as $key => $loc_role) {
1337 // fetch context path of role
1338 $rolf = $this->rbac_review->getFoldersAssignedToRole(
1339 $loc_role,
1340 true
1341 );
1342
1343 // only process role folders that are not set to status 'deleted'
1344 // and for which the user has write permissions.
1345 // We also don't show the roles which are in the ROLE_FOLDER_ID folder.
1346 // (The ROLE_FOLDER_ID folder contains the global roles).
1347 if (
1348 !$this->rbac_review->isDeleted($rolf[0]) &&
1349 $this->rbac_system->checkAccess(
1350 'write',
1351 $rolf[0]
1352 ) &&
1353 $rolf[0] != ROLE_FOLDER_ID
1354 ) {
1355 // A local role is only displayed, if it is contained in the subtree of
1356 // the localy administrated category. If the import function has been
1357 // invoked from the user folder object, we show all local roles, because
1358 // the user folder object is considered the parent of all local roles.
1359 // Thus, if we start from the user folder object, we initialize the
1360 // isInSubtree variable with true. In all other cases it is initialized
1361 // with false, and only set to true if we find the object id of the
1362 // locally administrated category in the tree path to the local role.
1363 $is_in_subtree = $this->object->getRefId() == USER_FOLDER_ID;
1364
1365 $path_array = [];
1366 if ($this->tree->isInTree($rolf[0])) {
1367 // Create path. Paths which have more than 4 segments
1368 // are truncated in the middle.
1369 $tmpPath = $this->tree->getPathFull($rolf[0]);
1370 $tmpPath[] = $rolf[0];//adds target item to list
1371
1372 for ($i = 1, $n = count($tmpPath) - 1; $i < $n; $i++) {
1373 if ($i < 3 || $i > $n - 3) {
1374 $path_array[] = $tmpPath[$i]['title'];
1375 } elseif ($i == 3 || $i == $n - 3) {
1376 $path_array[] = '...';
1377 }
1378
1379 $is_in_subtree |= $tmpPath[$i]['obj_id'] == $this->object->getId();
1380 }
1381 //revert this path for a better readability in dropdowns #18306
1382 $path = implode(
1383 ' < ',
1384 array_reverse($path_array)
1385 );
1386 } else {
1387 $path = '<b>Rolefolder ' . $rolf[0] . ' not found in tree! (Role ' . $loc_role . ')</b>';
1388 }
1389 $roleMailboxAddress = (new \ilRoleMailboxAddress($loc_role))->value();
1390 $l_roles[$loc_role] = $roleMailboxAddress . ', ' . $path;
1391 }
1392 }
1393
1394 natcasesort($l_roles);
1395 $l_roles['ignore'] = $this->lng->txt('usrimport_ignore_role');
1396
1397 $roleMailboxSearch = new ilRoleMailboxSearch(new ilMailRfc822AddressParserFactory());
1398 $local_selects = [];
1399 foreach ($roles as $role_id => $role) {
1400 if ($role['type'] == 'Local') {
1401 $searchName = (strpos($role['name'], '#') === 0) ? $role['name'] : '#' . $role['name'];
1402 $matching_role_ids = $roleMailboxSearch->searchRoleIdsByAddressString($searchName);
1403 $pre_select = count($matching_role_ids) == 1 ? $role_id . '-' . $matching_role_ids[0] : 'ignore';
1404
1405 $selectable_roles = [];
1406 if ($this->object->getRefId() == USER_FOLDER_ID) {
1407 // There are too many roles in a large ILIAS installation
1408 // that's why whe show only a choice with the the option 'ignore',
1409 // and the matching roles.
1410 $selectable_roles['ignore'] = $this->lng->txt('usrimport_ignore_role');
1411 foreach ($matching_role_ids as $id) {
1412 $selectable_roles[$role_id . '-' . $id] = $l_roles[$id];
1413 }
1414 } else {
1415 foreach ($l_roles as $local_role_id => $value) {
1416 if ($local_role_id !== 'ignore') {
1417 $selectable_roles[$role_id . '-' . $local_role_id] = $value;
1418 }
1419 }
1420 }
1421
1422 if (count($selectable_roles) > 0) {
1423 $select = $this->ui_factory->input()->field()
1424 ->select($role['name'], $selectable_roles)
1425 ->withRequired(true);
1426 if (array_key_exists($pre_select, $selectable_roles)) {
1427 $select = $select->withValue($pre_select);
1428 }
1429 $local_selects[] = $select;
1430 }
1431 }
1432 }
1433 }
1434
1435 $handlers = [
1436 ilUserImportParser::IL_IGNORE_ON_CONFLICT => $this->lng->txt('ignore_on_conflict'),
1437 ilUserImportParser::IL_UPDATE_ON_CONFLICT => $this->lng->txt('update_on_conflict')
1438 ];
1439
1440 $conflict_action_select = $this->ui_factory->input()->field()
1441 ->select(
1442 $this->lng->txt('conflict_handling'),
1443 $handlers,
1444 str_replace(
1445 '\n',
1446 '<br>',
1447 $this->lng->txt('usrimport_conflict_handling_info')
1448 )
1449 )
1451 ->withRequired(true);
1452
1453 // new account mail
1454 $this->lng->loadLanguageModule('mail');
1455 $amail = $this->account_mail_repo->getFor($this->lng->getDefaultLanguage());
1456 $mail_section = null;
1457 if ($amail->getSubject() !== '' && $amail->getBody() !== '') {
1458 $send_checkbox = $this->ui_factory->input()->field()->checkbox($this->lng->txt('user_send_new_account_mail'))
1459 ->withValue(true);
1460
1461 $mail_section = $this->ui_factory->input()->field()->section(
1462 [$send_checkbox],
1463 $this->lng->txt('mail_account_mail')
1464 );
1465 }
1466
1467 $file_info_section = $this->ui_factory->input()->field()->section(
1468 [
1469 'filename' => $roles_import_filename,
1470 'import_count' => $roles_import_count,
1471 ],
1472 $this->lng->txt('file_info')
1473 );
1474
1475 $form_action = $this->ctrl->getFormActionByClass(self::class, 'importUsers');
1476
1477 $form_elements = [
1478 'file_info' => $file_info_section
1479 ];
1480
1481 if (!empty($global_selects)) {
1482 $global_role_info_section = $this->ui_factory->input()
1483 ->field()
1484 ->section([$global_roles_assignment_info], $this->lng->txt('global_role_assignment'));
1485 $global_role_selection_section = $this->ui_factory->input()->field()->section($global_selects, '');
1486 $form_elements['global_role_info'] = $global_role_info_section;
1487 $form_elements['global_role_selection'] = $global_role_selection_section;
1488 }
1489
1490 if (!empty($local_selects)) {
1491 $local_role_info_section = $this->ui_factory->input()->field()->section(
1492 [$local_roles_assignment_info],
1493 $this->lng->txt('local_role_assignment')
1494 );
1495 $local_role_selection_section = $this->ui_factory->input()->field()->section(
1496 $local_selects,
1497 ''
1498 );
1499
1500 $form_elements['local_role_info'] = $local_role_info_section;
1501 $form_elements['local_role_selection'] = $local_role_selection_section;
1502 }
1503
1504 $form_elements['conflict_action'] = $this->ui_factory->input()->field()->section([$conflict_action_select], '');
1505
1506 if ($mail_section !== null) {
1507 $form_elements['send_mail'] = $mail_section;
1508 }
1509
1510 return [$this->ui_factory->input()->container()->form()->standard(
1512 $form_elements
1513 ), $message];
1514 }
static _getAssignUsersStatus(int $a_role_id)
verifyXmlData(ilUserImportParser $import_parser)
const SYSTEM_ROLE_ID
Definition: constants.php:29
const ANONYMOUS_ROLE_ID
Definition: constants.php:28
const ROLE_FOLDER_ID
Definition: constants.php:34
$path
Definition: ltiservices.php:30

References $id, $message, $path, ilObjRole\_getAssignUsersStatus(), ANONYMOUS_ROLE_ID, ILIAS\Repository\ctrl(), ilUserImportParser\IL_EXTRACT_ROLES, ilUserImportParser\IL_IGNORE_ON_CONFLICT, ilUserImportParser\IL_UPDATE_ON_CONFLICT, ilUserImportParser\IL_VERIFY, ILIAS\Repository\lng(), ILIAS\Repository\object(), ROLE_FOLDER_ID, SYSTEM_ROLE_ID, ILIAS\Repository\user(), and USER_FOLDER_ID.

+ Here is the call graph for this function:

◆ jumpToUserObject()

ilObjUserFolderGUI::jumpToUserObject ( )

Jump to edit screen for user.

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

2006 : void
2007 {
2008 $jump_to_user = $this->user_request->getJumpToUser();
2009 if (ilObject::_lookupType($jump_to_user) == 'usr') {
2010 $this->ctrl->setParameterByClass(
2011 'ilobjusergui',
2012 'obj_id',
2013 $jump_to_user
2014 );
2015 $this->ctrl->redirectByClass(
2016 'ilobjusergui',
2017 'view'
2018 );
2019 }
2020 }
static _lookupType(int $id, bool $reference=false)

References ilObject\_lookupType(), and ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ mailObject()

ilObjUserFolderGUI::mailObject ( )
protected

Definition at line 2231 of file class.ilObjUserFolderGUI.php.

2231 : void
2232 {
2233 $user_ids = $this->getActionUserIds();
2234 if (!$user_ids) {
2235 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'), true);
2236 $this->ctrl->redirect(
2237 $this,
2238 'view'
2239 );
2240 return;
2241 }
2242
2243 // remove existing (temporary) lists
2244 $old_lists = new ilMailingLists($this->user);
2245 $old_lists->deleteTemporaryLists();
2246
2247 // create (temporary) mailing list
2248 $list = new ilMailingList($this->user);
2249 $list->setMode(ilMailingList::MODE_TEMPORARY);
2250 $list->setTitle('-TEMPORARY SYSTEM LIST-');
2251 $list->setDescription('-USER ACCOUNTS MAIL-');
2252 $list->setCreatedate(date('Y-m-d H:i:s'));
2253 $list->insert();
2254 $list_id = $list->getId();
2255
2256 // after list has been saved...
2257 foreach ($user_ids as $user_id) {
2258 $list->assignUser((int) $user_id);
2259 }
2260
2261 $umail = new ilFormatMail($this->user->getId());
2262 $mail_data = $umail->retrieveFromStage();
2263
2264 $umail->persistToStage(
2265 $mail_data['user_id'],
2266 $mail_data['attachments'],
2267 '#il_ml_' . $list_id,
2268 $mail_data['rcp_cc'],
2269 $mail_data['rcp_bcc'],
2270 $mail_data['m_subject'],
2271 $mail_data['m_message'],
2272 $mail_data['use_placeholders'],
2273 $mail_data['tpl_ctx_id'],
2274 $mail_data['tpl_ctx_params']
2275 );
2276
2277 $this->ctrl->redirectToURL(
2279 $this,
2280 '',
2281 [],
2282 ['type' => 'search_res']
2283 )
2284 );
2285 }
static getRedirectTarget( $gui, string $cmd, array $gui_params=[], array $mail_params=[], array $context_params=[])
final const int MODE_TEMPORARY

References $user_id, ILIAS\Repository\ctrl(), ilMailFormCall\getRedirectTarget(), ILIAS\Repository\lng(), ilMailingList\MODE_TEMPORARY, and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ performExportObject()

ilObjUserFolderGUI::performExportObject ( )
protected
Exceptions
ilCtrlException
ilObjectException

Definition at line 1908 of file class.ilObjUserFolderGUI.php.

1908 : void
1909 {
1910 $this->checkPermission('write,read');
1911
1912 $this->object->buildExportFile($this->user_request->getExportType());
1913 $this->ctrl->redirect(
1914 $this,
1915 'export'
1916 );
1917 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ raiseErrorOnMissingWrite()

ilObjUserFolderGUI::raiseErrorOnMissingWrite ( )
private

Definition at line 2379 of file class.ilObjUserFolderGUI.php.

2379 : void
2380 {
2381 if (!$this->access->checkRbacOrPositionPermissionAccess(
2382 'write',
2385 )) {
2386 $this->ilias->raiseError(
2387 $this->lng->txt('permission_denied'),
2388 $this->ilias->error_obj->MESSAGE
2389 );
2390 }
2391 }

References ILIAS\Repository\access(), ILIAS\Repository\lng(), ilObjUserFolder\ORG_OP_EDIT_USER_ACCOUNTS, and USER_FOLDER_ID.

Referenced by executeCommand().

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

◆ redirectAfterImport()

ilObjUserFolderGUI::redirectAfterImport ( )
private

Definition at line 2334 of file class.ilObjUserFolderGUI.php.

2334 : void
2335 {
2336 if ($this->inAdministration()) {
2337 $this->ctrl->redirect(
2338 $this,
2339 'view'
2340 );
2341 }
2342
2343 $this->ctrl->redirectByClass(
2344 'ilobjcategorygui',
2345 'listUsers'
2346 );
2347 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ redirectOnRoleWithMissingWrite()

ilObjUserFolderGUI::redirectOnRoleWithMissingWrite ( int  $role_id,
array  $roles_of_user,
array  $global_roles,
string  $import_dir 
)
private

Definition at line 1759 of file class.ilObjUserFolderGUI.php.

1764 : void {
1765 if (in_array(
1766 $role_id,
1767 $global_roles
1768 )) {
1769 if (in_array(
1771 $roles_of_user
1772 )) {
1773 return;
1774 }
1775
1776 if ($role_id === SYSTEM_ROLE_ID
1777 || $this->object->getRefId() !== USER_FOLDER_ID
1779 ) {
1780 $this->filesystem->deleteDir($import_dir);
1781 $this->tpl->setOnScreenMessage(
1782 'failure',
1783 $this->lng->txt('usrimport_with_specified_role_not_permitted'),
1784 true
1785 );
1786 $this->redirectAfterImport();
1787 }
1788 return;
1789 }
1790
1791 $rolf = $this->rbac_review->getFoldersAssignedToRole(
1792 $role_id,
1793 true
1794 );
1795 if ($this->rbac_review->isDeleted($rolf[0])
1796 || !$this->rbac_system->checkAccess(
1797 'write',
1798 $rolf[0]
1799 )
1800 ) {
1801 $this->filesystem->deleteDir($import_dir);
1802 $this->tpl->setOnScreenMessage(
1803 'failure',
1804 $this->lng->txt('usrimport_with_specified_role_not_permitted'),
1805 true
1806 );
1807 $this->redirectAfterImport();
1808 }
1809 }

References ilObjRole\_getAssignUsersStatus(), ILIAS\Repository\filesystem(), ILIAS\Repository\lng(), ILIAS\Repository\object(), SYSTEM_ROLE_ID, and USER_FOLDER_ID.

+ Here is the call graph for this function:

◆ resetFilterObject()

ilObjUserFolderGUI::resetFilterObject ( )

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

343 : void
344 {
345 $utab = new ilUserTableGUI(
346 $this,
347 'view'
348 );
349 $utab->resetOffset();
350 $utab->resetFilter();
351 $this->viewObject();
352 }

References viewObject().

+ Here is the call graph for this function:

◆ restrictAccessObject()

ilObjUserFolderGUI::restrictAccessObject ( )

Definition at line 1022 of file class.ilObjUserFolderGUI.php.

1022 : void
1023 {
1024 $this->raiseErrorOnMissingWrite();
1025 $this->showActionConfirmation('accessRestrict');
1026 }

◆ searchResultHandler()

ilObjUserFolderGUI::searchResultHandler ( array  $a_usr_ids,
string  $a_cmd 
)

Handles multi command from repository search gui.

Definition at line 2039 of file class.ilObjUserFolderGUI.php.

2042 : bool {
2043 if (!count($a_usr_ids)) {
2044 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'));
2045 return false;
2046 }
2047
2048 $this->requested_ids = $a_usr_ids;
2049
2050 // no real confirmation here
2051 if (stripos($a_cmd, 'export') !== false) {
2052 $cmd = $a_cmd . 'Object';
2053 return $this->$cmd();
2054 }
2055
2056 return $this->showActionConfirmation(
2057 $a_cmd,
2058 true
2059 );
2060 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ searchUserAccessFilterCallable()

ilObjUserFolderGUI::searchUserAccessFilterCallable ( array  $a_user_ids)

Definition at line 2022 of file class.ilObjUserFolderGUI.php.

2022 : array // Missing array type.
2023 {
2024 if ($this->checkPermissionBool('read', '', '', USER_FOLDER_ID)
2025 || $this->checkPermissionBool('read_user')) {
2026 return $a_user_ids;
2027 }
2028
2029 return $this->access->filterUserIdsByPositionOfCurrentUser(
2032 $a_user_ids
2033 );
2034 }
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)

References ILIAS\Repository\access(), ilObjUserFolder\ORG_OP_EDIT_USER_ACCOUNTS, and USER_FOLDER_ID.

+ Here is the call graph for this function:

◆ setAccessRestrictionObject()

ilObjUserFolderGUI::setAccessRestrictionObject ( ?ilPropertyFormGUI  $a_form = null,
bool  $a_from_search = false 
)

Definition at line 663 of file class.ilObjUserFolderGUI.php.

666 : bool {
667 if (!$a_form) {
668 $a_form = $this->initAccessRestrictionForm($a_from_search);
669 }
670 $this->tpl->setContent($a_form->getHTML());
671
672 // #10963
673 return true;
674 }

◆ setUserOwnerId()

ilObjUserFolderGUI::setUserOwnerId ( int  $a_id)

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

163 : void
164 {
165 $this->user_owner_id = $a_id;
166 }

◆ showActionConfirmation()

ilObjUserFolderGUI::showActionConfirmation ( string  $action,
bool  $a_from_search = false 
)

Definition at line 894 of file class.ilObjUserFolderGUI.php.

897 : bool {
898 $user_ids = $this->getActionUserIds();
899 if (!$user_ids) {
900 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('no_checkbox'));
901 $this->viewObject();
902 return false;
903 }
904
905 if (strcmp(
906 $action,
907 'accessRestrict'
908 ) == 0) {
909 return $this->setAccessRestrictionObject(
910 null,
911 $a_from_search
912 );
913 }
914 if (strcmp(
915 $action,
916 'mail'
917 ) == 0) {
918 $this->mailObject();
919 return false;
920 }
921 if (strcmp($action, 'addToClipboard') === 0) {
922 $this->addToClipboardObject();
923 return false;
924 }
925
926 unset($this->data);
927
928 if (!$a_from_search) {
929 $cancel = 'cancelUserFolderAction';
930 } else {
931 $cancel = 'cancelSearchAction';
932 }
933
934 // display confirmation message
935 $cgui = new ilConfirmationGUI();
936 $cgui->setFormAction($this->ctrl->getFormAction($this));
937 $cgui->setHeaderText($this->lng->txt('info_' . $action . '_sure'));
938 $cgui->setCancel(
939 $this->lng->txt('cancel'),
940 $cancel
941 );
942 $cgui->setConfirm(
943 $this->lng->txt('confirm'),
944 'confirm' . $action
945 );
946
947 if ($a_from_search) {
948 $cgui->addHiddenItem(
949 'frsrch',
950 '1'
951 );
952 }
953
954 foreach ($user_ids as $id) {
955 $user = new ilObjUser((int) $id);
956
957 $login = $user->getLastLogin();
958 if (!$login) {
959 $login = $this->lng->txt('never');
960 } else {
962 new ilDateTime(
963 $login,
965 )
966 );
967 }
968
969 $caption = $user->getFullname() . ' (' . $user->getLogin() . ')' . ', ' .
970 $user->getEmail() . ' - ' . $this->lng->txt('last_login') . ': ' . $login;
971
972 $cgui->addItem(
973 'id[]',
974 (string) $id,
975 $caption
976 );
977 }
978
979 $this->tpl->setContent($cgui->getHTML());
980
981 return true;
982 }
const IL_CAL_DATETIME
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
@classDescription Date and time handling
getFullname(int $max_strlen=0)

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ showPossibleSubObjects()

ilObjUserFolderGUI::showPossibleSubObjects ( )
protected

show possible subobjects (pulldown menu) overwritten to prevent displaying of role templates in local role folders

Reimplemented from ilObjectGUI.

Definition at line 474 of file class.ilObjUserFolderGUI.php.

474 : void
475 {
476 $subobj = null;
477
478 $d = $this->obj_definition->getCreatableSubObjects($this->object->getType());
479
480 if (!$this->rbac_system->checkAccess(
481 'create_usr',
482 $this->object->getRefId()
483 )) {
484 unset($d['usr']);
485 }
486
487 if (count($d) > 0) {
488 foreach ($d as $row) {
489 $count = 0;
490 if ($row['max'] > 0) {
491 //how many elements are present?
492 for ($i = 0, $iMax = count($this->data['ctrl']); $i < $iMax; $i++) {
493 if ($this->data['ctrl'][$i]['type'] == $row['name']) {
494 $count++;
495 }
496 }
497 }
498 if ($row['max'] == '' || $count < $row['max']) {
499 $subobj[] = $row['name'];
500 }
501 }
502 }
503
504 if (is_array($subobj)) {
505 //build form
507 12,
508 'new_type',
509 $subobj
510 );
511 $this->tpl->setCurrentBlock('add_object');
512 $this->tpl->setVariable(
513 'SELECT_OBJTYPE',
514 $opts
515 );
516 $this->tpl->setVariable(
517 'BTN_NAME',
518 'create'
519 );
520 $this->tpl->setVariable(
521 'TXT_ADD',
522 $this->lng->txt('add')
523 );
524 $this->tpl->parseCurrentBlock();
525 }
526 }
static formSelect( $selected, string $varname, array $options, bool $multiple=false, bool $direct_text=false, int $size=0, string $style_class="", array $attribs=[], bool $disabled=false)
Builds a select form field with options and shows the selected option first.

References Vendor\Package\$d, ilLegacyFormElementsUtil\formSelect(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ userActionObject()

ilObjUserFolderGUI::userActionObject ( )

Definition at line 1034 of file class.ilObjUserFolderGUI.php.

1034 : void
1035 {
1036 $this->raiseErrorOnMissingWrite();
1037 $this->showActionConfirmation($this->user_request->getSelectedAction());
1038 }

◆ usrExportCsvObject()

ilObjUserFolderGUI::usrExportCsvObject ( )
protected

Definition at line 2160 of file class.ilObjUserFolderGUI.php.

2160 : void
2161 {
2162 $user_ids = $this->getActionUserIds();
2163 if (!$user_ids) {
2164 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'), true);
2165 $this->ctrl->redirect(
2166 $this,
2167 'view'
2168 );
2169 }
2170
2171 if ($this->checkPermissionBool('write,read')) {
2172 $this->object->buildExportFile(
2174 $user_ids
2175 );
2176 $this->ctrl->redirectByClass(
2177 'ilobjuserfoldergui',
2178 'export'
2179 );
2180 } elseif ($this->checkUserManipulationAccessBool()) {
2181 $fullname = $this->object->buildExportFile(
2183 $user_ids,
2184 true
2185 );
2187 $fullname,
2188 $this->object->getExportFilename(ilObjUserFolder::FILE_TYPE_CSV),
2189 '',
2190 false,
2191 true
2192 );
2193 }
2194 }

References ILIAS\Repository\ctrl(), ilFileDelivery\deliverFileLegacy(), ilObjUserFolder\FILE_TYPE_CSV, ILIAS\Repository\lng(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ usrExportX86Object()

ilObjUserFolderGUI::usrExportX86Object ( )
protected

Definition at line 2124 of file class.ilObjUserFolderGUI.php.

2124 : void
2125 {
2126 $user_ids = $this->getActionUserIds();
2127 if (!$user_ids) {
2128 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'), true);
2129 $this->ctrl->redirect(
2130 $this,
2131 'view'
2132 );
2133 }
2134
2135 if ($this->checkPermissionBool('write,read')) {
2136 $this->object->buildExportFile(
2138 $user_ids
2139 );
2140 $this->ctrl->redirectByClass(
2141 'ilobjuserfoldergui',
2142 'export'
2143 );
2144 } elseif ($this->checkUserManipulationAccessBool()) {
2145 $fullname = $this->object->buildExportFile(
2147 $user_ids,
2148 true
2149 );
2151 $fullname . '.xlsx',
2152 $this->object->getExportFilename(ilObjUserFolder::FILE_TYPE_EXCEL) . '.xlsx',
2153 '',
2154 false,
2155 true
2156 );
2157 }
2158 }

References ILIAS\Repository\ctrl(), ilFileDelivery\deliverFileLegacy(), ilObjUserFolder\FILE_TYPE_EXCEL, ILIAS\Repository\lng(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ usrExportXmlObject()

ilObjUserFolderGUI::usrExportXmlObject ( )
protected

Definition at line 2196 of file class.ilObjUserFolderGUI.php.

2196 : void
2197 {
2198 $user_ids = $this->getActionUserIds();
2199 if (!$user_ids) {
2200 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'), true);
2201 $this->ctrl->redirect(
2202 $this,
2203 'view'
2204 );
2205 }
2206 if ($this->checkPermissionBool('write,read')) {
2207 $this->object->buildExportFile(
2209 $user_ids
2210 );
2211 $this->ctrl->redirectByClass(
2212 'ilobjuserfoldergui',
2213 'export'
2214 );
2215 } elseif ($this->checkUserManipulationAccessBool()) {
2216 $fullname = $this->object->buildExportFile(
2218 $user_ids,
2219 true
2220 );
2222 $fullname,
2223 $this->object->getExportFilename(ilObjUserFolder::FILE_TYPE_XML),
2224 '',
2225 false,
2226 true
2227 );
2228 }
2229 }

References ILIAS\Repository\ctrl(), ilFileDelivery\deliverFileLegacy(), ilObjUserFolder\FILE_TYPE_XML, ILIAS\Repository\lng(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ verifyXmlData()

ilObjUserFolderGUI::verifyXmlData ( ilUserImportParser  $import_parser)

Definition at line 1606 of file class.ilObjUserFolderGUI.php.

1606 : string
1607 {
1608 $import_dir = $this->getImportDir();
1609 switch ($import_parser->getErrorLevel()) {
1611 return '';
1613 return $import_parser->getProtocolAsHTML($this->lng->txt("verification_warning_log"));
1615 $this->filesystem->deleteDir($import_dir);
1616 $this->tpl->setOnScreenMessage(
1617 'failure',
1618 $this->lng->txt('verification_failed') . $import_parser->getProtocolAsHTML(
1619 $this->lng->txt('verification_failure_log')
1620 ),
1621 true
1622 );
1623 $this->ctrl->redirectByClass(self::class, 'importUserForm');
1624 }
1625 }
getProtocolAsHTML(string $a_log_title)
Returns the protocol as a HTML table.
getErrorLevel()
Returns the error level.

References ILIAS\Repository\ctrl(), ILIAS\Repository\filesystem(), ilUserImportParser\getErrorLevel(), ilUserImportParser\getProtocolAsHTML(), ilUserImportParser\IL_IMPORT_FAILURE, ilUserImportParser\IL_IMPORT_SUCCESS, ilUserImportParser\IL_IMPORT_WARNING, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ viewObject()

ilObjUserFolderGUI::viewObject ( )

list users

Reimplemented from ilObjectGUI.

Definition at line 384 of file class.ilObjUserFolderGUI.php.

385 : void {
386 if ($this->rbac_system->checkAccess('create_usr', $this->object->getRefId())
387 || $this->rbac_system->checkAccess('cat_administrate_users', $this->object->getRefId())) {
388 $this->toolbar->addComponent(
389 $this->ui_factory->link()->standard(
390 $this->lng->txt('usr_add'),
391 $this->ctrl->getLinkTarget($this, 'addUser')
392 )
393 );
394
395 $this->toolbar->addComponent(
396 $this->ui_factory->link()->standard(
397 $this->lng->txt('import_users'),
398 $this->ctrl->getLinkTarget($this, 'importUserForm')
399 )
400 );
401 }
402
403 $list_of_users = null;
404 if (!$this->access->checkAccess('read', '', USER_FOLDER_ID)
405 && $this->access->checkRbacOrPositionPermissionAccess(
406 'read',
409 )) {
410 $list_of_users = $this->access->filterUserIdsByRbacOrPositionOfCurrentUser(
411 'read',
415 );
416 }
417
418 $utab = new ilUserTableGUI(
419 $this,
420 'view',
422 false
423 );
424 $utab->addFilterItemValue(
425 'user_ids',
426 $list_of_users
427 );
428 $utab->getItems();
429
430 $this->tpl->setContent($utab->getHTML());
431 }

References ILIAS\Repository\toolbar().

Referenced by applyFilterObject(), and resetFilterObject().

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

Field Documentation

◆ $account_mail_repo

NewAccountMailRepository ilObjUserFolderGUI::$account_mail_repo
private

Definition at line 87 of file class.ilObjUserFolderGUI.php.

◆ $admin_tabs

AdminTabs ilObjUserFolderGUI::$admin_tabs
private

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

◆ $archives

LegacyArchives ilObjUserFolderGUI::$archives
private

Definition at line 85 of file class.ilObjUserFolderGUI.php.

◆ $db

ilDBInterface ilObjUserFolderGUI::$db
private

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

◆ $event

ilAppEventHandler ilObjUserFolderGUI::$event
private

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

◆ $filesystem

Filesystem ilObjUserFolderGUI::$filesystem
private

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

◆ $form

ilPropertyFormGUI ilObjUserFolderGUI::$form
private

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

◆ $irss

ResourceStorage ilObjUserFolderGUI::$irss
private

Definition at line 86 of file class.ilObjUserFolderGUI.php.

◆ $log

ilLogger ilObjUserFolderGUI::$log
private

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

◆ $mail_mustache_factory

ilMustacheFactory ilObjUserFolderGUI::$mail_mustache_factory
private

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

◆ $profile_configuration_repo

ProfileConfigurationRepository ilObjUserFolderGUI::$profile_configuration_repo
private

Definition at line 89 of file class.ilObjUserFolderGUI.php.

◆ $profile_field_change_listeners

array ilObjUserFolderGUI::$profile_field_change_listeners
private

Definition at line 90 of file class.ilObjUserFolderGUI.php.

◆ $requested_ids

array ilObjUserFolderGUI::$requested_ids
private

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

◆ $selected_action

string ilObjUserFolderGUI::$selected_action
private

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

◆ $upload

FileUpload ilObjUserFolderGUI::$upload
private

Definition at line 84 of file class.ilObjUserFolderGUI.php.

◆ $user_owner_id

int ilObjUserFolderGUI::$user_owner_id = 0
private

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

◆ $user_request

UserGUIRequest ilObjUserFolderGUI::$user_request
private

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

◆ $user_settings_repo

UserSettingsRepository ilObjUserFolderGUI::$user_settings_repo
private

Definition at line 88 of file class.ilObjUserFolderGUI.php.

◆ USER_FIELD_TRANSLATION_MAPPING

const ilObjUserFolderGUI::USER_FIELD_TRANSLATION_MAPPING
Initial value:
= [
'visible' => 'user_visible_in_profile',
'changeable' => 'changeable',
'searchable' => 'header_searchable',
'required' => 'required_field',
'export' => 'export',
'course_export' => 'course_export',
'group_export' => 'group_export',
'prg_export' => 'prg_export',
'visib_reg' => 'header_visible_registration',
'visib_lua' => 'usr_settings_visib_lua',
'changeable_lua' => 'usr_settings_changeable_lua'
]

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


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