• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

Services/Authentication/classes/class.ilObjAuthSettings.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2001 ILIAS open source, University of Cologne            |
00007         |                                                                             |
00008         | This program is free software; you can redistribute it and/or               |
00009         | modify it under the terms of the GNU General Public License                 |
00010         | as published by the Free Software Foundation; either version 2              |
00011         | of the License, or (at your option) any later version.                      |
00012         |                                                                             |
00013         | This program is distributed in the hope that it will be useful,             |
00014         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00015         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00016         | GNU General Public License for more details.                                |
00017         |                                                                             |
00018         | You should have received a copy of the GNU General Public License           |
00019         | along with this program; if not, write to the Free Software                 |
00020         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
00021         +-----------------------------------------------------------------------------+
00022 */
00023 
00033 include_once "./classes/class.ilObject.php";
00034 
00035 class ilObjAuthSettings extends ilObject
00036 {
00043         function ilObjAuthSettings($a_id = 0,$a_call_by_reference = true)
00044         {
00045                 $this->type = "auth";
00046                 $this->ilObject($a_id,$a_call_by_reference);
00047         }
00048         
00049         function checkAuthLDAP()
00050         {
00051                 $settings = $this->ilias->getAllSettings();
00052                 
00053                 if (!$settings["ldap_server"] or !$settings["ldap_basedn"] or !$settings["ldap_port"])
00054                 {
00055                         return false;
00056                 }
00057                 
00058                 $this->ilias->setSetting('ldap_active',true);
00059                 
00060                 return true;
00061         }
00062         
00063         function checkAuthSHIB()
00064         {
00065                 $settings = $this->ilias->getAllSettings();
00066                 
00067                 if (!$settings["hos_type"] or !$settings["shib_user_default_role"] or !$settings["shib_login"]
00068                          or !$settings["shib_firstname"]  or !$settings["shib_lastname"])
00069                 {
00070                         return false;
00071                 }
00072 
00073                 $this->ilias->setSetting('shibboleth_active',true);
00074 
00075                 return true;
00076         }
00077         
00078         function checkAuthRADIUS()
00079         {
00080                 $settings = $this->ilias->getAllSettings();
00081                 
00082                 if (!$settings["radius_server"] or !$settings["radius_shared_secret"] or !$settings["radius_port"])
00083                 {
00084                         return false;
00085                 }
00086                 
00087                 $this->ilias->setSetting('radius_active',true);
00088                 
00089                 return true;
00090         }
00091 
00092         function checkAuthScript()
00093         {
00094                 $settings = $this->ilias->getAllSettings();
00095                 
00096                 if (!$settings["auth_script_name"])
00097                 {
00098                         return false;
00099                 }
00100                 
00101                 $this->ilias->setSetting('script_active',true);
00102 
00103                 return true;
00104         }
00105 
00112         function update()
00113         {
00114                 if (!parent::update())
00115                 {                       
00116                         return false;
00117                 }
00118 
00119                 // put here object specific stuff
00120                 
00121                 return true;
00122         }
00123         
00124 
00131         function delete()
00132         {               
00133                 // always call parent delete function first!!
00134                 if (!parent::delete())
00135                 {
00136                         return false;
00137                 }
00138                 
00139                 //put here your module specific stuff
00140                 
00141                 return true;
00142         }
00143 
00153         function initDefaultRoles()
00154         {
00155                 global $rbacadmin;
00156                 
00157                 // create a local role folder
00158                 //$rfoldObj = $this->createRoleFolder("Local roles","Role Folder of forum obj_no.".$this->getId());
00159 
00160                 // create moderator role and assign role to rolefolder...
00161                 //$roleObj = $rfoldObj->createRole("Moderator","Moderator of forum obj_no.".$this->getId());
00162                 //$roles[] = $roleObj->getId();
00163 
00164                 //unset($rfoldObj);
00165                 //unset($roleObj);
00166 
00167                 return $roles ? $roles : array();
00168         }
00169 
00183         function notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params = 0)
00184         {
00185                 global $tree;
00186                 
00187                 switch ($a_event)
00188                 {
00189                         case "link":
00190                                 
00191                                 //var_dump("<pre>",$a_params,"</pre>");
00192                                 //echo "Module name ".$this->getRefId()." triggered by link event. Objects linked into target object ref_id: ".$a_ref_id;
00193                                 //exit;
00194                                 break;
00195                         
00196                         case "cut":
00197                                 
00198                                 //echo "Module name ".$this->getRefId()." triggered by cut event. Objects are removed from target object ref_id: ".$a_ref_id;
00199                                 //exit;
00200                                 break;
00201                                 
00202                         case "copy":
00203                         
00204                                 //var_dump("<pre>",$a_params,"</pre>");
00205                                 //echo "Module name ".$this->getRefId()." triggered by copy event. Objects are copied into target object ref_id: ".$a_ref_id;
00206                                 //exit;
00207                                 break;
00208 
00209                         case "paste":
00210                                 
00211                                 //echo "Module name ".$this->getRefId()." triggered by paste (cut) event. Objects are pasted into target object ref_id: ".$a_ref_id;
00212                                 //exit;
00213                                 break;
00214                         
00215                         case "new":
00216                                 
00217                                 //echo "Module name ".$this->getRefId()." triggered by paste (new) event. Objects are applied to target object ref_id: ".$a_ref_id;
00218                                 //exit;
00219                                 break;
00220                 }
00221                 
00222                 // At the beginning of the recursive process it avoids second call of the notify function with the same parameter
00223                 if ($a_node_id==$_GET["ref_id"])
00224                 {       
00225                         $parent_obj =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
00226                         $parent_type = $parent_obj->getType();
00227                         if($parent_type == $this->getType())
00228                         {
00229                                 $a_node_id = (int) $tree->getParentId($a_node_id);
00230                         }
00231                 }
00232                 
00233                 parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
00234         }
00235 } // END class.ilObjAuthSettings
00236 ?>

Generated on Fri Dec 13 2013 17:56:55 for ILIAS Release_3_9_x_branch .rev 46835 by  doxygen 1.7.1