Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
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
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 ?>