ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 $DIC;
22 
23  $ilDB = $DIC['ilDB'];
24  $this->db = $ilDB;
25  $this->mapping_id = $a_mapping_id;
26  }
27 
31  public function read()
32  {
33  $query = "SELECT * FROM ldap_rg_mapping "
34  . "WHERE mapping_id = " . $this->db->quote($this->getMappingId(), 'integer');
35  $set = $this->db->query($query);
36  $rec = $this->db->fetchAssoc($set);
37 
38  $this->setMappingId($rec["mapping_id"]);
39  $this->setServerId($rec["server_id"]);
40  $this->setURL($rec["url"]);
41  $this->setDN($rec["dn"]);
42  $this->setMemberAttribute($rec["member_attribute"]);
43  $this->setMemberISDN($rec["member_isdn"]);
44  $this->setRole($rec["role"]);
45  $this->setMappingInfo($rec["mapping_info"]);
46  $this->setMappingInfoType($rec["mapping_info_type"]);
47  }
48 
52  public function delete()
53  {
54  $query = "DELETE FROM ldap_rg_mapping " .
55  "WHERE mapping_id = " . $this->db->quote($this->getMappingId(), 'integer');
56  $res = $this->db->manipulate($query);
57  }
58 
62  public function update()
63  {
64  $query = "UPDATE ldap_rg_mapping " .
65  "SET server_id = " . $this->db->quote($this->getServerId(), 'integer') . ", " .
66  "url = " . $this->db->quote($this->getURL(), 'text') . ", " .
67  "dn =" . $this->db->quote($this->getDN(), 'text') . ", " .
68  "member_attribute = " . $this->db->quote($this->getMemberAttribute(), 'text') . ", " .
69  "member_isdn = " . $this->db->quote($this->getMemberISDN(), 'integer') . ", " .
70  "role = " . $this->db->quote($this->getRole(), 'integer') . ", " .
71  "mapping_info = " . $this->db->quote($this->getMappingInfo(), 'text') . ", " .
72  "mapping_info_type = " . $this->db->quote($this->getMappingInfoType(), 'integer') . " " .
73  "WHERE mapping_id = " . $this->db->quote($this->getMappingId(), 'integer');
74  $res = $this->db->manipulate($query);
75  }
76 
80  public function save()
81  {
82  $this->setMappingId($this->db->nextId('ldap_rg_mapping'));
83  $query = "INSERT INTO ldap_rg_mapping (mapping_id,server_id,url,dn,member_attribute,member_isdn,role,mapping_info,mapping_info_type) " .
84  "VALUES ( " .
85  $this->db->quote($this->getMappingId(), 'integer') . ", " .
86  $this->db->quote($this->getServerId(), 'integer') . ", " .
87  $this->db->quote($this->getURL(), 'text') . ", " .
88  $this->db->quote($this->getDN(), 'text') . ", " .
89  $this->db->quote($this->getMemberAttribute(), 'text') . ", " .
90  $this->db->quote($this->getMemberISDN(), 'integer') . ", " .
91  $this->db->quote($this->getRole(), 'integer') . ", " .
92  $this->db->quote($this->getMappingInfo(), 'text') . ", " .
93  $this->db->quote($this->getMappingInfoType(), 'integer') .
94  ")";
95  $res = $this->db->manipulate($query);
96  }
97 
102  public function getMappingId()
103  {
104  return $this->mapping_id;
105  }
106 
111  public function setMappingId($a_value)
112  {
113  $this->mapping_id = $a_value;
114  }
115 
120  public function getServerId()
121  {
122  return $this->server_id;
123  }
124 
129  public function setServerId($a_value)
130  {
131  $this->server_id = $a_value;
132  }
133 
138  public function getURL()
139  {
140  return $this->url;
141  }
142 
147  public function setURL($a_value)
148  {
149  $this->url = $a_value;
150  }
151 
156  public function getDN()
157  {
158  return $this->dn;
159  }
160 
165  public function setDN($a_value)
166  {
167  $this->dn = $a_value;
168  }
169 
174  public function getMemberAttribute()
175  {
176  return $this->member_attribute;
177  }
178 
183  public function setMemberAttribute($a_value)
184  {
185  $this->member_attribute = $a_value;
186  }
187 
192  public function getMemberISDN()
193  {
194  return $this->member_isdn;
195  }
196 
201  public function setMemberISDN($a_value)
202  {
203  $this->member_isdn = $a_value;
204  }
205 
210  public function getRole()
211  {
212  return $this->role;
213  }
214 
219  public function setRole($a_value)
220  {
221  $this->role = $a_value;
222  }
223 
229  public function getRoleName()
230  {
231  global $DIC;
232 
233  $ilObjDataCache = $DIC['ilObjDataCache'];
234  return $ilObjDataCache->lookupTitle($this->role);
235  }
236 
242  public function setRoleByName($a_value)
243  {
244  global $DIC;
245 
246  $rbacreview = $DIC['rbacreview'];
247  $this->role = $rbacreview->roleExists(ilUtil::stripSlashes($a_value));
248  }
249 
254  public function getMappingInfo()
255  {
256  return $this->mapping_info;
257  }
258 
263  public function setMappingInfo($a_value)
264  {
265  $this->mapping_info = $a_value;
266  }
267 
272  public function getMappingInfoType()
273  {
274  return $this->mapping_info_type;
275  }
276 
281  public function setMappingInfoType($a_value)
282  {
283  $this->mapping_info_type = $a_value;
284  }
285 }
setMemberISDN($a_value)
set Member Attribute Value is DN
global $DIC
Definition: saml.php:7
__construct($a_mapping_id)
constructor ilDB $ilDB
setMappingInfoType($a_value)
set Show Information also in the Repository/Personal Desktop
setRoleByName($a_value)
set ILIAS Role Name ilRbacReview $rbacreview
getRoleName()
get ILIAS Role Name type $ilObjDataCache
foreach($_POST as $key=> $value) $res
getMappingInfoType()
get Show Information also in the Repository/Personal Desktop
$query
getMemberISDN()
get Member Attribute Value is DN
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
setMemberAttribute($a_value)
set Group Member Attribute
global $ilDB
$url