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

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 
00034 require_once "class.ilObject.php";
00035 
00036 class ilObjAuthSettings extends ilObject
00037 {
00044         function ilObjAuthSettings($a_id = 0,$a_call_by_reference = true)
00045         {
00046                 $this->type = "auth";
00047                 $this->ilObject($a_id,$a_call_by_reference);
00048         }
00049         
00050         function checkAuthLDAP()
00051         {
00052                 $settings = $this->ilias->getAllSettings();
00053                 
00054                 if (!$settings["ldap_server"] or !$settings["ldap_basedn"] or !$settings["ldap_port"])
00055                 {
00056                         return false;
00057                 }
00058                 
00059                 $this->ilias->setSetting('ldap_active',true);
00060                 
00061                 return true;
00062         }
00063         
00064         function checkAuthSHIB()
00065         {
00066                 $settings = $this->ilias->getAllSettings();
00067                 
00068                 if (!$settings["shib_only"] or !$settings["shib_user_default_role"] or !$settings["shib_login"]
00069                          or !$settings["shib_firstname"]  or !$settings["shib_lastname"])
00070                 {
00071                         return false;
00072                 }
00073 
00074                 $this->ilias->setSetting('shibboleth_active',true);
00075 
00076                 return true;
00077         }
00078         
00079         function checkAuthRADIUS()
00080         {
00081                 $settings = $this->ilias->getAllSettings();
00082                 
00083                 if (!$settings["radius_server"] or !$settings["radius_shared_secret"] or !$settings["radius_port"])
00084                 {
00085                         return false;
00086                 }
00087                 
00088                 $this->ilias->setSetting('radius_active',true);
00089                 
00090                 return true;
00091         }
00092 
00093         function checkAuthScript()
00094         {
00095                 $settings = $this->ilias->getAllSettings();
00096                 
00097                 if (!$settings["auth_script_name"])
00098                 {
00099                         return false;
00100                 }
00101                 
00102                 $this->ilias->setSetting('script_active',true);
00103 
00104                 return true;
00105         }
00106 
00113         function update()
00114         {
00115                 if (!parent::update())
00116                 {                       
00117                         return false;
00118                 }
00119 
00120                 // put here object specific stuff
00121                 
00122                 return true;
00123         }
00124         
00132         function ilClone($a_parent_ref)
00133         {               
00134                 global $rbacadmin;
00135 
00136                 // always call parent clone function first!!
00137                 $new_ref_id = parent::ilClone($a_parent_ref);
00138                 
00139                 // get object instance of cloned object
00140                 //$newObj =& $this->ilias->obj_factory->getInstanceByRefId($new_ref_id);
00141 
00142                 // create a local role folder & default roles
00143                 //$roles = $newObj->initDefaultRoles();
00144 
00145                 // ...finally assign role to creator of object
00146                 //$rbacadmin->assignUser($roles[0], $newObj->getOwner(), "n");          
00147 
00148                 // always destroy objects in clone method because clone() is recursive and creates instances for each object in subtree!
00149                 //unset($newObj);
00150 
00151                 // ... and finally always return new reference ID!!
00152                 return $new_ref_id;
00153         }
00154 
00161         function delete()
00162         {               
00163                 // always call parent delete function first!!
00164                 if (!parent::delete())
00165                 {
00166                         return false;
00167                 }
00168                 
00169                 //put here your module specific stuff
00170                 
00171                 return true;
00172         }
00173 
00183         function initDefaultRoles()
00184         {
00185                 global $rbacadmin;
00186                 
00187                 // create a local role folder
00188                 //$rfoldObj = $this->createRoleFolder("Local roles","Role Folder of forum obj_no.".$this->getId());
00189 
00190                 // create moderator role and assign role to rolefolder...
00191                 //$roleObj = $rfoldObj->createRole("Moderator","Moderator of forum obj_no.".$this->getId());
00192                 //$roles[] = $roleObj->getId();
00193 
00194                 //unset($rfoldObj);
00195                 //unset($roleObj);
00196 
00197                 return $roles ? $roles : array();
00198         }
00199 
00213         function notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params = 0)
00214         {
00215                 global $tree;
00216                 
00217                 switch ($a_event)
00218                 {
00219                         case "link":
00220                                 
00221                                 //var_dump("<pre>",$a_params,"</pre>");
00222                                 //echo "Module name ".$this->getRefId()." triggered by link event. Objects linked into target object ref_id: ".$a_ref_id;
00223                                 //exit;
00224                                 break;
00225                         
00226                         case "cut":
00227                                 
00228                                 //echo "Module name ".$this->getRefId()." triggered by cut event. Objects are removed from target object ref_id: ".$a_ref_id;
00229                                 //exit;
00230                                 break;
00231                                 
00232                         case "copy":
00233                         
00234                                 //var_dump("<pre>",$a_params,"</pre>");
00235                                 //echo "Module name ".$this->getRefId()." triggered by copy event. Objects are copied into target object ref_id: ".$a_ref_id;
00236                                 //exit;
00237                                 break;
00238 
00239                         case "paste":
00240                                 
00241                                 //echo "Module name ".$this->getRefId()." triggered by paste (cut) event. Objects are pasted into target object ref_id: ".$a_ref_id;
00242                                 //exit;
00243                                 break;
00244                         
00245                         case "new":
00246                                 
00247                                 //echo "Module name ".$this->getRefId()." triggered by paste (new) event. Objects are applied to target object ref_id: ".$a_ref_id;
00248                                 //exit;
00249                                 break;
00250                 }
00251                 
00252                 // At the beginning of the recursive process it avoids second call of the notify function with the same parameter
00253                 if ($a_node_id==$_GET["ref_id"])
00254                 {       
00255                         $parent_obj =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
00256                         $parent_type = $parent_obj->getType();
00257                         if($parent_type == $this->getType())
00258                         {
00259                                 $a_node_id = (int) $tree->getParentId($a_node_id);
00260                         }
00261                 }
00262                 
00263                 parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
00264         }
00265 } // END class.ilObjAuthSettings
00266 ?>

Generated on Fri Dec 13 2013 10:18:27 for ILIAS Release_3_5_x_branch .rev 46805 by  doxygen 1.7.1