55 $this->interval = $ilSetting->get(
56 'cron_inactive_user_delete_interval',
57 self::getDefaultIntervalKey()
60 $this->include_roles = $ilSetting->get(
61 'cron_inactive_user_delete_include_roles', null
63 if($this->include_roles === null) $this->include_roles = array();
64 else $this->include_roles = explode(
',', $this->include_roles);
66 $this->inactivity_period = $ilSetting->get(
67 'cron_inactive_user_delete_period',
68 self::DEFAULT_INACTIVITY_PERIOD
71 $last_run = (int)$ilSetting->get(
'cron_inactive_user_delete_last_run', 0);
75 $this->enabled =
true;
77 $ilSetting->set(
'cron_inactive_user_delete_last_run', time());
83 if( !$this->enabled )
return;
91 if($usr_id == ANONYMOUS_USER_ID || $usr_id == SYSTEM_USER_ID)
continue;
94 foreach($this->include_roles as $role_id)
96 if( $rbacreview->isAssigned($usr_id, $role_id) )
102 if($continue)
continue;
114 switch( $this->interval )
116 case self::INTERVAL_QUARTERLY: $period *= 3;
117 case self::INTERVAL_MONTHLY: $period *= 30;
118 case self::INTERVAL_WEEKLY: $period *= 7;
119 case self::INTERVAL_DAILY: $period *= 24;
130 self::INTERVAL_DAILY => $lng->txt(
"daily"),
131 self::INTERVAL_WEEKLY => $lng->txt(
"weekly"),
132 self::INTERVAL_MONTHLY => $lng->txt(
"monthly"),
133 self::INTERVAL_QUARTERLY => $lng->txt(
"quarterly")