ILIAS  release_8 Revision v8.24
ilSOAPAuth Class Reference
+ Collaboration diagram for ilSOAPAuth:

Static Public Member Functions

static testConnection (string $a_ext_uid, string $a_soap_pw, bool $a_new_user)
 

Detailed Description

Definition at line 22 of file class.ilSOAPAuth.php.

Member Function Documentation

◆ testConnection()

static ilSOAPAuth::testConnection ( string  $a_ext_uid,
string  $a_soap_pw,
bool  $a_new_user 
)
static

Definition at line 24 of file class.ilSOAPAuth.php.

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

References $ilSetting, $namespace, ILIAS\LTI\ToolProvider\$settings, $valid, and ILIAS\Repository\int().

Referenced by ilObjAuthSettingsGUI\testSoapAuthConnectionObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: