4 include_once
"Services/Cron/classes/class.ilCronJob.php";
30 'cron_inactivated_user_delete_include_roles',
33 if ($this->include_roles === null) {
34 $this->include_roles = array();
36 $this->include_roles = explode(
',', $this->include_roles);
40 'cron_inactivated_user_delete_period',
41 self::DEFAULT_INACTIVITY_PERIOD
48 return "user_inactivated";
57 return $lng->txt(
"delete_inactivated_user_accounts");
67 $lng->txt(
"delete_inactivated_user_accounts_desc"),
74 return self::SCHEDULE_TYPE_DAILY;
101 $rbacreview = $DIC[
'rbacreview'];
108 foreach ($usr_ids as $usr_id) {
109 if ($usr_id == ANONYMOUS_USER_ID || $usr_id == SYSTEM_USER_ID) {
114 foreach ($this->include_roles as $role_id) {
115 if ($rbacreview->isAssigned($usr_id, $role_id)) {
144 $rbacreview = $DIC[
'rbacreview'];
145 $ilObjDataCache = $DIC[
'ilObjDataCache'];
148 include_once(
'Services/Form/classes/class.ilMultiSelectInputGUI.php');
150 $lng->txt(
'delete_inactivated_user_accounts_include_roles'),
151 'cron_inactivated_user_delete_include_roles' 153 $sub_mlist->
setInfo(
$lng->txt(
'delete_inactivated_user_accounts_include_roles_desc'));
155 foreach ($rbacreview->getGlobalRoles() as $role_id) {
156 if ($role_id != ANONYMOUS_ROLE_ID) {
157 $roles[$role_id] = $ilObjDataCache->lookupTitle($role_id);
160 $sub_mlist->setOptions($roles);
161 $setting =
$ilSetting->get(
'cron_inactivated_user_delete_include_roles', null);
162 if ($setting === null) {
165 $setting = explode(
',', $setting);
167 $sub_mlist->setValue($setting);
168 $sub_mlist->setWidth(300);
169 #$sub_mlist->setHeight(100); 172 $default_setting = self::DEFAULT_INACTIVITY_PERIOD;
174 $lng->txt(
'delete_inactivated_user_accounts_period'),
175 'cron_inactivated_user_delete_period' 178 $sub_text->setInfo(
$lng->txt(
'delete_inactivated_user_accounts_period_desc'));
179 $sub_text->setValue(
$ilSetting->get(
"cron_inactivated_user_delete_period", $default_setting));
180 $sub_text->setSize(4);
181 $sub_text->setMaxLength(4);
182 $sub_text->setRequired(
true);
201 $setting = implode(
',',
$_POST[
'cron_inactivated_user_delete_include_roles']);
202 if (!strlen($setting)) {
205 $ilSetting->set(
'cron_inactivated_user_delete_include_roles', $setting);
206 $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
Cron job result data container.
saveCustomSettings(ilPropertyFormGUI $a_form)
const DEFAULT_INACTIVITY_PERIOD