ILIAS  Release_3_10_x_branch Revision 61812
 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 $res, and DB_FETCHMODE_OBJECT.

Referenced by ilRegistrationRoleAccessLimitations().

{
global $ilias;
$query = "SELECT * FROM reg_access_limitation ";
$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 134 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 124 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 144 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.

{
global $ilias, $ilDB;
foreach($this->access_limitations as $key => $data)
{
$limit_value = "";
if ($data['mode'] == 'absolute')
{
$limit_value = ", limit_absolute = ".$ilDB->quote($data['absolute'])." ";
}
if ($data['mode'] == 'relative')
{
$limit_value = ", limit_relative_d = ".$ilDB->quote($data['relative_d'])." ".
", limit_relative_m = ".$ilDB->quote($data['relative_m'])." ".
", limit_relative_y = ".$ilDB->quote($data['relative_y'])." ";
}
$query = "REPLACE INTO reg_access_limitation ".
"SET role_id = ".$ilDB->quote($key).", ".
"limit_mode = ".$ilDB->quote($data['mode'])." ".
$limit_value;
$this->db->query($query);
}
return true;
}
ilRegistrationRoleAccessLimitations::setAbsolute (   $a_arr,
  $a_role_id 
)

Definition at line 139 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 129 of file class.ilRegistrationRoleAccessLimitations.php.

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

Definition at line 149 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 101 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: