4 include_once
"Services/Cron/classes/class.ilCronJob.php";
26 if (is_object($ilSetting)) {
27 $this->include_roles = $ilSetting->get(
28 'cron_inactivated_user_delete_include_roles',
31 if ($this->include_roles === null) {
32 $this->include_roles =
array();
34 $this->include_roles = explode(
',', $this->include_roles);
37 $this->period = $ilSetting->get(
38 'cron_inactivated_user_delete_period',
39 self::DEFAULT_INACTIVITY_PERIOD
46 return "user_inactivated";
53 return $lng->txt(
"delete_inactivated_user_accounts");
61 $lng->txt(
"delete_inactivated_user_accounts_desc"),
68 return self::SCHEDULE_TYPE_DAILY;
100 foreach ($usr_ids as $usr_id) {
101 if ($usr_id == ANONYMOUS_USER_ID || $usr_id == SYSTEM_USER_ID) {
106 foreach ($this->include_roles as $role_id) {
107 if ($rbacreview->isAssigned($usr_id, $role_id)) {
135 include_once(
'Services/Form/classes/class.ilMultiSelectInputGUI.php');
137 $lng->txt(
'delete_inactivated_user_accounts_include_roles'),
138 'cron_inactivated_user_delete_include_roles' 140 $sub_mlist->
setInfo($lng->txt(
'delete_inactivated_user_accounts_include_roles_desc'));
142 foreach ($rbacreview->getGlobalRoles() as $role_id) {
143 if ($role_id != ANONYMOUS_ROLE_ID) {
144 $roles[$role_id] = $ilObjDataCache->lookupTitle($role_id);
147 $sub_mlist->setOptions($roles);
148 $setting = $ilSetting->get(
'cron_inactivated_user_delete_include_roles', null);
149 if ($setting === null) {
152 $setting = explode(
',', $setting);
154 $sub_mlist->setValue($setting);
155 $sub_mlist->setWidth(300);
156 #$sub_mlist->setHeight(100); 159 $default_setting = self::DEFAULT_INACTIVITY_PERIOD;
161 $lng->txt(
'delete_inactivated_user_accounts_period'),
162 'cron_inactivated_user_delete_period' 165 $sub_text->setInfo($lng->txt(
'delete_inactivated_user_accounts_period_desc'));
166 $sub_text->setValue($ilSetting->get(
"cron_inactivated_user_delete_period", $default_setting));
167 $sub_text->setSize(4);
168 $sub_text->setMaxLength(4);
169 $sub_text->setRequired(
true);
186 $setting = implode(
',',
$_POST[
'cron_inactivated_user_delete_include_roles']);
187 if (!strlen($setting)) {
190 $ilSetting->set(
'cron_inactivated_user_delete_include_roles', $setting);
191 $ilSetting->set(
'cron_inactivated_user_delete_period',
$_POST[
'cron_inactivated_user_delete_period']);
static _getUserIdsByInactivationPeriod($period)
get ids of all users that have been inactivated since at least the given period
Cron job application base class.
addCustomSettingsToForm(ilPropertyFormGUI $a_form)
getDefaultScheduleValue()
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
Create styles array
The data for the language used.
Cron job result data container.
saveCustomSettings(ilPropertyFormGUI $a_form)
const DEFAULT_INACTIVITY_PERIOD