33 define(
'IL_REG_ACCESS_LIMITATION_MISSING_MODE', 1);
34 define(
'IL_REG_ACCESS_LIMITATION_OUT_OF_DATE', 2);
57 $ilias = $DIC[
'ilias'];
59 $query =
"SELECT * FROM reg_access_limit ";
62 $this->access_limitations = array();
64 $this->access_limitations[
$row->role_id][
'id'] =
$row->role_id;
65 $this->access_limitations[
$row->role_id][
'absolute'] =
$row->limit_absolute;
66 $this->access_limitations[
$row->role_id][
'relative_d'] =
$row->limit_relative_d;
67 $this->access_limitations[
$row->role_id][
'relative_m'] =
$row->limit_relative_m;
68 $this->access_limitations[
$row->role_id][
'relative_y'] =
$row->limit_relative_y;
69 $this->access_limitations[
$row->role_id][
'mode'] =
$row->limit_mode;
79 $ilias = $DIC[
'ilias'];
82 foreach ($this->access_limitations as
$key =>
$data) {
86 $query =
"DELETE FROM reg_access_limit " .
87 "WHERE role_id = " .
$ilDB->quote(
$key,
'integer');
91 $query =
"INSERT INTO reg_access_limit (role_id,limit_mode,limit_absolute," .
92 "limit_relative_d,limit_relative_m,limit_relative_y) " .
109 foreach ($this->access_limitations as
$data) {
110 if ($data[
'mode'] ==
"null") {
114 if ($data[
'mode'] ==
'absolute' and $data[
'absolute'] < time()) {
118 if ($data[
'mode'] ==
'relative' and ($data[
'relative_d'] < 1
and $data[
'relative_m'] < 1
and $data[
'relative_y'] < 1)) {
128 return $this->access_limitations[$a_role_id] ? $this->access_limitations[$a_role_id][
'mode'] :
'null';
133 $this->access_limitations[$a_role_id][
'mode'] = $a_mode;
138 return $this->access_limitations[$a_role_id] ? $this->access_limitations[$a_role_id][
'absolute'] : time();
143 $this->access_limitations[$a_role_id][
'absolute'] = mktime(23, 59, 59, $a_arr[
'm'], $a_arr[
'd'], $a_arr[
'y']);
148 return $this->access_limitations[$a_role_id] ? $this->access_limitations[$a_role_id][
'relative_' .
$a_type] : 0;
153 $this->access_limitations[$a_role_id][
'relative_d'] = $a_arr[
'd'];
154 $this->access_limitations[$a_role_id][
'relative_m'] = $a_arr[
'm'];
155 $this->access_limitations[$a_role_id][
'relative_y'] = $a_arr[
'y'];
163 $this->access_limitations = array();
getRelative($a_role_id, $a_type)
const IL_REG_ACCESS_LIMITATION_OUT_OF_DATE
resetAccessLimitations()
reset access limitations
foreach($_POST as $key=> $value) $res
setRelative($a_arr, $a_role_id)
setMode($a_mode, $a_role_id)
const IL_REG_ACCESS_LIMITATION_MISSING_MODE
Class class.ilRegistrationAccessLimitation.
setAbsolute($a_arr, $a_role_id)