ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
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 ()
 
 retrieveUserList ()
 
 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
 
UserSettingsConfigurationRepository $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 @ilCtrl_Calls ilObjUserFolderGUI: ILIAS\User\Search\EndpointGUI

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

Member Function Documentation

◆ _goto()

static ilObjUserFolderGUI::_goto ( string  $a_user)
static

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

1951 : void
1952 {
1953 global $DIC;
1954
1955 $a_user = (int) $a_user;
1956 $main_tpl = $DIC->ui()->mainTemplate();
1957
1958 $ilAccess = $DIC['ilAccess'];
1959 $ilErr = $DIC['ilErr'];
1960 $lng = $DIC['lng'];
1961 $ctrl = $DIC['ilCtrl'];
1962
1963 $a_target = USER_FOLDER_ID;
1964
1965 if ($ilAccess->checkAccess(
1966 'read',
1967 '',
1968 $a_target
1969 )) {
1970 $ctrl->redirectToURL('ilias.php?baseClass=ilAdministrationGUI&ref_id=' . $a_target . '&jmpToUser=' . $a_user);
1971 exit;
1972 } else {
1973 if ($ilAccess->checkAccess(
1974 'read',
1975 '',
1977 )) {
1978 $main_tpl->setOnScreenMessage('failure', sprintf(
1979 $lng->txt('msg_no_perm_read_item'),
1981 ), true);
1983 }
1984 }
1985 $ilErr->raiseError(
1986 $lng->txt('msg_no_perm_read'),
1987 $ilErr->FATAL
1988 );
1989 }
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 993 of file class.ilObjUserFolderGUI.php.

993 : void
994 {
996 $this->showActionConfirmation('activate');
997 }
showActionConfirmation(string $action, bool $a_from_search=false)

◆ addToClipboardObject()

ilObjUserFolderGUI::addToClipboardObject ( )
protected

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

2337 : void
2338 {
2339 $users = $this->getActionUserIds();
2340 if (!count($users)) {
2341 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'), true);
2342 $this->ctrl->redirect(
2343 $this,
2344 'view'
2345 );
2346 }
2347 $clip = ilUserClipboard::getInstance($GLOBALS['DIC']['ilUser']->getId());
2348 $clip->add($users);
2349 $clip->save();
2350
2351 $this->tpl->setOnScreenMessage('success', $this->lng->txt('clipboard_user_added'), true);
2352 $this->ctrl->redirect(
2353 $this,
2354 'view'
2355 );
2356 }
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 2275 of file class.ilObjUserFolderGUI.php.

2275 : array // Missing array type.
2276 {
2277 switch ($a_form_id) {
2280
2281 $fields = [];
2282
2283 $subitems = [
2284 'ps_password_change_on_first_login_enabled' => [
2285 $security->isPasswordChangeOnFirstLoginEnabled(),
2287 ],
2288 'ps_password_must_not_contain_loginame' => [
2289 $security->getPasswordMustNotContainLoginnameStatus(),
2291 ],
2292 'ps_password_chars_and_numbers_enabled' => [
2293 $security->isPasswordCharsAndNumbersEnabled(),
2295 ],
2296 'ps_password_special_chars_enabled' => [
2297 $security->isPasswordSpecialCharsEnabled(),
2299 ],
2300 'ps_password_min_length' => $security->getPasswordMinLength(),
2301 'ps_password_max_length' => $security->getPasswordMaxLength(),
2302 'ps_password_uppercase_chars_num' => $security->getPasswordNumberOfUppercaseChars(),
2303 'ps_password_lowercase_chars_num' => $security->getPasswordNumberOfLowercaseChars(),
2304 'ps_password_max_age' => $security->getPasswordMaxAge()
2305 ];
2306 $fields['ps_password_settings'] = [null, null, $subitems];
2307
2308 $subitems = [
2309 'ps_login_max_attempts' => $security->getLoginMaxAttempts(),
2310 'ps_prevent_simultaneous_logins' => [
2311 $security->isPreventionOfSimultaneousLoginsEnabled(),
2313 ]
2314 ];
2315 $fields['ps_security_protection'] = [null, null, $subitems];
2316
2317 return [['generalSettings', $fields]];
2318 }
2319 return [];
2320 }
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 421 of file class.ilObjUserFolderGUI.php.

421 : void
422 {
423 $auto = new ilUserAutoComplete();
424 $auto->addUserAccessFilterCallable(\Closure::fromCallable([$this, 'filterUserIdsByRbacOrPositionOfCurrentUser']));
425 $auto->setSearchFields(['login', 'firstname', 'lastname', 'email', 'second_email']);
426 $auto->enableFieldSearchableCheck(false);
427 $auto->setMoreLinkAvailable(true);
428
429 if ($this->user_request->getFetchAll()) {
430 $auto->setLimit(ilUserAutoComplete::MAX_ENTRIES);
431 }
432
433 echo $auto->getList($this->user_request->getTerm());
434 exit();
435 }
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 360 of file class.ilObjUserFolderGUI.php.

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

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ applyFilterObject()

ilObjUserFolderGUI::applyFilterObject ( )

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

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

References viewObject().

+ Here is the call graph for this function:

◆ cancelDeleteExportFileObject()

ilObjUserFolderGUI::cancelDeleteExportFileObject ( )

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

1865 : void
1866 {
1867 $this->ctrl->redirectByClass(
1868 [self::class, ilExportGUI::class],
1869 'export'
1870 );
1871 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ cancelSearchActionObject()

ilObjUserFolderGUI::cancelSearchActionObject ( )

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

524 : void
525 {
526 $this->ctrl->redirectByClass(
527 'ilrepositorysearchgui',
528 'showSearchResults'
529 );
530 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ cancelUserFolderActionObject()

ilObjUserFolderGUI::cancelUserFolderActionObject ( )

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

516 : void
517 {
518 $this->ctrl->redirect(
519 $this,
520 'view'
521 );
522 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ checkbox()

ilObjUserFolderGUI::checkbox ( string  $name)
private

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

2379 {
2380 $checkbox = new ilCheckboxInputGUI($this->lng->txt($name), $name);
2381 $checkbox->setInfo($this->lng->txt($name . '_desc'));
2382 $checkbox->setValue('1');
2383
2384 return $checkbox;
2385 }
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 873 of file class.ilObjUserFolderGUI.php.

873 : bool
874 {
875 return $this->access->checkRbacOrPositionPermissionAccess(
876 'write',
879 );
880 }

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 450 of file class.ilObjUserFolderGUI.php.

450 : void
451 {
452 $this->ctrl->redirect(
453 $this,
454 'view'
455 );
456 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ confirmaccessFreeObject()

ilObjUserFolderGUI::confirmaccessFreeObject ( )
protected

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

613 : void
614 {
615 if (!$this->checkUserManipulationAccessBool()) {
616 $this->ilias->raiseError(
617 $this->lng->txt('msg_no_perm_write'),
618 $this->ilias->error_obj->WARNING
619 );
620 }
621
622 foreach ($this->getActionUserIds() as $id) {
624 $id,
625 false
626 );
627 if ($obj instanceof \ilObjUser) {
628 $obj->setTimeLimitUnlimited(true);
629 $obj->setTimeLimitFrom(null);
630 $obj->setTimeLimitUntil(null);
631 $obj->update();
632 }
633 }
634
635 // Feedback
636 $this->tpl->setOnScreenMessage('success', $this->lng->txt('access_free_granted'), true);
637
638 if ($this->user_request->getFrSearch()) {
639 $this->ctrl->redirectByClass(
640 'ilRepositorySearchGUI',
641 'show'
642 );
643 } else {
644 $this->ctrl->redirect(
645 $this,
646 'view'
647 );
648 }
649 }
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 729 of file class.ilObjUserFolderGUI.php.

729 : bool
730 {
732 if (!$form->checkInput()) {
733 return $this->setAccessRestrictionObject($form);
734 }
735
736 $timefrom = $form->getItemByPostVar('from')->getDate()->get(IL_CAL_UNIX);
737 $timeuntil = $form->getItemByPostVar('to')->getDate()->get(IL_CAL_UNIX);
738 if ($timeuntil <= $timefrom) {
739 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('time_limit_not_valid'));
740 return $this->setAccessRestrictionObject($form);
741 }
742
743 if (!$this->checkUserManipulationAccessBool()) {
744 $this->ilias->raiseError(
745 $this->lng->txt('msg_no_perm_write'),
746 $this->ilias->error_obj->WARNING
747 );
748 }
749 foreach ($this->getActionUserIds() as $id) {
751 $id,
752 false
753 );
754 if ($obj instanceof \ilObjUser) {
755 $obj->setTimeLimitUnlimited(false);
756 $obj->setTimeLimitFrom((int) $timefrom);
757 $obj->setTimeLimitUntil((int) $timeuntil);
758 $obj->update();
759 }
760 }
761 $this->tpl->setOnScreenMessage('success', $this->lng->txt('access_restricted'), true);
762
763 if ($this->user_request->getFrSearch()) {
764 $this->ctrl->redirectByClass(
765 'ilRepositorySearchGUI',
766 'show'
767 );
768 } else {
769 $this->ctrl->redirect(
770 $this,
771 'view'
772 );
773 }
774 return false;
775 }
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 532 of file class.ilObjUserFolderGUI.php.

532 : void
533 {
534 if (!$this->checkUserManipulationAccessBool()) {
535 $this->ilias->raiseError(
536 $this->lng->txt('msg_no_perm_write'),
537 $this->ilias->error_obj->WARNING
538 );
539 }
540
541 // FOR ALL SELECTED OBJECTS
542 foreach ($this->getActionUserIds() as $id) {
544 $id,
545 false
546 );
547 if ($obj instanceof \ilObjUser) {
548 if (!$obj->getActive()) {
549 $obj->setLoginAttempts(0);
550 }
551 $obj->setActive(
552 true,
553 $this->user->getId()
554 );
555 $obj->update();
556 }
557 }
558
559 $this->tpl->setOnScreenMessage('success', $this->lng->txt('user_activated'), true);
560
561 if ($this->user_request->getFrSearch()) {
562 $this->ctrl->redirectByClass(
563 'ilRepositorySearchGUI',
564 'show'
565 );
566 } else {
567 $this->ctrl->redirect(
568 $this,
569 'view'
570 );
571 }
572 }

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 574 of file class.ilObjUserFolderGUI.php.

574 : void
575 {
576 if (!$this->checkUserManipulationAccessBool()) {
577 $this->ilias->raiseError(
578 $this->lng->txt('msg_no_perm_write'),
579 $this->ilias->error_obj->WARNING
580 );
581 }
582 // FOR ALL SELECTED OBJECTS
583 foreach ($this->getActionUserIds() as $id) {
585 $id,
586 false
587 );
588 if ($obj instanceof \ilObjUser) {
589 $obj->setActive(
590 false,
591 $this->user->getId()
592 );
593 $obj->update();
594 }
595 }
596
597 // Feedback
598 $this->tpl->setOnScreenMessage('success', $this->lng->txt('user_deactivated'), true);
599
600 if ($this->user_request->getFrSearch()) {
601 $this->ctrl->redirectByClass(
602 'ilRepositorySearchGUI',
603 'show'
604 );
605 } else {
606 $this->ctrl->redirect(
607 $this,
608 'view'
609 );
610 }
611 }

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 1829 of file class.ilObjUserFolderGUI.php.

1829 : void
1830 {
1831 $files = $this->user_request->getFiles();
1832 if (count($files) == 0) {
1833 $this->ilias->raiseError(
1834 $this->lng->txt('no_checkbox'),
1835 $this->ilias->error_obj->MESSAGE
1836 );
1837 }
1838
1839 $cgui = new ilConfirmationGUI();
1840 $cgui->setFormAction($this->ctrl->getFormAction($this));
1841 $cgui->setHeaderText($this->lng->txt('info_delete_sure'));
1842 $cgui->setCancel(
1843 $this->lng->txt('cancel'),
1844 'cancelDeleteExportFile'
1845 );
1846 $cgui->setConfirm(
1847 $this->lng->txt('confirm'),
1848 'deleteExportFile'
1849 );
1850
1851 // BEGIN TABLE DATA
1852 foreach ($files as $file) {
1853 $cgui->addItem(
1854 'file[]',
1855 $file,
1856 $file,
1857 ilObject::_getIcon($this->object->getId()),
1858 $this->lng->txt('obj_usrf')
1859 );
1860 }
1861
1862 $this->tpl->setContent($cgui->getHTML());
1863 }
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 777 of file class.ilObjUserFolderGUI.php.

777 : void
778 {
779 if (!$this->rbac_system->checkAccess(
780 'delete',
781 $this->object->getRefId()
782 )) {
783 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('msg_no_perm_delete'), true);
784 $this->ctrl->redirect(
785 $this,
786 'view'
787 );
788 }
789
790 $ids = $this->user_request->getIds();
791 if (in_array(
792 $this->user->getId(),
793 $ids
794 )) {
795 $this->ilias->raiseError(
796 $this->lng->txt('msg_no_delete_yourself'),
797 $this->ilias->error_obj->WARNING
798 );
799 }
800
801 // FOR ALL SELECTED OBJECTS
802 foreach ($ids as $id) {
803 // instatiate correct object class (usr)
805 $obj->delete();
806 }
807
808 // Feedback
809 $this->tpl->setOnScreenMessage('success', $this->lng->txt('user_deleted'), true);
810
811 if ($this->user_request->getFrSearch()) {
812 $this->ctrl->redirectByClass(
813 'ilRepositorySearchGUI',
814 'show'
815 );
816 } else {
817 $this->ctrl->redirect(
818 $this,
819 'view'
820 );
821 }
822 }

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 999 of file class.ilObjUserFolderGUI.php.

999 : void
1000 {
1001 $this->raiseErrorOnMissingWrite();
1002 if (in_array($this->user->getId(), $this->getActionUserIds())) {
1003 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('no_deactivate_yourself'));
1004 $this->viewObject();
1005 return;
1006 }
1007 $this->showActionConfirmation('deactivate');
1008 }

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

+ Here is the call graph for this function:

◆ deleteExportFileObject()

ilObjUserFolderGUI::deleteExportFileObject ( )

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

1873 : void
1874 {
1875 $this->raiseErrorOnMissingWrite();
1876 $files = $this->user_request->getFiles();
1877 $export_dir = $this->object->getExportDirectory();
1878 foreach ($files as $file) {
1879 $file = basename($file);
1880
1881 $exp_file = $export_dir . '/' . $file;
1882 if (is_file($exp_file)) {
1883 unlink($exp_file);
1884 }
1885 }
1886 $this->ctrl->redirectByClass(
1887 [self::class, ilExportGUI::class],
1888 'export'
1889 );
1890 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ deleteUsersObject()

ilObjUserFolderGUI::deleteUsersObject ( )

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

972 : void
973 {
974 if (!$this->access->checkRbacOrPositionPermissionAccess(
975 'delete',
978 )) {
979 $this->ilias->raiseError(
980 $this->lng->txt('permission_denied'),
981 $this->ilias->error_obj->MESSAGE
982 );
983 }
984
985 if (in_array($this->user->getId(), $this->getActionUserIds())) {
986 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('msg_no_delete_yourself'));
987 $this->viewObject();
988 return;
989 }
990 $this->showActionConfirmation('delete');
991 }

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 1803 of file class.ilObjUserFolderGUI.php.

1803 : void
1804 {
1805 $files = $this->user_request->getFiles();
1806 if (count($files) == 0) {
1807 $this->ilias->raiseError(
1808 $this->lng->txt('no_checkbox'),
1809 $this->ilias->error_obj->MESSAGE
1810 );
1811 }
1812
1813 if (count($files) > 1) {
1814 $this->ilias->raiseError(
1815 $this->lng->txt('select_max_one_item'),
1816 $this->ilias->error_obj->MESSAGE
1817 );
1818 }
1819
1820 $file = basename($files[0]);
1821
1822 $export_dir = $this->object->getExportDirectory();
1824 $export_dir . '/' . $file,
1825 $file
1826 );
1827 }
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 174 of file class.ilObjUserFolderGUI.php.

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

1907 : void
1908 {
1910
1911 $export_types = [
1912 'userfolder_export_excel_x86',
1913 'userfolder_export_xml'
1914 ];
1915 $options = [];
1916 foreach ($export_types as $type) {
1917 $this->ctrl->setParameterByClass(self::class, 'export_type', $type);
1918 $options[] = $this->ui_factory->button()->shy(
1919 $this->lng->txt($type),
1920 $this->ctrl->getLinkTargetByClass(self::class, 'performExport')
1921 );
1922 }
1923 $type_selection = $this->ui_factory->dropdown()->standard($options)
1924 ->withLabel($this->lng->txt('create_export_file'));
1925
1926 $this->toolbar->addComponent(
1927 $type_selection,
1928 true
1929 );
1930
1931 $table = new \ilUserExportFileTableGUI(
1932 $this,
1933 'export'
1934 );
1935 $table->init();
1936 $table->parse($this->object->getExportFiles());
1937
1938 $this->tpl->setContent($table->getHTML());
1939 }
const string PERM_READ_ALL_AND_WRITE

References ILIAS\UI\Implementation\Component\Input\Field\$options, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ilObjUserFolder\PERM_READ_ALL_AND_WRITE, 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 440 of file class.ilObjUserFolderGUI.php.

440 : array
441 {
442 return $this->access->filterUserIdsByRbacOrPositionOfCurrentUser(
446 $user_ids
447 );
448 }
const string PERM_READ_ALL

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

+ Here is the call graph for this function:

◆ freeAccessObject()

ilObjUserFolderGUI::freeAccessObject ( )

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

1016 : void
1017 {
1018 $this->raiseErrorOnMissingWrite();
1019 $this->showActionConfirmation('accessFree');
1020 }

◆ getActionUserIds()

ilObjUserFolderGUI::getActionUserIds ( )
protected

Get selected items for table action.

Returns
array<int>

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

828 : array
829 {
830 if ($this->getSelectAllPostArray()['select_cmd_all']) {
831 $utab = new ilUserTableGUI(
832 $this,
833 'view',
835 false
836 );
837
838 if (!$this->access->checkAccess(
840 '',
842 ) &&
843 $this->access->checkRbacOrPositionPermissionAccess(
847 )) {
849 $filtered_users = $this->access->filterUserIdsByRbacOrPositionOfCurrentUser(
853 $users
854 );
855
856 $utab->addFilterItemValue(
857 'user_ids',
858 $filtered_users
859 );
860 }
861
862 return $utab->getUserIdsForFilter();
863 } else {
864 return $this->access->filterUserIdsByRbacOrPositionOfCurrentUser(
868 $this->requested_ids
869 );
870 }
871 }
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, ilObjUserFolder\PERM_READ_ALL, 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 1941 of file class.ilObjUserFolderGUI.php.

1941 : void
1942 {
1943 $this->getTabs();
1944 }
getTabs()
@abstract overwrite in derived GUI class of your object type

◆ getImportDir()

ilObjUserFolderGUI::getImportDir ( )

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

1100 : string
1101 {
1102 // For each user session a different directory must be used to prevent
1103 // that one user session overwrites the import data that another session
1104 // is currently importing.
1105
1106 $importDir = 'user_import/usr_' . $this->user->getId() . '_' . mb_substr(session_id(), 0, 8);
1107
1108 return $importDir;
1109 }

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 1946 of file class.ilObjUserFolderGUI.php.

1946 : void
1947 {
1948 $this->admin_tabs->initializeTabs();
1949 }

◆ getUserMultiCommands()

ilObjUserFolderGUI::getUserMultiCommands ( bool  $a_search_form = false)

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

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

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 169 of file class.ilObjUserFolderGUI.php.

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

References USER_FOLDER_ID.

◆ handleUploadedFiles()

ilObjUserFolderGUI::handleUploadedFiles ( )
private

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

1504 : string
1505 {
1506 $subdir = '';
1507 $xml_file = '';
1508
1509 $import_dir = $this->getImportDir();
1510
1511 if (!$this->upload->hasBeenProcessed()) {
1512 $this->upload->process();
1513 }
1514
1515 // recreate user import directory
1516 if ($this->filesystem->hasDir($import_dir)) {
1517 $this->filesystem->deleteDir($import_dir);
1518 }
1519 $this->filesystem->createDir($import_dir);
1520
1521 foreach ($this->upload->getResults() as $single_file_upload) {
1522 $file_name = $single_file_upload->getName();
1523 $parts = pathinfo($file_name);
1524
1525 //check if upload status is ok
1526 if (!$single_file_upload->isOK()) {
1527 $this->filesystem->deleteDir($import_dir);
1528 $this->ilias->raiseError(
1529 $this->lng->txt('no_import_file_found'),
1530 $this->ilias->error_obj->MESSAGE
1531 );
1532 }
1533
1534 // move uploaded file to user import directory
1535 $this->upload->moveFilesTo(
1536 $import_dir,
1537 \ILIAS\FileUpload\Location::STORAGE
1538 );
1539
1540 // handle zip file
1541 if ($single_file_upload->getMimeType() == 'application/zip') {
1542 // Workaround: unzip function needs full path to file. Should be replaced once Filesystem has own unzip implementation
1543 $full_path = ilFileUtils::getDataDir() . '/user_import/usr_'
1544 . $this->user->getId() . '_' . session_id() . '/' . $file_name;
1545 $this->archives->unzip($full_path);
1546
1547 $xml_file = null;
1548 $file_list = $this->filesystem->listContents($import_dir);
1549
1550 foreach ($file_list as $key => $a_file) {
1551 if (substr(
1552 $a_file->getPath(),
1553 -4
1554 ) == '.xml') {
1555 unset($file_list[$key]);
1556 $xml_file = $a_file->getPath();
1557 break;
1558 }
1559 }
1560
1561 //Removing all files except the one to be imported, to make sure to get the right one in import-function
1562 foreach ($file_list as $a_file) {
1563 $this->filesystem->delete($a_file->getPath());
1564 }
1565
1566 if (is_null($xml_file)) {
1567 $subdir = basename(
1568 $parts['basename'],
1569 '.' . $parts['extension']
1570 );
1571 $xml_file = $import_dir . '/' . $subdir . '/' . $subdir . '.xml';
1572 }
1573 } // handle xml file
1574 else {
1575 $a = $this->filesystem->listContents($import_dir);
1576 $file = end($a);
1577 $xml_file = $file->getPath();
1578 }
1579
1580 // check xml file
1581 if (!$this->filesystem->has($xml_file)) {
1582 $this->filesystem->deleteDir($import_dir);
1583 $this->ilias->raiseError(
1584 $this->lng->txt('no_xml_file_found_in_zip')
1585 . ' ' . $subdir . '/' . $subdir . '.xml',
1586 $this->ilias->error_obj->MESSAGE
1587 );
1588 }
1589 }
1590
1591 return $xml_file;
1592 }
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 1080 of file class.ilObjUserFolderGUI.php.

1080 : void
1081 {
1082 $import_dir = $this->getImportDir();
1083 if ($this->filesystem->hasDir($import_dir)) {
1084 $this->filesystem->deleteDir($import_dir);
1085 }
1086
1087 if ($this->inAdministration()) {
1088 $this->ctrl->redirect(
1089 $this,
1090 'view'
1091 );
1092 } else {
1093 $this->ctrl->redirectByClass(
1094 'ilobjcategorygui',
1095 'listUsers'
1096 );
1097 }
1098 }

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

+ Here is the call graph for this function:

◆ importUserFormObject()

ilObjUserFolderGUI::importUserFormObject ( )

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

1028 : void
1029 {
1030 $this->tabs_gui->clearTargets();
1031 $this->tabs_gui->setBackTarget(
1032 $this->lng->txt('usrf'),
1033 $this->ctrl->getLinkTarget(
1034 $this,
1035 'view'
1036 )
1037 );
1038 if (
1039 !$this->rbac_system->checkAccess('create_usr', $this->object->getRefId())
1040 && !$this->access->checkAccess('cat_administrate_users', '', $this->object->getRefId())
1041 ) {
1042 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('permission_denied'));
1043 return;
1044 }
1045 $this->initUserImportForm();
1046 $this->tpl->setContent($this->form->getHTML());
1047 }
form(?array $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 1114 of file class.ilObjUserFolderGUI.php.

1114 : void
1115 {
1116 $this->tabs_gui->clearTargets();
1117 $this->tabs_gui->setBackTarget(
1118 $this->lng->txt('usrf'),
1119 $this->ctrl->getLinkTarget(
1120 $this,
1121 'view'
1122 )
1123 );
1124
1125 $this->initUserImportForm();
1126 if ($this->form->checkInput()) {
1127 $xml_file = $this->handleUploadedFiles();
1128 $xml_file_full_path = ilFileUtils::getDataDir() . '/' . $xml_file;
1129
1130 list($form, $message) = $this->initUserRoleAssignmentForm($xml_file_full_path);
1131
1132 $this->tpl->setContent($message . $this->ui_renderer->render($form));
1133 } else {
1134 $this->form->setValuesByPost();
1135 $this->tpl->setContent($this->form->getHTML());
1136 }
1137 }
initUserRoleAssignmentForm(string $xml_file_full_path)

References 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 1618 of file class.ilObjUserFolderGUI.php.

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

1075 : bool
1076 {
1077 return (strtolower($this->user_request->getBaseClass()) === 'iladministrationgui');
1078 }

◆ initAccessRestrictionForm()

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

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

667 $user_ids = $this->getActionUserIds();
668 if (!$user_ids) {
669 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'));
670 $this->viewObject();
671 return null;
672 }
673
674 $form = new ilPropertyFormGUI();
675 $form->setTitle($this->lng->txt('time_limit_add_time_limit_for_selected'));
677 $this->ctrl->getFormAction(
678 $this,
679 'confirmaccessRestrict'
680 )
681 );
682
683 $from = new ilDateTimeInputGUI(
684 $this->lng->txt('access_from'),
685 'from'
686 );
687 $from->setShowTime(true);
688 $from->setRequired(true);
689 $form->addItem($from);
690
691 $to = new ilDateTimeInputGUI(
692 $this->lng->txt('access_until'),
693 'to'
694 );
695 $to->setRequired(true);
696 $to->setShowTime(true);
697 $form->addItem($to);
698
700 'confirmaccessRestrict',
701 $this->lng->txt('confirm')
702 );
704 'view',
705 $this->lng->txt('cancel')
706 );
707
708 foreach ($user_ids as $user_id) {
709 $ufield = new ilHiddenInputGUI('id[]');
710 $ufield->setValue((string) $user_id);
711 $form->addItem($ufield);
712 }
713
714 // return to search?
715 if ($a_from_search || $this->user_request->getFrSearch()) {
716 $field = new ilHiddenInputGUI('frsrch');
717 $field->setValue('1');
718 $form->addItem($field);
719 }
720
721 return $form;
722 }
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 1049 of file class.ilObjUserFolderGUI.php.

1049 : void
1050 {
1051 $this->form = new ilPropertyFormGUI();
1052
1053 // Import File
1054 $fi = new ilFileInputGUI(
1055 $this->lng->txt('import_file'),
1056 'importFile'
1057 );
1058 $fi->setSuffixes(['xml']);
1059 $fi->setRequired(true);
1060 $this->form->addItem($fi);
1061
1062 $this->form->addCommandButton(
1063 'importUserRoleAssignment',
1064 $this->lng->txt('import')
1065 );
1066 $this->form->addCommandButton(
1067 'importCancelled',
1068 $this->lng->txt('cancel')
1069 );
1070
1071 $this->form->setTitle($this->lng->txt('import_users'));
1072 $this->form->setFormAction($this->ctrl->getFormAction($this));
1073 }
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 1143 of file class.ilObjUserFolderGUI.php.

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

1994 : void
1995 {
1996 $jump_to_user = $this->user_request->getJumpToUser();
1997 if (ilObject::_lookupType($jump_to_user) == 'usr') {
1998 $this->ctrl->setParameterByClass(
1999 'ilobjusergui',
2000 'obj_id',
2001 $jump_to_user
2002 );
2003 $this->ctrl->redirectByClass(
2004 'ilobjusergui',
2005 'view'
2006 );
2007 }
2008 }
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 2219 of file class.ilObjUserFolderGUI.php.

2219 : void
2220 {
2221 $user_ids = $this->getActionUserIds();
2222 if (!$user_ids) {
2223 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'), true);
2224 $this->ctrl->redirect(
2225 $this,
2226 'view'
2227 );
2228 return;
2229 }
2230
2231 // remove existing (temporary) lists
2232 $old_lists = new ilMailingLists($this->user);
2233 $old_lists->deleteTemporaryLists();
2234
2235 // create (temporary) mailing list
2236 $list = new ilMailingList($this->user);
2237 $list->setMode(ilMailingList::MODE_TEMPORARY);
2238 $list->setTitle('-TEMPORARY SYSTEM LIST-');
2239 $list->setDescription('-USER ACCOUNTS MAIL-');
2240 $list->setCreatedate(date('Y-m-d H:i:s'));
2241 $list->insert();
2242 $list_id = $list->getId();
2243
2244 // after list has been saved...
2245 foreach ($user_ids as $user_id) {
2246 $list->assignUser((int) $user_id);
2247 }
2248
2249 $umail = new ilFormatMail($this->user->getId());
2250 $mail_data = $umail->retrieveFromStage();
2251
2252 $umail->persistToStage(
2253 $mail_data['user_id'],
2254 '#il_ml_' . $list_id,
2255 $mail_data['rcp_cc'],
2256 $mail_data['rcp_bcc'],
2257 $mail_data['m_subject'],
2258 $mail_data['m_message'],
2259 $mail_data['attachments'],
2260 $mail_data['use_placeholders'],
2261 $mail_data['tpl_ctx_id'],
2262 $mail_data['tpl_ctx_params']
2263 );
2264
2265 $this->ctrl->redirectToURL(
2267 $this,
2268 '',
2269 [],
2270 ['type' => 'search_res']
2271 )
2272 );
2273 }
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 1896 of file class.ilObjUserFolderGUI.php.

1896 : void
1897 {
1899
1900 $this->object->buildExportFile($this->user_request->getExportType());
1901 $this->ctrl->redirectByClass(
1902 [self::class, ilExportGUI::class],
1903 'export'
1904 );
1905 }

References ILIAS\Repository\ctrl(), and ilObjUserFolder\PERM_READ_ALL_AND_WRITE.

+ Here is the call graph for this function:

◆ raiseErrorOnMissingWrite()

ilObjUserFolderGUI::raiseErrorOnMissingWrite ( )
private

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

2387 : void
2388 {
2389 if (!$this->access->checkRbacOrPositionPermissionAccess(
2390 'write',
2393 )) {
2394 $this->ilias->raiseError(
2395 $this->lng->txt('permission_denied'),
2396 $this->ilias->error_obj->MESSAGE
2397 );
2398 }
2399 }

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 2322 of file class.ilObjUserFolderGUI.php.

2322 : void
2323 {
2324 if ($this->inAdministration()) {
2325 $this->ctrl->redirect(
2326 $this,
2327 'view'
2328 );
2329 }
2330
2331 $this->ctrl->redirectByClass(
2332 'ilobjcategorygui',
2333 'listUsers'
2334 );
2335 }

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 1747 of file class.ilObjUserFolderGUI.php.

1752 : void {
1753 if (in_array(
1754 $role_id,
1755 $global_roles
1756 )) {
1757 if (in_array(
1759 $roles_of_user
1760 )) {
1761 return;
1762 }
1763
1764 if ($role_id === SYSTEM_ROLE_ID
1765 || $this->object->getRefId() !== USER_FOLDER_ID
1767 ) {
1768 $this->filesystem->deleteDir($import_dir);
1769 $this->tpl->setOnScreenMessage(
1770 'failure',
1771 $this->lng->txt('usrimport_with_specified_role_not_permitted'),
1772 true
1773 );
1774 $this->redirectAfterImport();
1775 }
1776 return;
1777 }
1778
1779 $rolf = $this->rbac_review->getFoldersAssignedToRole(
1780 $role_id,
1781 true
1782 );
1783 if ($this->rbac_review->isDeleted($rolf[0])
1784 || !$this->rbac_system->checkAccess(
1785 'write',
1786 $rolf[0]
1787 )
1788 ) {
1789 $this->filesystem->deleteDir($import_dir);
1790 $this->tpl->setOnScreenMessage(
1791 'failure',
1792 $this->lng->txt('usrimport_with_specified_role_not_permitted'),
1793 true
1794 );
1795 $this->redirectAfterImport();
1796 }
1797 }

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 346 of file class.ilObjUserFolderGUI.php.

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

References viewObject().

+ Here is the call graph for this function:

◆ restrictAccessObject()

ilObjUserFolderGUI::restrictAccessObject ( )

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

1010 : void
1011 {
1012 $this->raiseErrorOnMissingWrite();
1013 $this->showActionConfirmation('accessRestrict');
1014 }

◆ retrieveUserList()

ilObjUserFolderGUI::retrieveUserList ( )
private

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

2358 : ?array
2359 {
2360 if ($this->access->checkAccess(\ilObjUserFolder::PERM_READ_ALL, '', USER_FOLDER_ID)) {
2361 return null;
2362 }
2363
2364 if ($this->access->checkPositionAccess(
2367 )) {
2368 return $this->access->filterUserIdsByPositionOfCurrentUser(
2372 );
2373 }
2374
2375 return [];
2376 }

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

+ Here is the call graph for this function:

◆ searchResultHandler()

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

Handles multi command from repository search gui.

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

2030 : bool {
2031 if (!count($a_usr_ids)) {
2032 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'));
2033 return false;
2034 }
2035
2036 $this->requested_ids = $a_usr_ids;
2037
2038 // no real confirmation here
2039 if (stripos($a_cmd, 'export') !== false) {
2040 $cmd = $a_cmd . 'Object';
2041 return $this->$cmd();
2042 }
2043
2044 return $this->showActionConfirmation(
2045 $a_cmd,
2046 true
2047 );
2048 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ searchUserAccessFilterCallable()

ilObjUserFolderGUI::searchUserAccessFilterCallable ( array  $a_user_ids)

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

2010 : array // Missing array type.
2011 {
2013 || $this->checkPermissionBool('read_users')) {
2014 return $a_user_ids;
2015 }
2016
2017 return $this->access->filterUserIdsByPositionOfCurrentUser(
2020 $a_user_ids
2021 );
2022 }
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)

References ILIAS\Repository\access(), ilObjUserFolder\ORG_OP_EDIT_USER_ACCOUNTS, ilObjUserFolder\PERM_READ_ALL, 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 651 of file class.ilObjUserFolderGUI.php.

654 : bool {
655 if (!$a_form) {
656 $a_form = $this->initAccessRestrictionForm($a_from_search);
657 }
658 $this->tpl->setContent($a_form->getHTML());
659
660 // #10963
661 return true;
662 }

◆ setUserOwnerId()

ilObjUserFolderGUI::setUserOwnerId ( int  $a_id)

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

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

◆ showActionConfirmation()

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

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

885 : bool {
886 $user_ids = $this->getActionUserIds();
887 if (!$user_ids) {
888 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('no_checkbox'));
889 $this->viewObject();
890 return false;
891 }
892
893 if (strcmp(
894 $action,
895 'accessRestrict'
896 ) == 0) {
897 return $this->setAccessRestrictionObject(
898 null,
899 $a_from_search
900 );
901 }
902 if (strcmp(
903 $action,
904 'mail'
905 ) == 0) {
906 $this->mailObject();
907 return false;
908 }
909 if (strcmp($action, 'addToClipboard') === 0) {
910 $this->addToClipboardObject();
911 return false;
912 }
913
914 unset($this->data);
915
916 if (!$a_from_search) {
917 $cancel = 'cancelUserFolderAction';
918 } else {
919 $cancel = 'cancelSearchAction';
920 }
921
922 // display confirmation message
923 $cgui = new ilConfirmationGUI();
924 $cgui->setFormAction($this->ctrl->getFormAction($this));
925 $cgui->setHeaderText($this->lng->txt('info_' . $action . '_sure'));
926 $cgui->setCancel(
927 $this->lng->txt('cancel'),
928 $cancel
929 );
930 $cgui->setConfirm(
931 $this->lng->txt('confirm'),
932 'confirm' . $action
933 );
934
935 if ($a_from_search) {
936 $cgui->addHiddenItem(
937 'frsrch',
938 '1'
939 );
940 }
941
942 foreach ($user_ids as $id) {
943 $user = new ilObjUser((int) $id);
944
945 $login = $user->getLastLogin();
946 if (!$login) {
947 $login = $this->lng->txt('never');
948 } else {
950 new ilDateTime(
951 $login,
953 )
954 );
955 }
956
957 $caption = $user->getFullname() . ' (' . $user->getLogin() . ')' . ', ' .
958 $user->getEmail() . ' - ' . $this->lng->txt('last_login') . ': ' . $login;
959
960 $cgui->addItem(
961 'id[]',
962 (string) $id,
963 $caption
964 );
965 }
966
967 $this->tpl->setContent($cgui->getHTML());
968
969 return true;
970 }
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 462 of file class.ilObjUserFolderGUI.php.

462 : void
463 {
464 $subobj = null;
465
466 $d = $this->obj_definition->getCreatableSubObjects($this->object->getType());
467
468 if (!$this->rbac_system->checkAccess(
469 'create_usr',
470 $this->object->getRefId()
471 )) {
472 unset($d['usr']);
473 }
474
475 if (count($d) > 0) {
476 foreach ($d as $row) {
477 $count = 0;
478 if ($row['max'] > 0) {
479 //how many elements are present?
480 for ($i = 0, $iMax = count($this->data['ctrl']); $i < $iMax; $i++) {
481 if ($this->data['ctrl'][$i]['type'] == $row['name']) {
482 $count++;
483 }
484 }
485 }
486 if ($row['max'] == '' || $count < $row['max']) {
487 $subobj[] = $row['name'];
488 }
489 }
490 }
491
492 if (is_array($subobj)) {
493 //build form
495 12,
496 'new_type',
497 $subobj
498 );
499 $this->tpl->setCurrentBlock('add_object');
500 $this->tpl->setVariable(
501 'SELECT_OBJTYPE',
502 $opts
503 );
504 $this->tpl->setVariable(
505 'BTN_NAME',
506 'create'
507 );
508 $this->tpl->setVariable(
509 'TXT_ADD',
510 $this->lng->txt('add')
511 );
512 $this->tpl->parseCurrentBlock();
513 }
514 }
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 1022 of file class.ilObjUserFolderGUI.php.

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

◆ usrExportCsvObject()

ilObjUserFolderGUI::usrExportCsvObject ( )
protected

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

2148 : void
2149 {
2150 $user_ids = $this->getActionUserIds();
2151 if (!$user_ids) {
2152 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'), true);
2153 $this->ctrl->redirect(
2154 $this,
2155 'view'
2156 );
2157 }
2158
2160 $this->object->buildExportFile(
2162 $user_ids
2163 );
2164 $this->ctrl->redirectByClass(
2165 'ilobjuserfoldergui',
2166 'export'
2167 );
2168 } elseif ($this->checkUserManipulationAccessBool()) {
2169 $fullname = $this->object->buildExportFile(
2171 $user_ids,
2172 true
2173 );
2175 $fullname,
2176 $this->object->getExportFilename(ilObjUserFolder::FILE_TYPE_CSV),
2177 '',
2178 false,
2179 true
2180 );
2181 }
2182 }

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

+ Here is the call graph for this function:

◆ usrExportX86Object()

ilObjUserFolderGUI::usrExportX86Object ( )
protected

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

2112 : void
2113 {
2114 $user_ids = $this->getActionUserIds();
2115 if (!$user_ids) {
2116 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'), true);
2117 $this->ctrl->redirectByClass(
2118 self::class,
2119 'view'
2120 );
2121 }
2122
2124 $this->object->buildExportFile(
2126 $user_ids
2127 );
2128 $this->ctrl->redirectByClass(
2129 [self::class, ilExportGUI::class],
2130 'export'
2131 );
2132 } elseif ($this->checkUserManipulationAccessBool()) {
2133 $fullname = $this->object->buildExportFile(
2135 $user_ids,
2136 true
2137 );
2139 $fullname . '.xlsx',
2140 $this->object->getExportFilename(ilObjUserFolder::FILE_TYPE_EXCEL) . '.xlsx',
2141 '',
2142 false,
2143 true
2144 );
2145 }
2146 }

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

+ Here is the call graph for this function:

◆ usrExportXmlObject()

ilObjUserFolderGUI::usrExportXmlObject ( )
protected

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

2184 : void
2185 {
2186 $user_ids = $this->getActionUserIds();
2187 if (!$user_ids) {
2188 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'), true);
2189 $this->ctrl->redirectByClass(
2190 self::class,
2191 'view'
2192 );
2193 }
2195 $this->object->buildExportFile(
2197 $user_ids
2198 );
2199 $this->ctrl->redirectByClass(
2200 [self::class, ilExportGUI::class],
2201 'export'
2202 );
2203 } elseif ($this->checkUserManipulationAccessBool()) {
2204 $fullname = $this->object->buildExportFile(
2206 $user_ids,
2207 true
2208 );
2210 $fullname,
2211 $this->object->getExportFilename(ilObjUserFolder::FILE_TYPE_XML),
2212 '',
2213 false,
2214 true
2215 );
2216 }
2217 }

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

+ Here is the call graph for this function:

◆ verifyXmlData()

ilObjUserFolderGUI::verifyXmlData ( ilUserImportParser  $import_parser)

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

1594 : string
1595 {
1596 $import_dir = $this->getImportDir();
1597 switch ($import_parser->getErrorLevel()) {
1599 return '';
1601 return $import_parser->getProtocolAsHTML($this->lng->txt("verification_warning_log"));
1603 $this->filesystem->deleteDir($import_dir);
1604 $this->tpl->setOnScreenMessage(
1605 'failure',
1606 $this->lng->txt('verification_failed') . $import_parser->getProtocolAsHTML(
1607 $this->lng->txt('verification_failure_log')
1608 ),
1609 true
1610 );
1611 $this->ctrl->redirectByClass(self::class, 'importUserForm');
1612 }
1613 }
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 387 of file class.ilObjUserFolderGUI.php.

388 : void {
389 if ($this->rbac_system->checkAccess('create_usr', $this->object->getRefId())
390 || $this->rbac_system->checkAccess('cat_administrate_users', $this->object->getRefId())) {
391 $this->toolbar->addComponent(
392 $this->ui_factory->link()->standard(
393 $this->lng->txt('usr_add'),
394 $this->ctrl->getLinkTarget($this, 'addUser')
395 )
396 );
397
398 $this->toolbar->addComponent(
399 $this->ui_factory->link()->standard(
400 $this->lng->txt('import_users'),
401 $this->ctrl->getLinkTarget($this, 'importUserForm')
402 )
403 );
404 }
405
406 $utab = new ilUserTableGUI(
407 $this,
408 'view',
410 false
411 );
412 $utab->addFilterItemValue(
413 'user_ids',
414 $this->retrieveUserList()
415 );
416 $utab->getItems();
417
418 $this->tpl->setContent($utab->getHTML());
419 }

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 88 of file class.ilObjUserFolderGUI.php.

◆ $admin_tabs

AdminTabs ilObjUserFolderGUI::$admin_tabs
private

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

◆ $archives

LegacyArchives ilObjUserFolderGUI::$archives
private

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

◆ $db

ilDBInterface ilObjUserFolderGUI::$db
private

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

◆ $event

ilAppEventHandler ilObjUserFolderGUI::$event
private

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

◆ $filesystem

Filesystem ilObjUserFolderGUI::$filesystem
private

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

◆ $form

ilPropertyFormGUI ilObjUserFolderGUI::$form
private

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

◆ $irss

ResourceStorage ilObjUserFolderGUI::$irss
private

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

◆ $log

ilLogger ilObjUserFolderGUI::$log
private

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

◆ $mail_mustache_factory

ilMustacheFactory ilObjUserFolderGUI::$mail_mustache_factory
private

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

◆ $profile_configuration_repo

ProfileConfigurationRepository ilObjUserFolderGUI::$profile_configuration_repo
private

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

◆ $profile_field_change_listeners

array ilObjUserFolderGUI::$profile_field_change_listeners
private

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

◆ $requested_ids

array ilObjUserFolderGUI::$requested_ids
private

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

◆ $selected_action

string ilObjUserFolderGUI::$selected_action
private

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

◆ $upload

FileUpload ilObjUserFolderGUI::$upload
private

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

◆ $user_owner_id

int ilObjUserFolderGUI::$user_owner_id = 0
private

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

◆ $user_request

UserGUIRequest ilObjUserFolderGUI::$user_request
private

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

◆ $user_settings_repo

UserSettingsConfigurationRepository ilObjUserFolderGUI::$user_settings_repo
private

Definition at line 89 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 60 of file class.ilObjUserFolderGUI.php.


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