ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilSoapAuthenticationLDAP.php
Go to the documentation of this file.
1 <?php
2 /*
3 +-----------------------------------------------------------------------------+
4 | ILIAS open source |
5 +-----------------------------------------------------------------------------+
6 | Copyright (c) 1998-2006 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 
24 
34 include_once './webservice/soap/classes/class.ilSoapAuthentication.php';
35 
37 {
39  {
40  parent::ilSOAPAuthentication();
41  }
42 
43 
44 
45  function __buildAuth()
46  {
47  global $ilAuth;
48  $_POST['auth_mode'] = AUTH_LDAP;
49 
50  include_once("./Services/Init/classes/class.ilInitialisation.php");
51  $init = new ilInitialisation();
52  $init->initILIAS("soap");
53  $this->auth = $ilAuth;
54  return true;
55  }
56 
57  function authenticate()
58  {
59  if(!$this->getClient())
60  {
61  $this->__setMessage('No client given');
62  return false;
63  }
64  if(!$this->getUsername())
65  {
66  $this->__setMessage('No username given');
67  return false;
68  }
69  // Read ilias ini
70  if(!$this->__buildDSN())
71  {
72  $this->__setMessage('Error building dsn/Wrong client Id?');
73  return false;
74  }
75  if(!$this->__setSessionSaveHandler())
76  {
77  return false;
78  }
79  if(!$this->__checkAgreement('ldap'))
80  {
81  return false;
82  }
83 
84  if(!$this->__buildAuth())
85  {
86  return false;
87  }
88 
89  if(!$this->auth->getAuth())
90  {
91  $this->__getAuthStatus();
92 
93  return false;
94  }
95 
96  $this->setSid(session_id());
97 
98  return true;
99  }
100 
101 }
102 ?>