|
@@ -25,7 +25,7 @@ discard block |
|
|
block discarded – undo |
|
25
|
25
|
* FIX for v2.2.1 : introduce better type-safety for admin API - reported by: Nahit (Github: https://github.com/Dogru-Isim) |
|
26
|
26
|
*/ |
|
27
|
27
|
|
|
28
|
|
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php"; |
|
|
28
|
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php"; |
|
29
|
29
|
|
|
30
|
30
|
// no SAML auth on this page. The API key authenticates the entity |
|
31
|
31
|
|
|
@@ -43,7 +43,7 @@ discard block |
|
|
block discarded – undo |
|
43
|
43
|
|
|
44
|
44
|
$inputDecoded = json_decode($inputRaw, TRUE); |
|
45
|
45
|
if (!is_array($inputDecoded)) { |
|
46
|
|
- $adminApi->returnError(web\lib\admin\API::ERROR_MALFORMED_REQUEST, "Unable to decode JSON POST data." . json_last_error_msg() . $inputRaw); |
|
|
46
|
+ $adminApi->returnError(web\lib\admin\API::ERROR_MALFORMED_REQUEST, "Unable to decode JSON POST data.".json_last_error_msg().$inputRaw); |
|
47
|
47
|
exit(1); |
|
48
|
48
|
} |
|
49
|
49
|
|
|
@@ -144,7 +144,7 @@ discard block |
|
|
block discarded – undo |
|
144
|
144
|
throw new Exception("A required parameter is missing, and this wasn't caught earlier?!"); |
|
145
|
145
|
} |
|
146
|
146
|
$newtokens = $mgmt->createTokens(true, [$admin], $idp); |
|
147
|
|
- $URL = "https://" . $_SERVER['SERVER_NAME'] . dirname($_SERVER['SCRIPT_NAME']) . "/action_enrollment.php?token=" . array_keys($newtokens)[0]; |
|
|
147
|
+ $URL = "https://".$_SERVER['SERVER_NAME'].dirname($_SERVER['SCRIPT_NAME'])."/action_enrollment.php?token=".array_keys($newtokens)[0]; |
|
148
|
148
|
$success = ["TOKEN URL" => $URL, "TOKEN" => array_keys($newtokens)[0]]; |
|
149
|
149
|
// done with the essentials - display in response. But if we also have an email address, send it there |
|
150
|
150
|
$email = $adminApi->firstParameterInstance($scrubbedParameters, web\lib\admin\API::AUXATTRIB_TARGETMAIL); |
|
@@ -181,7 +181,7 @@ discard block |
|
|
block discarded – undo |
|
181
|
181
|
if ($found) { |
|
182
|
182
|
$adminApi->returnSuccess([]); |
|
183
|
183
|
} |
|
184
|
|
- $adminApi->returnError(web\lib\admin\API::ERROR_INVALID_PARAMETER, "The admin with ID $toBeDeleted is not associated to IdP " . $idp->identifier); |
|
|
184
|
+ $adminApi->returnError(web\lib\admin\API::ERROR_INVALID_PARAMETER, "The admin with ID $toBeDeleted is not associated to IdP ".$idp->identifier); |
|
185
|
185
|
break; |
|
186
|
186
|
case web\lib\admin\API::ACTION_STATISTICS_FED: |
|
187
|
187
|
$detail = $adminApi->firstParameterInstance($scrubbedParameters, web\lib\admin\API::AUXATTRIB_DETAIL); |
|
@@ -286,10 +286,10 @@ discard block |
|
|
block discarded – undo |
|
286
|
286
|
$outer = ""; |
|
287
|
287
|
$profile->setAnonymousIDSupport(FALSE); |
|
288
|
288
|
} else { |
|
289
|
|
- $outer = $outer . "@"; |
|
|
289
|
+ $outer = $outer."@"; |
|
290
|
290
|
$profile->setAnonymousIDSupport(TRUE); |
|
291
|
291
|
} |
|
292
|
|
- $profile->setRealm($outer . $realm); |
|
|
292
|
+ $profile->setRealm($outer.$realm); |
|
293
|
293
|
} |
|
294
|
294
|
/* const AUXATTRIB_PROFILE_TESTUSER = 'ATTRIB-PROFILE-TESTUSER'; */ |
|
295
|
295
|
$testuser = $adminApi->firstParameterInstance($scrubbedParameters, web\lib\admin\API::AUXATTRIB_PROFILE_TESTUSER); |
|
@@ -536,7 +536,7 @@ discard block |
|
|
block discarded – undo |
|
536
|
536
|
// extract relevant subset of information from cert objects |
|
537
|
537
|
$certDetails = []; |
|
538
|
538
|
foreach ($certs as $cert) { |
|
539
|
|
- $certDetails[$cert->ca_type . ":" . $cert->serial] = ["ISSUED" => $cert->issued, "EXPIRY" => $cert->expiry, "STATUS" => $cert->status, "DEVICE" => $cert->device, "CN" => $cert->username, "ANNOTATION" => $cert->annotation]; |
|
|
539
|
+ $certDetails[$cert->ca_type.":".$cert->serial] = ["ISSUED" => $cert->issued, "EXPIRY" => $cert->expiry, "STATUS" => $cert->status, "DEVICE" => $cert->device, "CN" => $cert->username, "ANNOTATION" => $cert->annotation]; |
|
540
|
540
|
} |
|
541
|
541
|
$adminApi->returnSuccess($certDetails); |
|
542
|
542
|
break; |