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

webservice/soap/classes/class.ilSoapAuthenticationLDAP.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003 +-----------------------------------------------------------------------------+
00004 | ILIAS open source                                                           |
00005 +-----------------------------------------------------------------------------+
00006 | Copyright (c) 1998-2006 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 
00024 
00034 include_once './webservice/soap/classes/class.ilSoapAuthentication.php';
00035 
00036 class ilSoapAuthenticationLDAP extends ilSOAPAuthentication
00037 {
00038         function ilSoapAuthenticationLDAP()
00039         {
00040                 parent::ilSOAPAuthentication();
00041         }
00042 
00043 
00044 
00045         function __buildAuth()
00046         {
00047                 global $ilAuth;
00048                 $_POST['auth_mode'] = AUTH_LDAP;
00049                 
00050                 include_once("./Services/Init/classes/class.ilInitialisation.php");
00051                 $init = new ilInitialisation();
00052                 $init->initILIAS("soap");               
00053                 $this->auth = $ilAuth;
00054                 return true;
00055         }
00056         
00057         function authenticate()
00058         {
00059                 if(!$this->getClient())
00060                 {
00061                         $this->__setMessage('No client given');
00062                         return false;
00063                 }
00064                 if(!$this->getUsername())
00065                 {
00066                         $this->__setMessage('No username given');
00067                         return false;
00068                 }
00069                 // Read ilias ini
00070                 if(!$this->__buildDSN())
00071                 {
00072                         $this->__setMessage('Error building dsn/Wrong client Id?');
00073                         return false;
00074                 }
00075                 if(!$this->__setSessionSaveHandler())
00076                 {
00077                         return false;
00078                 }
00079                 if(!$this->__checkAgreement('ldap'))
00080                 {
00081                         return false;
00082                 }
00083 
00084                 if(!$this->__buildAuth())
00085                 {
00086                         return false;
00087                 }
00088 
00089                 if(!$this->auth->getAuth())
00090                 {
00091                         $this->__getAuthStatus();
00092 
00093                         return false;
00094                 }
00095 
00096                 $this->setSid(session_id());
00097 
00098                 return true;
00099         }
00100 
00101 }
00102 ?>

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