ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilLDAPRoleGroupMappingSetting.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
4
13{
19 public function __construct($a_mapping_id)
20 {
21 global $ilDB;
22 $this->db = $ilDB;
23 $this->mapping_id = $a_mapping_id;
24 }
25
29 public function read()
30 {
31 $query = "SELECT * FROM ldap_rg_mapping "
32 . "WHERE mapping_id = " . $this->db->quote($this->getMappingId(), 'integer');
33 $set = $this->db->query($query);
34 $rec = $this->db->fetchAssoc($set);
35
36 $this->setMappingId($rec["mapping_id"]);
37 $this->setServerId($rec["server_id"]);
38 $this->setURL($rec["url"]);
39 $this->setDN($rec["dn"]);
40 $this->setMemberAttribute($rec["member_attribute"]);
41 $this->setMemberISDN($rec["member_isdn"]);
42 $this->setRole($rec["role"]);
43 $this->setMappingInfo($rec["mapping_info"]);
44 $this->setMappingInfoType($rec["mapping_info_type"]);
45 }
46
50 public function delete()
51 {
52 $query = "DELETE FROM ldap_rg_mapping " .
53 "WHERE mapping_id = " . $this->db->quote($this->getMappingId(), 'integer');
54 $res = $this->db->manipulate($query);
55 }
56
60 public function update()
61 {
62 $query = "UPDATE ldap_rg_mapping " .
63 "SET server_id = " . $this->db->quote($this->getServerId(), 'integer') . ", " .
64 "url = " . $this->db->quote($this->getURL(), 'text') . ", " .
65 "dn =" . $this->db->quote($this->getDN(), 'text') . ", " .
66 "member_attribute = " . $this->db->quote($this->getMemberAttribute(), 'text') . ", " .
67 "member_isdn = " . $this->db->quote($this->getMemberISDN(), 'integer') . ", " .
68 "role = " . $this->db->quote($this->getRole(), 'integer') . ", " .
69 "mapping_info = " . $this->db->quote($this->getMappingInfo(), 'text') . ", " .
70 "mapping_info_type = " . $this->db->quote($this->getMappingInfoType(), 'integer') . " " .
71 "WHERE mapping_id = " . $this->db->quote($this->getMappingId(), 'integer');
72 $res = $this->db->manipulate($query);
73 }
74
78 public function save()
79 {
80 $this->setMappingId($this->db->nextId('ldap_rg_mapping'));
81 $query = "INSERT INTO ldap_rg_mapping (mapping_id,server_id,url,dn,member_attribute,member_isdn,role,mapping_info,mapping_info_type) " .
82 "VALUES ( " .
83 $this->db->quote($this->getMappingId(), 'integer') . ", " .
84 $this->db->quote($this->getServerId(), 'integer') . ", " .
85 $this->db->quote($this->getURL(), 'text') . ", " .
86 $this->db->quote($this->getDN(), 'text') . ", " .
87 $this->db->quote($this->getMemberAttribute(), 'text') . ", " .
88 $this->db->quote($this->getMemberISDN(), 'integer') . ", " .
89 $this->db->quote($this->getRole(), 'integer') . ", " .
90 $this->db->quote($this->getMappingInfo(), 'text') . ", " .
91 $this->db->quote($this->getMappingInfoType(), 'integer') .
92 ")";
93 $res = $this->db->manipulate($query);
94 }
95
100 public function getMappingId()
101 {
102 return $this->mapping_id;
103 }
104
109 public function setMappingId($a_value)
110 {
111 $this->mapping_id = $a_value;
112 }
113
118 public function getServerId()
119 {
120 return $this->server_id;
121 }
122
127 public function setServerId($a_value)
128 {
129 $this->server_id = $a_value;
130 }
131
136 public function getURL()
137 {
138 return $this->url;
139 }
140
145 public function setURL($a_value)
146 {
147 $this->url = $a_value;
148 }
149
154 public function getDN()
155 {
156 return $this->dn;
157 }
158
163 public function setDN($a_value)
164 {
165 $this->dn = $a_value;
166 }
167
172 public function getMemberAttribute()
173 {
174 return $this->member_attribute;
175 }
176
181 public function setMemberAttribute($a_value)
182 {
183 $this->member_attribute = $a_value;
184 }
185
190 public function getMemberISDN()
191 {
192 return $this->member_isdn;
193 }
194
199 public function setMemberISDN($a_value)
200 {
201 $this->member_isdn = $a_value;
202 }
203
208 public function getRole()
209 {
210 return $this->role;
211 }
212
217 public function setRole($a_value)
218 {
219 $this->role = $a_value;
220 }
221
227 public function getRoleName()
228 {
229 global $ilObjDataCache;
230 return $ilObjDataCache->lookupTitle($this->role);
231 }
232
238 public function setRoleByName($a_value)
239 {
240 global $rbacreview;
241 $this->role = $rbacreview->roleExists(ilUtil::stripSlashes($a_value));
242 }
243
248 public function getMappingInfo()
249 {
250 return $this->mapping_info;
251 }
252
257 public function setMappingInfo($a_value)
258 {
259 $this->mapping_info = $a_value;
260 }
261
266 public function getMappingInfoType()
267 {
268 return $this->mapping_info_type;
269 }
270
275 public function setMappingInfoType($a_value)
276 {
277 $this->mapping_info_type = $a_value;
278 }
279}
An exception for terminatinating execution or to throw for unit testing.
getRoleName()
get ILIAS Role Name @global type $ilObjDataCache
getMappingInfoType()
get Show Information also in the Repository/Personal Desktop
setMemberAttribute($a_value)
set Group Member Attribute
setMappingInfoType($a_value)
set Show Information also in the Repository/Personal Desktop
setMemberISDN($a_value)
set Member Attribute Value is DN
setRoleByName($a_value)
set ILIAS Role Name @global ilRbacReview $rbacreview
__construct($a_mapping_id)
constructor @global ilDB $ilDB
getMemberISDN()
get Member Attribute Value is DN
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$query
$url
foreach($_POST as $key=> $value) $res
global $ilDB