34 $this->interval = $ilSetting->get(
35 'cron_inactive_user_delete_interval',
36 self::getDefaultIntervalKey()
39 $this->include_roles = $ilSetting->get(
40 'cron_inactive_user_delete_include_roles', null
42 if($this->include_roles === null) $this->include_roles = array();
43 else $this->include_roles = explode(
',', $this->include_roles);
45 $this->period = $ilSetting->get(
46 'cron_inactive_user_delete_period',
47 self::DEFAULT_INACTIVITY_PERIOD
50 $last_run = (int)$ilSetting->get(
'cron_inactive_user_delete_last_run', 0);
52 if( $ilSetting->get(
'cron_inactive_user_delete',
false) )
56 $this->enabled =
true;
58 $ilSetting->set(
'cron_inactive_user_delete_last_run', time());
65 if( !$this->enabled )
return;
73 if($usr_id == ANONYMOUS_USER_ID || $usr_id == SYSTEM_USER_ID)
continue;
76 foreach($this->include_roles as $role_id)
78 if( $rbacreview->isAssigned($usr_id, $role_id) )
84 if($continue)
continue;
96 switch( $this->interval )
98 case self::INTERVAL_QUARTERLY:
$period *= 3;
99 case self::INTERVAL_MONTHLY:
$period *= 30;
100 case self::INTERVAL_WEEKLY:
$period *= 7;
101 case self::INTERVAL_DAILY:
$period *= 24;
112 self::INTERVAL_DAILY => $lng->txt(
"daily"),
113 self::INTERVAL_WEEKLY => $lng->txt(
"weekly"),
114 self::INTERVAL_MONTHLY => $lng->txt(
"monthly"),
115 self::INTERVAL_QUARTERLY => $lng->txt(
"quarterly")