33 define(
'IL_REG_MISSING_DOMAIN',1);
34 define(
'IL_REG_MISSING_ROLE',2);
51 global $ilObjDataCache;
53 foreach($this->assignments as $assignment)
55 if(!$assignment[
'domain'] or !$assignment[
'role'])
59 if(stristr($a_email,$assignment[
'domain']))
62 if(!$ilObjDataCache->lookupType($assignment[
'role']))
66 return $assignment[
'role'];
75 return $this->assignments ? $this->assignments : array();
80 $this->assignments[$a_id][
'domain'] = $a_domain;
84 $this->assignments[$a_id][
'role'] = $a_role;
93 $this->default_role = $a_role_id;
96 function delete($a_id)
100 $query =
"DELETE FROM reg_er_assignments ".
101 "WHERE assignment_id = ".$ilDB->quote($a_id ,
'integer');
111 $next_id = $ilDB->nextId(
'reg_er_assignments');
112 $query =
"INSERT INTO reg_er_assignments (assignment_id,domain,role) ".
114 $ilDB->quote($next_id,
'integer').
', '.
115 $ilDB->quote(
'',
'text').
", ".
116 $ilDB->quote(0,
'integer').
125 global $ilias,
$ilDB;
130 foreach($this->assignments as $assignment)
132 $query =
"UPDATE reg_er_assignments ".
133 "SET domain = ".$ilDB->quote($assignment[
'domain'] ,
'text').
", ".
134 "role = ".$ilDB->quote($assignment[
'role'] ,
'integer').
" ".
135 "WHERE assignment_id = ".$ilDB->quote($assignment[
'id'] ,
'integer');
143 foreach($this->assignments as $assignment)
145 if(!strlen($assignment[
'domain']))
149 if(!$assignment[
'role'])
167 global $ilias,
$ilDB;
169 $query =
"SELECT * FROM reg_er_assignments ";
172 $this->assignments = array();
175 $this->assignments[
$row->assignment_id][
'id'] =
$row->assignment_id;
176 $this->assignments[
$row->assignment_id][
'role'] =
$row->role;
177 $this->assignments[
$row->assignment_id][
'domain'] =
$row->domain;
180 $this->default_role = $ilias->getSetting(
'reg_default_role');