|
| __construct () |
|
| getId () |
|
| getTitle () |
|
| getDescription () |
|
| getDefaultScheduleType () |
|
| getDefaultScheduleValue () |
|
| hasAutoActivation () |
|
| hasFlexibleSchedule () |
|
| hasCustomSettings () |
|
| run () |
|
| addCustomSettingsToForm (ilPropertyFormGUI $a_form) |
|
| saveCustomSettings (ilPropertyFormGUI $a_form) |
|
| setDateTimeProvider (?Closure $date_time_provider) |
|
| isDue (?DateTimeImmutable $last_run, ?int $schedule_type, ?int $schedule_value, bool $is_manually_executed=false) |
|
| getScheduleType () |
| Get current schedule type (if flexible) More...
|
|
| getScheduleValue () |
| Get current schedule value (if flexible) More...
|
|
| setSchedule (?int $a_type, ?int $a_value) |
| Update current schedule (if flexible) More...
|
|
| getAllScheduleTypes () |
| Get all available schedule types. More...
|
|
| getScheduleTypesWithValues () |
|
| getValidScheduleTypes () |
| Returns a collection of all valid schedule types for a specific job. More...
|
|
| isManuallyExecutable () |
|
| hasCustomSettings () |
|
| addCustomSettingsToForm (ilPropertyFormGUI $a_form) |
|
| saveCustomSettings (ilPropertyFormGUI $a_form) |
|
| addToExternalSettingsForm (int $a_form_id, array &$a_fields, bool $a_is_active) |
|
| activationWasToggled (ilDBInterface $db, ilSetting $setting, bool $a_currently_active) |
| Important: This method is (also) called from the setup process, where the constructor of an ilCronJob ist NOT executed. More...
|
|
| getId () |
|
| getTitle () |
|
| getDescription () |
|
| hasAutoActivation () |
| Is to be activated on "installation", does only work for ILIAS core cron jobs. More...
|
|
| hasFlexibleSchedule () |
|
| getDefaultScheduleType () |
|
| getDefaultScheduleValue () |
|
| run () |
|
◆ __construct()
ilCronDeleteNeverLoggedInUserAccounts::__construct |
( |
| ) |
|
◆ addCustomSettingsToForm()
ilCronDeleteNeverLoggedInUserAccounts::addCustomSettingsToForm |
( |
ilPropertyFormGUI |
$a_form | ) |
|
Definition at line 186 of file class.ilCronDeleteNeverLoggedInUserAccounts.php.
References ilPropertyFormGUI\addItem(), ilNumberInputGUI\allowDecimals(), ANONYMOUS_ROLE_ID, ILIAS\Repository\lng(), and ilFormPropertyGUI\setInfo().
189 $this->
lng->txt(
'cron_users_without_login_del_role_whitelist'),
192 $roleWhiteList->
setInfo($this->
lng->txt(
'cron_users_without_login_del_role_whitelist_info'));
194 foreach ($this->rbacreview->getGlobalRoles() as $role_id) {
196 $roles[$role_id] = $this->objectDataCache->lookupTitle($role_id);
199 $roleWhiteList->setOptions($roles);
200 $roleWhiteList->setValue(array_filter(array_map(
'intval', explode(
',', $this->roleIdWhiteliste))));
201 $roleWhiteList->setWidth(300);
202 $a_form->
addItem($roleWhiteList);
205 $this->
lng->txt(
'cron_users_without_login_del_create_date_thr'),
209 $threshold->setInfo($this->
lng->txt(
'cron_users_without_login_del_create_date_thr_info'));
210 $threshold->setValue((
string) $this->thresholdInDays);
211 $threshold->setSuffix($this->
lng->txt(
'days'));
212 $threshold->setSize(4);
213 $threshold->setMaxLength(4);
214 $threshold->setRequired(
true);
◆ getDefaultScheduleType()
ilCronDeleteNeverLoggedInUserAccounts::getDefaultScheduleType |
( |
| ) |
|
◆ getDefaultScheduleValue()
ilCronDeleteNeverLoggedInUserAccounts::getDefaultScheduleValue |
( |
| ) |
|
◆ getDescription()
ilCronDeleteNeverLoggedInUserAccounts::getDescription |
( |
| ) |
|
◆ getId()
ilCronDeleteNeverLoggedInUserAccounts::getId |
( |
| ) |
|
◆ getTitle()
ilCronDeleteNeverLoggedInUserAccounts::getTitle |
( |
| ) |
|
◆ hasAutoActivation()
ilCronDeleteNeverLoggedInUserAccounts::hasAutoActivation |
( |
| ) |
|
◆ hasCustomSettings()
ilCronDeleteNeverLoggedInUserAccounts::hasCustomSettings |
( |
| ) |
|
◆ hasFlexibleSchedule()
ilCronDeleteNeverLoggedInUserAccounts::hasFlexibleSchedule |
( |
| ) |
|
◆ run()
ilCronDeleteNeverLoggedInUserAccounts::run |
( |
| ) |
|
Definition at line 124 of file class.ilCronDeleteNeverLoggedInUserAccounts.php.
References $DIC, $message, ANONYMOUS_USER_ID, ilObjectFactory\getInstanceByObjId(), ilObjUser\getUserIdsNeverLoggedIn(), ilCronJobResult\STATUS_NO_ACTION, ilCronJobResult\STATUS_OK, and SYSTEM_USER_ID.
134 $this->thresholdInDays ?: self::DEFAULT_CREATION_THRESHOLD
137 $roleIdWhitelist = array_filter(array_map(
'intval', explode(
',', $this->roleIdWhiteliste)));
140 foreach ($userIds as $userId) {
152 if (count($roleIdWhitelist) > 0) {
153 $assignedRoleIds = array_filter(array_map(
'intval', $this->rbacreview->assignedRoles($userId)));
155 $respectedRolesToInclude = array_intersect($assignedRoleIds, $roleIdWhitelist);
156 if (count($respectedRolesToInclude) > 0) {
165 $DIC->logger()->user()->info(sprintf(
166 "Deleting user account with id %s (login: %s)",
177 $message = sprintf(
'%s user(s) deleted', $counter);
180 $result->setStatus($status);
const SYSTEM_USER_ID
This file contains constants for PHPStan analyis, see: https://phpstan.org/config-reference#constants...
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
static getUserIdsNeverLoggedIn(int $thresholdInDays)
Get ids of all users that have never logged in.
◆ saveCustomSettings()
ilCronDeleteNeverLoggedInUserAccounts::saveCustomSettings |
( |
ilPropertyFormGUI |
$a_form | ) |
|
Definition at line 218 of file class.ilCronDeleteNeverLoggedInUserAccounts.php.
References Vendor\Package\$e, $valid, ilPropertyFormGUI\getItemByPostVar(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ILIAS\Repository\settings().
222 $this->roleIdWhiteliste = implode(
',', $this->
http->wrapper()->post()->retrieve(
225 $this->refinery->kindlyTo()->listOf($this->
refinery->kindlyTo()->int()),
231 $this->thresholdInDays = $this->
http->wrapper()->post()->retrieve(
237 $a_form->
getItemByPostVar(
'threshold')->setAlert($this->
lng->txt(
'user_never_logged_in_info_threshold_err_num'));
242 'cron_users_without_login_delete_incl_roles',
243 $this->roleIdWhiteliste
246 'cron_users_without_login_delete_threshold',
247 (
string) $this->thresholdInDays
252 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'form_input_not_valid'));
static http()
Fetches the global http state from ILIAS.
◆ $http
ILIAS HTTP GlobalHttpState ilCronDeleteNeverLoggedInUserAccounts::$http |
|
private |
◆ $lng
ilLanguage ilCronDeleteNeverLoggedInUserAccounts::$lng |
|
private |
◆ $main_tpl
◆ $objectDataCache
◆ $rbacreview
ilRbacReview ilCronDeleteNeverLoggedInUserAccounts::$rbacreview |
|
private |
◆ $refinery
ILIAS Refinery Factory ilCronDeleteNeverLoggedInUserAccounts::$refinery |
|
private |
◆ $roleIdWhiteliste
string ilCronDeleteNeverLoggedInUserAccounts::$roleIdWhiteliste = '' |
|
private |
◆ $settings
ilSetting ilCronDeleteNeverLoggedInUserAccounts::$settings |
|
private |
◆ $thresholdInDays
int ilCronDeleteNeverLoggedInUserAccounts::$thresholdInDays = self::DEFAULT_CREATION_THRESHOLD |
|
private |
◆ DEFAULT_CREATION_THRESHOLD
const ilCronDeleteNeverLoggedInUserAccounts::DEFAULT_CREATION_THRESHOLD = 365 |
|
private |
The documentation for this class was generated from the following file: