ILIAS  Release_5_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 "./Services/Object/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 
144 
158  function notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params = 0)
159  {
160  global $tree;
161 
162  switch ($a_event)
163  {
164  case "link":
165 
166  //var_dump("<pre>",$a_params,"</pre>");
167  //echo "Module name ".$this->getRefId()." triggered by link event. Objects linked into target object ref_id: ".$a_ref_id;
168  //exit;
169  break;
170 
171  case "cut":
172 
173  //echo "Module name ".$this->getRefId()." triggered by cut event. Objects are removed from target object ref_id: ".$a_ref_id;
174  //exit;
175  break;
176 
177  case "copy":
178 
179  //var_dump("<pre>",$a_params,"</pre>");
180  //echo "Module name ".$this->getRefId()." triggered by copy event. Objects are copied into target object ref_id: ".$a_ref_id;
181  //exit;
182  break;
183 
184  case "paste":
185 
186  //echo "Module name ".$this->getRefId()." triggered by paste (cut) event. Objects are pasted into target object ref_id: ".$a_ref_id;
187  //exit;
188  break;
189 
190  case "new":
191 
192  //echo "Module name ".$this->getRefId()." triggered by paste (new) event. Objects are applied to target object ref_id: ".$a_ref_id;
193  //exit;
194  break;
195  }
196 
197  // At the beginning of the recursive process it avoids second call of the notify function with the same parameter
198  if ($a_node_id==$_GET["ref_id"])
199  {
200  $parent_obj =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
201  $parent_type = $parent_obj->getType();
202  if($parent_type == $this->getType())
203  {
204  $a_node_id = (int) $tree->getParentId($a_node_id);
205  }
206  }
207 
208  parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
209  }
210 } // END class.ilObjAuthSettings
211 ?>