ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilCronDeleteInactivatedUserAccounts Class Reference
+ Collaboration diagram for ilCronDeleteInactivatedUserAccounts:

Public Member Functions

 __construct ()
 run ()

Static Public Member Functions

static getPossibleIntervalsArray ()
static getDefaultIntervalKey ()

Data Fields

const INTERVAL_DAILY = '1'
const INTERVAL_WEEKLY = '2'
const INTERVAL_MONTHLY = '3'
const INTERVAL_QUARTERLY = '4'
const DEFAULT_INACTIVITY_PERIOD = 365

Private Member Functions

 getCurrentIntervalPeriod ()

Private Attributes

 $interval = null
 $include_roles = null
 $period = null
 $enabled = false

Detailed Description

Constructor & Destructor Documentation

ilCronDeleteInactivatedUserAccounts::__construct ( )

Definition at line 29 of file class.ilCronDeleteInactivatedUserAccounts.php.

References $ilSetting, and getCurrentIntervalPeriod().

{
global $ilSetting;
$this->interval = $ilSetting->get(
'cron_inactivated_user_delete_interval',
self::getDefaultIntervalKey()
);
$this->include_roles = $ilSetting->get(
'cron_inactivated_user_delete_include_roles', null
);
if($this->include_roles === null) $this->include_roles = array();
else $this->include_roles = explode(',', $this->include_roles);
$this->period = $ilSetting->get(
'cron_inactivated_user_delete_period',
self::DEFAULT_INACTIVITY_PERIOD
);
$last_run = (int)$ilSetting->get('cron_inactivated_user_delete_last_run', 0);
if( $ilSetting->get('cron_inactivated_user_delete', false) )
{
if( !$last_run || (time() - $last_run) > $this->getCurrentIntervalPeriod() )
{
$this->enabled = true;
$ilSetting->set('cron_inactivated_user_delete_last_run', time());
}
}
}

+ Here is the call graph for this function:

Member Function Documentation

ilCronDeleteInactivatedUserAccounts::getCurrentIntervalPeriod ( )
private

Definition at line 91 of file class.ilCronDeleteInactivatedUserAccounts.php.

References $period.

Referenced by __construct().

{
$period = 60 * 60;
switch( $this->interval )
{
case self::INTERVAL_QUARTERLY: $period *= 3;
case self::INTERVAL_MONTHLY: $period *= 30;
case self::INTERVAL_WEEKLY: $period *= 7;
case self::INTERVAL_DAILY: $period *= 24;
}
return $period;
}

+ Here is the caller graph for this function:

static ilCronDeleteInactivatedUserAccounts::getDefaultIntervalKey ( )
static

Definition at line 118 of file class.ilCronDeleteInactivatedUserAccounts.php.

References INTERVAL_DAILY.

{
}
static ilCronDeleteInactivatedUserAccounts::getPossibleIntervalsArray ( )
static

Definition at line 106 of file class.ilCronDeleteInactivatedUserAccounts.php.

References $lng.

{
global $lng;
return array(
self::INTERVAL_DAILY => $lng->txt("daily"),
self::INTERVAL_WEEKLY => $lng->txt("weekly"),
self::INTERVAL_MONTHLY => $lng->txt("monthly"),
self::INTERVAL_QUARTERLY => $lng->txt("quarterly")
);
}
ilCronDeleteInactivatedUserAccounts::run ( )

Definition at line 62 of file class.ilCronDeleteInactivatedUserAccounts.php.

References $usr_id, ilObjUser\_getUserIdsByInactivationPeriod(), and ilObjectFactory\getInstanceByObjId().

{
if( !$this->enabled ) return;
global $rbacreview;
$usr_ids = ilObjUser::_getUserIdsByInactivationPeriod($this->period);
foreach($usr_ids as $usr_id)
{
if($usr_id == ANONYMOUS_USER_ID || $usr_id == SYSTEM_USER_ID) continue;
$continue = true;
foreach($this->include_roles as $role_id)
{
if( $rbacreview->isAssigned($usr_id, $role_id) )
{
$continue = false;
break;
}
}
if($continue) continue;
$user->delete();
}
}

+ Here is the call graph for this function:

Field Documentation

ilCronDeleteInactivatedUserAccounts::$enabled = false
private
ilCronDeleteInactivatedUserAccounts::$include_roles = null
private
ilCronDeleteInactivatedUserAccounts::$interval = null
private
ilCronDeleteInactivatedUserAccounts::$period = null
private
const ilCronDeleteInactivatedUserAccounts::DEFAULT_INACTIVITY_PERIOD = 365
const ilCronDeleteInactivatedUserAccounts::INTERVAL_DAILY = '1'

Definition at line 14 of file class.ilCronDeleteInactivatedUserAccounts.php.

Referenced by getDefaultIntervalKey().

const ilCronDeleteInactivatedUserAccounts::INTERVAL_MONTHLY = '3'
const ilCronDeleteInactivatedUserAccounts::INTERVAL_QUARTERLY = '4'
const ilCronDeleteInactivatedUserAccounts::INTERVAL_WEEKLY = '2'

The documentation for this class was generated from the following file: