ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
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
 
TemplateEngineFactoryInterface $mail_template_engine_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 57 of file class.ilObjUserFolderGUI.php.

Member Function Documentation

◆ _goto()

static ilObjUserFolderGUI::_goto ( string  $a_user)
static

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

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

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

◆ addToClipboardObject()

ilObjUserFolderGUI::addToClipboardObject ( )
protected

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

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

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

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

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

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ applyFilterObject()

ilObjUserFolderGUI::applyFilterObject ( )

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

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

References viewObject().

+ Here is the call graph for this function:

◆ cancelDeleteExportFileObject()

ilObjUserFolderGUI::cancelDeleteExportFileObject ( )

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

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

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ cancelSearchActionObject()

ilObjUserFolderGUI::cancelSearchActionObject ( )

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

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

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ cancelUserFolderActionObject()

ilObjUserFolderGUI::cancelUserFolderActionObject ( )

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

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

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ checkbox()

ilObjUserFolderGUI::checkbox ( string  $name)
private

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

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

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

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

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

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ confirmaccessFreeObject()

ilObjUserFolderGUI::confirmaccessFreeObject ( )
protected

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

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

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

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

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

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

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

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

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

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

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

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

+ Here is the call graph for this function:

◆ deleteExportFileObject()

ilObjUserFolderGUI::deleteExportFileObject ( )

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

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

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ deleteUsersObject()

ilObjUserFolderGUI::deleteUsersObject ( )

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

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

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

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

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

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

441 : array
442 {
443 return $this->access->filterUserIdsByRbacOrPositionOfCurrentUser(
447 $user_ids
448 );
449 }
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 1017 of file class.ilObjUserFolderGUI.php.

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

◆ getActionUserIds()

ilObjUserFolderGUI::getActionUserIds ( )
protected

Get selected items for table action.

Returns
array<int>

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

829 : array
830 {
831 if ($this->getSelectAllPostArray()['select_cmd_all']) {
832 $utab = new ilUserTableGUI(
833 $this,
834 'view',
836 false
837 );
838
839 if (!$this->access->checkAccess(
841 '',
843 ) &&
844 $this->access->checkRbacOrPositionPermissionAccess(
848 )) {
850 $filtered_users = $this->access->filterUserIdsByRbacOrPositionOfCurrentUser(
854 $users
855 );
856
857 $utab->addFilterItemValue(
858 'user_ids',
859 $filtered_users
860 );
861 }
862
863 return $utab->getUserIdsForFilter();
864 } else {
865 return $this->access->filterUserIdsByRbacOrPositionOfCurrentUser(
869 $this->requested_ids
870 );
871 }
872 }
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 1942 of file class.ilObjUserFolderGUI.php.

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

◆ getImportDir()

ilObjUserFolderGUI::getImportDir ( )

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

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

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

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

◆ getUserMultiCommands()

ilObjUserFolderGUI::getUserMultiCommands ( bool  $a_search_form = false)

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

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

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

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

References USER_FOLDER_ID.

◆ handleUploadedFiles()

ilObjUserFolderGUI::handleUploadedFiles ( )
private

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

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

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

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

+ Here is the call graph for this function:

◆ importUserFormObject()

ilObjUserFolderGUI::importUserFormObject ( )

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

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

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

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

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

◆ initAccessRestrictionForm()

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

References viewObject().

+ Here is the call graph for this function:

◆ restrictAccessObject()

ilObjUserFolderGUI::restrictAccessObject ( )

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

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

◆ retrieveUserList()

ilObjUserFolderGUI::retrieveUserList ( )
private

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

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

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

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

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ searchUserAccessFilterCallable()

ilObjUserFolderGUI::searchUserAccessFilterCallable ( array  $a_user_ids)

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

2011 : array // Missing array type.
2012 {
2014 || $this->checkPermissionBool('read_users')) {
2015 return $a_user_ids;
2016 }
2017
2018 return $this->access->filterUserIdsByPositionOfCurrentUser(
2021 $a_user_ids
2022 );
2023 }
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 652 of file class.ilObjUserFolderGUI.php.

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

◆ setUserOwnerId()

ilObjUserFolderGUI::setUserOwnerId ( int  $a_id)

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

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

◆ showActionConfirmation()

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

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

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

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

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

◆ usrExportCsvObject()

ilObjUserFolderGUI::usrExportCsvObject ( )
protected

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

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

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

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

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

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

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

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

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

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

◆ $admin_tabs

AdminTabs ilObjUserFolderGUI::$admin_tabs
private

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

◆ $archives

LegacyArchives ilObjUserFolderGUI::$archives
private

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

◆ $db

ilDBInterface ilObjUserFolderGUI::$db
private

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

◆ $event

ilAppEventHandler ilObjUserFolderGUI::$event
private

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

◆ $filesystem

Filesystem ilObjUserFolderGUI::$filesystem
private

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

◆ $form

ilPropertyFormGUI ilObjUserFolderGUI::$form
private

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

◆ $irss

ResourceStorage ilObjUserFolderGUI::$irss
private

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

◆ $log

ilLogger ilObjUserFolderGUI::$log
private

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

◆ $mail_template_engine_factory

TemplateEngineFactoryInterface ilObjUserFolderGUI::$mail_template_engine_factory
private

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

◆ $profile_configuration_repo

ProfileConfigurationRepository ilObjUserFolderGUI::$profile_configuration_repo
private

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

◆ $profile_field_change_listeners

array ilObjUserFolderGUI::$profile_field_change_listeners
private

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

◆ $requested_ids

array ilObjUserFolderGUI::$requested_ids
private

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

◆ $selected_action

string ilObjUserFolderGUI::$selected_action
private

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

◆ $upload

FileUpload ilObjUserFolderGUI::$upload
private

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

◆ $user_owner_id

int ilObjUserFolderGUI::$user_owner_id = 0
private

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

◆ $user_request

UserGUIRequest ilObjUserFolderGUI::$user_request
private

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

◆ $user_settings_repo

UserSettingsConfigurationRepository ilObjUserFolderGUI::$user_settings_repo
private

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


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