33 $this->interval = $ilSetting->get(
34 'cron_inactivated_user_delete_interval',
35 self::getDefaultIntervalKey()
38 $this->include_roles = $ilSetting->get(
39 'cron_inactivated_user_delete_include_roles', null
41 if($this->include_roles === null) $this->include_roles = array();
42 else $this->include_roles = explode(
',', $this->include_roles);
44 $this->period = $ilSetting->get(
45 'cron_inactivated_user_delete_period',
46 self::DEFAULT_INACTIVITY_PERIOD
49 $last_run = (int)$ilSetting->get(
'cron_inactivated_user_delete_last_run', 0);
51 if( $ilSetting->get(
'cron_inactivated_user_delete',
false) )
55 $this->enabled =
true;
57 $ilSetting->set(
'cron_inactivated_user_delete_last_run', time());
64 if( !$this->enabled )
return;
72 if($usr_id == ANONYMOUS_USER_ID || $usr_id == SYSTEM_USER_ID)
continue;
75 foreach($this->include_roles as $role_id)
77 if( $rbacreview->isAssigned($usr_id, $role_id) )
83 if($continue)
continue;
95 switch( $this->interval )
97 case self::INTERVAL_QUARTERLY:
$period *= 3;
98 case self::INTERVAL_MONTHLY:
$period *= 30;
99 case self::INTERVAL_WEEKLY:
$period *= 7;
100 case self::INTERVAL_DAILY:
$period *= 24;
111 self::INTERVAL_DAILY => $lng->txt(
"daily"),
112 self::INTERVAL_WEEKLY => $lng->txt(
"weekly"),
113 self::INTERVAL_MONTHLY => $lng->txt(
"monthly"),
114 self::INTERVAL_QUARTERLY => $lng->txt(
"quarterly")