|
| | __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, ?CronJobScheduleType $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 (?CronJobScheduleType $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 188 of file class.ilCronDeleteNeverLoggedInUserAccounts.php.
References ilPropertyFormGUI\addItem(), ANONYMOUS_ROLE_ID, ILIAS\Repository\lng(), ILIAS\Repository\objectDataCache(), and ilFormPropertyGUI\setInfo().
191 $this->
lng->txt(
'cron_users_without_login_del_role_whitelist'),
194 $roleWhiteList->
setInfo($this->
lng->txt(
'cron_users_without_login_del_role_whitelist_info'));
196 foreach ($this->rbacreview->getGlobalRoles() as $role_id) {
201 $roleWhiteList->setOptions($roles);
202 $roleWhiteList->setValue(array_filter(
array_map(
'intval', explode(
',', $this->roleIdWhiteliste))));
203 $roleWhiteList->setWidth(300);
204 $a_form->
addItem($roleWhiteList);
207 $this->
lng->txt(
'cron_users_without_login_del_create_date_thr'),
210 $threshold->allowDecimals(
false);
211 $threshold->setInfo($this->
lng->txt(
'cron_users_without_login_del_create_date_thr_info'));
212 $threshold->setValue((
string) $this->thresholdInDays);
213 $threshold->setSuffix($this->
lng->txt(
'days'));
214 $threshold->setSize(4);
215 $threshold->setMaxLength(4);
216 $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 126 of file class.ilCronDeleteNeverLoggedInUserAccounts.php.
References $DIC, ANONYMOUS_USER_ID, ilObjectFactory\getInstanceByObjId(), ilObjUser\getUserIdsNeverLoggedIn(), ilCronJobResult\STATUS_NO_ACTION, ilCronJobResult\STATUS_OK, and SYSTEM_USER_ID.
133 $message =
'No user deleted';
136 $this->thresholdInDays ?: self::DEFAULT_CREATION_THRESHOLD
139 $roleIdWhitelist = array_filter(
array_map(
'intval', explode(
',', $this->roleIdWhiteliste)));
142 foreach ($userIds as $userId) {
154 if (count($roleIdWhitelist) > 0) {
155 $assignedRoleIds = array_filter(
array_map(
'intval', $this->rbacreview->assignedRoles($userId)));
157 $respectedRolesToInclude = array_intersect($assignedRoleIds, $roleIdWhitelist);
158 if (count($respectedRolesToInclude) > 0) {
167 $DIC->logger()->user()->info(sprintf(
168 "Deleting user account with id %s (login: %s)",
179 $message = sprintf(
'%s user(s) deleted', $counter);
182 $result->setStatus($status);
183 $result->setMessage($message);
const SYSTEM_USER_ID
This file contains constants for PHPStan analyis, see: https://phpstan.org/config-reference#constants...
final const STATUS_NO_ACTION
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 220 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().
224 $this->roleIdWhiteliste = implode(
',', $this->
http->wrapper()->post()->retrieve(
227 $this->refinery->kindlyTo()->listOf($this->
refinery->kindlyTo()->int()),
233 $this->thresholdInDays = $this->
http->wrapper()->post()->retrieve(
239 $a_form->
getItemByPostVar(
'threshold')->setAlert($this->
lng->txt(
'user_never_logged_in_info_threshold_err_num'));
244 'cron_users_without_login_delete_incl_roles',
245 $this->roleIdWhiteliste
248 'cron_users_without_login_delete_threshold',
249 (
string) $this->thresholdInDays
254 $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
| Language 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: