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

Public Member Functions

 ilRegistrationRoleAccessLimitations ()
 __read ()
 save ()
 validate ()
 getMode ($a_role_id)
 setMode ($a_mode, $a_role_id)
 getAbsolute ($a_role_id)
 setAbsolute ($a_arr, $a_role_id)
 getRelative ($a_role_id, $a_type)
 setRelative ($a_arr, $a_role_id)

Data Fields

 $access_limits = array()

Detailed Description

Member Function Documentation

ilRegistrationRoleAccessLimitations::__read ( )

Definition at line 49 of file class.ilRegistrationRoleAccessLimitations.php.

References $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilRegistrationRoleAccessLimitations().

{
global $ilias;
$query = "SELECT * FROM reg_access_limit ";
$res = $this->db->query($query);
$this->access_limitations = array();
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->access_limitations[$row->role_id]['id'] = $row->role_id;
$this->access_limitations[$row->role_id]['absolute'] = $row->limit_absolute;
$this->access_limitations[$row->role_id]['relative_d'] = $row->limit_relative_d;
$this->access_limitations[$row->role_id]['relative_m'] = $row->limit_relative_m;
$this->access_limitations[$row->role_id]['relative_y'] = $row->limit_relative_y;
$this->access_limitations[$row->role_id]['mode'] = $row->limit_mode;
}
return true;
}

+ Here is the caller graph for this function:

ilRegistrationRoleAccessLimitations::getAbsolute (   $a_role_id)

Definition at line 133 of file class.ilRegistrationRoleAccessLimitations.php.

{
return $this->access_limitations[$a_role_id] ? $this->access_limitations[$a_role_id]['absolute'] : time();
}
ilRegistrationRoleAccessLimitations::getMode (   $a_role_id)

Definition at line 123 of file class.ilRegistrationRoleAccessLimitations.php.

{
return $this->access_limitations[$a_role_id] ? $this->access_limitations[$a_role_id]['mode'] : 'null';
}
ilRegistrationRoleAccessLimitations::getRelative (   $a_role_id,
  $a_type 
)

Definition at line 143 of file class.ilRegistrationRoleAccessLimitations.php.

{
return $this->access_limitations[$a_role_id] ? $this->access_limitations[$a_role_id]['relative_'.$a_type] : 0;
}
ilRegistrationRoleAccessLimitations::ilRegistrationRoleAccessLimitations ( )

Definition at line 40 of file class.ilRegistrationRoleAccessLimitations.php.

References __read().

{
global $ilDB;
$this->db =& $ilDB;
$this->__read();
}

+ Here is the call graph for this function:

ilRegistrationRoleAccessLimitations::save ( )

Definition at line 70 of file class.ilRegistrationRoleAccessLimitations.php.

References $data, $query, and $res.

{
global $ilias, $ilDB;
foreach($this->access_limitations as $key => $data)
{
$limit_value = "";
// Delete old entry
$query = "DELETE FROM reg_access_limit ".
"WHERE role_id = ".$ilDB->quote($key,'integer');
$res = $ilDB->manipulate($query);
$query = "INSERT INTO reg_access_limit (role_id,limit_mode,limit_absolute,".
"limit_relative_d,limit_relative_m,limit_relative_y) ".
"VALUES( ".
$ilDB->quote($key,'integer').", ".
$ilDB->quote($data['mode'] ,'text').", ".
$ilDB->quote($data['absolute']).", ".
$ilDB->quote($data['relative_d']).", ".
$ilDB->quote($data['relative_m']).", ".
$ilDB->quote($data['relative_y'])." ".
")";
$res = $ilDB->manipulate($query);
}
return true;
}
ilRegistrationRoleAccessLimitations::setAbsolute (   $a_arr,
  $a_role_id 
)

Definition at line 138 of file class.ilRegistrationRoleAccessLimitations.php.

{
$this->access_limitations[$a_role_id]['absolute'] = mktime(23,59,59,$a_arr['m'],$a_arr['d'],$a_arr['y']);
}
ilRegistrationRoleAccessLimitations::setMode (   $a_mode,
  $a_role_id 
)

Definition at line 128 of file class.ilRegistrationRoleAccessLimitations.php.

{
$this->access_limitations[$a_role_id]['mode'] = $a_mode;
}
ilRegistrationRoleAccessLimitations::setRelative (   $a_arr,
  $a_role_id 
)

Definition at line 148 of file class.ilRegistrationRoleAccessLimitations.php.

{
$this->access_limitations[$a_role_id]['relative_d'] = $a_arr['d'];
$this->access_limitations[$a_role_id]['relative_m'] = $a_arr['m'];
$this->access_limitations[$a_role_id]['relative_y'] = $a_arr['y'];
}
ilRegistrationRoleAccessLimitations::validate ( )

Definition at line 100 of file class.ilRegistrationRoleAccessLimitations.php.

References $data, IL_REG_ACCESS_LIMITATION_MISSING_MODE, and IL_REG_ACCESS_LIMITATION_OUT_OF_DATE.

{
foreach ($this->access_limitations as $data)
{
if ($data['mode'] == "null")
{
}
if ($data['mode'] == 'absolute' and $data['absolute'] < time())
{
}
if ($data['mode'] == 'relative' and ($data['relative_d'] < 1 and $data['relative_m'] < 1 and $data['relative_y'] < 1))
{
}
}
return 0;
}

Field Documentation

ilRegistrationRoleAccessLimitations::$access_limits = array()

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