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
00035 include_once './webservice/soap/lib/nusoap.php';
00036 include_once ("./classes/class.ilAuthUtils.php");
00037
00038 class ilSoapAdministration
00039 {
00040
00041
00042
00043
00044 var $sauth = null;
00045
00046
00047
00048
00049
00050 var $error_method = null;
00051
00052
00053 function ilSoapAdministration($use_nusoap = true)
00054 {
00055 define('USER_FOLDER_ID',7);
00056 define('NUSOAP',1);
00057 define('PHP5',2);
00058
00059 if($use_nusoap)
00060 {
00061 $this->error_method = NUSOAP;
00062 }
00063 $this->__initAuthenticationObject();
00064
00065 }
00066
00067
00068 function __checkSession($sid)
00069 {
00070 list($sid,$client) = $this->__explodeSid($sid);
00071
00072 $this->sauth->setClient($client);
00073 $this->sauth->setSid($sid);
00074
00075 if(!$this->sauth->validateSession())
00076 {
00077 return false;
00078 }
00079 return true;
00080 }
00081
00082
00083 function __explodeSid($sid)
00084 {
00085 $exploded = explode('::',$sid);
00086
00087 return is_array($exploded) ? $exploded : array('sid' => '','client' => '');
00088 }
00089
00090
00091 function __setMessage($a_str)
00092 {
00093 $this->message = $a_str;
00094 }
00095 function __getMessage()
00096 {
00097 return $this->message;
00098 }
00099 function __appendMessage($a_str)
00100 {
00101 $this->message .= isset($this->message) ? ' ' : '';
00102 $this->message .= $a_str;
00103 }
00104
00105
00106 function __initAuthenticationObject($a_auth_mode = AUTH_LOCAL)
00107 {
00108 switch($a_auth_mode)
00109 {
00110 case AUTH_CAS:
00111 include_once './webservice/soap/classes/class.ilSoapAuthenticationCAS.php';
00112 return $this->sauth = new ilSoapAuthenticationCAS();
00113
00114 default:
00115 include_once './webservice/soap/classes/class.ilSoapAuthentication.php';
00116 return $this->sauth = new ilSoapAuthentication();
00117 }
00118 }
00119
00120
00121 function __raiseError($a_message,$a_code)
00122 {
00123 switch($this->error_method)
00124 {
00125 case NUSOAP:
00126
00127 return new soap_fault($a_code,'',$a_message);
00128 }
00129 }
00130
00131
00132 }
00133 ?>