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
00033 include_once 'Auth/Auth.php';
00034 include_once './classes/class.ilBaseAuthentication.php';
00035
00036 class ilSoapAuthentication extends ilBaseAuthentication
00037 {
00038 function ilSoapAuthentication()
00039 {
00040 parent::ilBaseAuthentication();
00041 $this->__setMessageCode('Client');
00042 }
00043
00044 function authenticate()
00045 {
00046 if(!$this->getClient())
00047 {
00048 $this->__setMessage('No client given');
00049 return false;
00050 }
00051 if(!$this->getUsername())
00052 {
00053 $this->__setMessage('No username given');
00054 return false;
00055 }
00056
00057 if(!$this->__buildAuth())
00058 {
00059 return false;
00060 }
00061 if(!$this->__setSessionSaveHandler())
00062 {
00063 return false;
00064 }
00065 if(!$this->__checkSOAPEnabled())
00066 {
00067 $this->__setMessage('SOAP is not enabled in ILIAS administration for this client');
00068 $this->__setMessageCode('Server');
00069
00070 return false;
00071 }
00072
00073
00074 $this->auth->start();
00075
00076 if(!$this->auth->getAuth())
00077 {
00078 $this->__getAuthStatus();
00079
00080 return false;
00081 }
00082
00083 $this->setSid(session_id());
00084
00085 return true;
00086 }
00087
00088
00089 function validateSession()
00090 {
00091 if(!$this->getClient())
00092 {
00093 $this->__setMessage('No client given');
00094 return false;
00095 }
00096 if(!$this->getSid())
00097 {
00098 $this->__setMessage('No session id given');
00099 return false;
00100 }
00101
00102 if(!$this->__buildAuth())
00103 {
00104 return false;
00105 }
00106 if(!$this->__setSessionSaveHandler())
00107 {
00108 return false;
00109 }
00110 if(!$this->__checkSOAPEnabled())
00111 {
00112 $this->__setMessage('SOAP is not enabled in ILIAS administration for this client');
00113 $this->__setMessageCode('Server');
00114
00115 return false;
00116 }
00117 $this->auth->start();
00118 if(!$this->auth->getAuth())
00119 {
00120 $this->__setMessage('Session not valid');
00121
00122 return false;
00123 }
00124
00125 return true;
00126 }
00127
00128
00129 function __checkSOAPEnabled()
00130 {
00131 include_once './classes/class.ilDBx.php';
00132
00133
00134 $db =& new ilDBx($this->dsn);
00135
00136 $query = "SELECT * FROM settings WHERE keyword = 'soap_user_administration' AND value = 1";
00137
00138 $res = $db->query($query);
00139
00140 return $res->numRows() ? true : false;
00141 }
00142 }
00143 ?>