ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilObjAuthSettings.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2001 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
33 include_once "./classes/class.ilObject.php";
34 
36 {
43  function ilObjAuthSettings($a_id = 0,$a_call_by_reference = true)
44  {
45  $this->type = "auth";
46  $this->ilObject($a_id,$a_call_by_reference);
47  }
48 
49  function checkAuthLDAP()
50  {
51  $settings = $this->ilias->getAllSettings();
52 
53  if (!$settings["ldap_server"] or !$settings["ldap_basedn"] or !$settings["ldap_port"])
54  {
55  return false;
56  }
57 
58  $this->ilias->setSetting('ldap_active',true);
59 
60  return true;
61  }
62 
63  function checkAuthSHIB()
64  {
65  $settings = $this->ilias->getAllSettings();
66 
67  if (!$settings["hos_type"] or !$settings["shib_user_default_role"] or !$settings["shib_login"]
68  or !$settings["shib_firstname"] or !$settings["shib_lastname"])
69  {
70  return false;
71  }
72 
73  $this->ilias->setSetting('shibboleth_active',true);
74 
75  return true;
76  }
77 
78  function checkAuthRADIUS()
79  {
80  $settings = $this->ilias->getAllSettings();
81 
82  if (!$settings["radius_server"] or !$settings["radius_shared_secret"] or !$settings["radius_port"])
83  {
84  return false;
85  }
86 
87  $this->ilias->setSetting('radius_active',true);
88 
89  return true;
90  }
91 
92  function checkAuthScript()
93  {
94  $settings = $this->ilias->getAllSettings();
95 
96  if (!$settings["auth_script_name"])
97  {
98  return false;
99  }
100 
101  $this->ilias->setSetting('script_active',true);
102 
103  return true;
104  }
105 
112  function update()
113  {
114  if (!parent::update())
115  {
116  return false;
117  }
118 
119  // put here object specific stuff
120 
121  return true;
122  }
123 
124 
131  function delete()
132  {
133  // always call parent delete function first!!
134  if (!parent::delete())
135  {
136  return false;
137  }
138 
139  //put here your module specific stuff
140 
141  return true;
142  }
143 
153  function initDefaultRoles()
154  {
155  global $rbacadmin;
156 
157  // create a local role folder
158  //$rfoldObj = $this->createRoleFolder("Local roles","Role Folder of forum obj_no.".$this->getId());
159 
160  // create moderator role and assign role to rolefolder...
161  //$roleObj = $rfoldObj->createRole("Moderator","Moderator of forum obj_no.".$this->getId());
162  //$roles[] = $roleObj->getId();
163 
164  //unset($rfoldObj);
165  //unset($roleObj);
166 
167  return $roles ? $roles : array();
168  }
169 
183  function notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params = 0)
184  {
185  global $tree;
186 
187  switch ($a_event)
188  {
189  case "link":
190 
191  //var_dump("<pre>",$a_params,"</pre>");
192  //echo "Module name ".$this->getRefId()." triggered by link event. Objects linked into target object ref_id: ".$a_ref_id;
193  //exit;
194  break;
195 
196  case "cut":
197 
198  //echo "Module name ".$this->getRefId()." triggered by cut event. Objects are removed from target object ref_id: ".$a_ref_id;
199  //exit;
200  break;
201 
202  case "copy":
203 
204  //var_dump("<pre>",$a_params,"</pre>");
205  //echo "Module name ".$this->getRefId()." triggered by copy event. Objects are copied into target object ref_id: ".$a_ref_id;
206  //exit;
207  break;
208 
209  case "paste":
210 
211  //echo "Module name ".$this->getRefId()." triggered by paste (cut) event. Objects are pasted into target object ref_id: ".$a_ref_id;
212  //exit;
213  break;
214 
215  case "new":
216 
217  //echo "Module name ".$this->getRefId()." triggered by paste (new) event. Objects are applied to target object ref_id: ".$a_ref_id;
218  //exit;
219  break;
220  }
221 
222  // At the beginning of the recursive process it avoids second call of the notify function with the same parameter
223  if ($a_node_id==$_GET["ref_id"])
224  {
225  $parent_obj =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
226  $parent_type = $parent_obj->getType();
227  if($parent_type == $this->getType())
228  {
229  $a_node_id = (int) $tree->getParentId($a_node_id);
230  }
231  }
232 
233  parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
234  }
235 } // END class.ilObjAuthSettings
236 ?>