ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 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 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 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 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 function getMappingId()
101 {
102 return $this->mapping_id;
103 }
104
109 function setMappingId($a_value)
110 {
111 $this->mapping_id = $a_value;
112 }
113
118 function getServerId()
119 {
120 return $this->server_id;
121 }
122
127 function setServerId($a_value)
128 {
129 $this->server_id = $a_value;
130 }
131
136 function getURL()
137 {
138 return $this->url;
139 }
140
145 function setURL($a_value)
146 {
147 $this->url = $a_value;
148 }
149
154 function getDN()
155 {
156 return $this->dn;
157 }
158
163 function setDN($a_value)
164 {
165 $this->dn = $a_value;
166 }
167
173 {
174 return $this->member_attribute;
175 }
176
181 function setMemberAttribute($a_value)
182 {
183 $this->member_attribute = $a_value;
184 }
185
190 function getMemberISDN()
191 {
192 return $this->member_isdn;
193 }
194
199 function setMemberISDN($a_value)
200 {
201 $this->member_isdn = $a_value;
202 }
203
208 function getRole()
209 {
210 return $this->role;
211 }
212
217 function setRole($a_value)
218 {
219 $this->role = $a_value;
220 }
221
227 function getRoleName()
228 {
229 global $ilObjDataCache;
230 return $ilObjDataCache->lookupTitle($this->role);
231 }
232
238 function setRoleByName($a_value)
239 {
240 global $rbacreview;
241 $this->role = $rbacreview->roleExists(ilUtil::stripSlashes($a_value));
242 }
243
248 function getMappingInfo()
249 {
250 return $this->mapping_info;
251 }
252
257 function setMappingInfo($a_value)
258 {
259 $this->mapping_info = $a_value;
260 }
261
267 {
268 return $this->mapping_info_type;
269 }
270
275 function setMappingInfoType($a_value)
276 {
277 $this->mapping_info_type = $a_value;
278 }
279}
280?>
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
$url
Definition: shib_logout.php:72
global $ilDB