23 : string
24 {
26
28
29 $server_hostname = (string) ($settings['soap_auth_server'] ?? '');
30 $server_port = (
int) ($settings[
'soap_auth_port'] ?? 0);
31 $server_uri = (string) ($settings['soap_auth_uri'] ?? '');
32 $namespace = (string) ($settings[
'soap_auth_namespace'] ??
'');
33 $use_dotnet = (bool) ($settings['soap_auth_use_dotnet'] ?? false);
34 $uri = 'http://';
35 if (isset($settings['soap_auth_use_https']) && $settings['soap_auth_use_https']) {
36 $uri = 'https://';
37 }
38
39 $uri .= $server_hostname;
40
41 if ($server_port > 0) {
42 $uri .= ':' . $server_port;
43 }
44
45 if ($server_uri !== '') {
46 $uri .= '/' . $server_uri;
47 }
48
49 require_once __DIR__ . '/../../soap/lib/nusoap.php';
51 if ($err = $soap_client->getError()) {
52 return 'SOAP Authentication Initialisation Error: ' . $err;
53 }
54
55 $soapAction = '';
56 $nspref = '';
57 if ($use_dotnet) {
59 $nspref = 'ns1:';
60 }
61
62 $valid = $soap_client->call(
63 'isValidSession',
64 [
65 $nspref . 'ext_uid' => $a_ext_uid,
66 $nspref . 'soap_pw' => $a_soap_pw,
67 $nspref . 'new_user' => $a_new_user
68 ],
70 $soapAction
71 );
72
73 return
74 '<br>== Request ==' .
75 '<br><pre>' . htmlspecialchars(str_replace('" ', "\"\n ", str_replace('>', ">\n", $soap_client->request)), ENT_QUOTES) . '</pre><br>' .
76 '<br>== Response ==' .
77 '<br>Valid: -' .
$valid[
'valid'] .
'-' .
78 '<br><pre>' . htmlspecialchars(str_replace('" ', "\"\n ", str_replace('>', ">\n", $soap_client->response)), ENT_QUOTES) . '</pre>';
79 }
[nu]soapclient higher level class for easy usage.
if($err=$client->getError()) $namespace