@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | <div class='infobox' style='text-align:center;'> |
57 | 57 | <h2><?php echo sprintf(_("QR Code for %s download area"), $uiElements->nomenclature_inst); ?></h2> |
58 | 58 | <?php |
59 | - $displayurl = ( isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on" ? 'https://' : 'http://') . $_SERVER['SERVER_NAME'] . dirname(dirname($_SERVER['SCRIPT_NAME'])) . "?idp=" . $my_inst->identifier; |
|
59 | + $displayurl = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on" ? 'https://' : 'http://') . $_SERVER['SERVER_NAME'] . dirname(dirname($_SERVER['SCRIPT_NAME'])) . "?idp=" . $my_inst->identifier; |
|
60 | 60 | $uri = "data:image/png;base64," . base64_encode($uiElements->pngInjectConsortiumLogo(QRcode::png($displayurl, FALSE, QR_ECLEVEL_Q, QRCODE_PIXELS_PER_SYMBOL), QRCODE_PIXELS_PER_SYMBOL)); |
61 | 61 | $size = getimagesize($uri); |
62 | 62 | echo "<img width='" . ($size[0] / 4) . "' height='" . ($size[1] / 4) . "' src='$uri' alt='QR-code'/>"; |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | </td> |
94 | 94 | <td> |
95 | 95 | <form action='edit_idp_result.php?inst_id=<?php echo $my_inst->identifier; ?>' method='post' accept-charset='UTF-8'> |
96 | - <button class='delete' type='submit' name='submitbutton' value='<?php echo web\lib\common\FormElements::BUTTON_DELETE; ?>' onclick="return confirm('<?php echo ( CONFIG_CONFASSISTANT['CONSORTIUM']['selfservice_registration'] === NULL ? sprintf(_("After deleting the IdP, you can not recreate it yourself - you need a new invitation token from the %s administrator!"), $uiElements->nomenclature_fed) . " " : "" ) . sprintf(_("Do you really want to delete your %s %s?"), $uiElements->nomenclature_inst, $my_inst->name); ?>')"><?php echo sprintf(_("Delete %s"), $uiElements->nomenclature_inst); ?></button> |
|
96 | + <button class='delete' type='submit' name='submitbutton' value='<?php echo web\lib\common\FormElements::BUTTON_DELETE; ?>' onclick="return confirm('<?php echo (CONFIG_CONFASSISTANT['CONSORTIUM']['selfservice_registration'] === NULL ? sprintf(_("After deleting the IdP, you can not recreate it yourself - you need a new invitation token from the %s administrator!"), $uiElements->nomenclature_fed) . " " : "") . sprintf(_("Do you really want to delete your %s %s?"), $uiElements->nomenclature_inst, $my_inst->name); ?>')"><?php echo sprintf(_("Delete %s"), $uiElements->nomenclature_inst); ?></button> |
|
97 | 97 | </form> |
98 | 98 | |
99 | 99 | </td> |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | if ($readonly === FALSE) { |
182 | 182 | ?> |
183 | 183 | <form action='edit_silverbullet.php?inst_id=<?php echo $my_inst->identifier; ?>&profile_id=<?php echo $profile_list->identifier; ?>' method='POST'> |
184 | - <button <?php echo ( is_array($completeness) ? "disabled" : "" ); ?> type='submit' name='sb_action' value='sb_edit'><?php echo _("Manage User Base"); ?></button> |
|
184 | + <button <?php echo (is_array($completeness) ? "disabled" : ""); ?> type='submit' name='sb_action' value='sb_edit'><?php echo _("Manage User Base"); ?></button> |
|
185 | 185 | </form> |
186 | 186 | <?php |
187 | 187 | } |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | if (isset($URL['device-specific:redirect'])) { |
316 | 316 | $displayurl = $URL['device-specific:redirect'][0]; |
317 | 317 | } else { |
318 | - $displayurl = ( isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on" ? 'https://' : 'http://') . $_SERVER['SERVER_NAME'] . dirname(dirname($_SERVER['SCRIPT_NAME'])) . "?idp=" . $my_inst->identifier . "&profile=" . $profile_list->identifier; |
|
318 | + $displayurl = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on" ? 'https://' : 'http://') . $_SERVER['SERVER_NAME'] . dirname(dirname($_SERVER['SCRIPT_NAME'])) . "?idp=" . $my_inst->identifier . "&profile=" . $profile_list->identifier; |
|
319 | 319 | } |
320 | 320 | echo "<a href='$displayurl' style='white-space: nowrap; text-align: center;'>"; |
321 | 321 | $uri = "data:image/png;base64," . base64_encode($uiElements->pngInjectConsortiumLogo(QRcode::png($displayurl, FALSE, QR_ECLEVEL_Q, QRCODE_PIXELS_PER_SYMBOL), QRCODE_PIXELS_PER_SYMBOL)); |
@@ -98,7 +98,7 @@ |
||
98 | 98 | $country[$key] = $row['country']; |
99 | 99 | $name[$key] = $row['name']; |
100 | 100 | } |
101 | - echo "<tr><th>" . sprintf(_("%s Name"), $uiElements->nomenclature_inst) . "</th><th>" . sprintf(_("Other admins of this %s"), $uiElements->nomenclature_inst) . "</th><th>" . ( CONFIG['DB']['INST']['readonly'] === FALSE ? _("Administrator Management") : "") . "</th></tr>"; |
|
101 | + echo "<tr><th>" . sprintf(_("%s Name"), $uiElements->nomenclature_inst) . "</th><th>" . sprintf(_("Other admins of this %s"), $uiElements->nomenclature_inst) . "</th><th>" . (CONFIG['DB']['INST']['readonly'] === FALSE ? _("Administrator Management") : "") . "</th></tr>"; |
|
102 | 102 | foreach ($myFeds as $fed_id => $fed_name) { |
103 | 103 | echo "<tr><td colspan='3'><strong>" . sprintf(_("%s %s: %s list"), $uiElements->nomenclature_fed, $fed_name, $uiElements->nomenclature_inst) . "</strong></td></tr>"; |
104 | 104 |
@@ -28,7 +28,7 @@ |
||
28 | 28 | 'mailer', |
29 | 29 | ]; |
30 | 30 | |
31 | -if (CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_SILVERBULLET'] == "LOCAL" || CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_RADIUS'] == "LOCAL" ) { |
|
31 | +if (CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_SILVERBULLET'] == "LOCAL" || CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_RADIUS'] == "LOCAL") { |
|
32 | 32 | $Tests[] = 'makensis'; |
33 | 33 | $Tests[] = 'makensis=>NSISmodules'; |
34 | 34 | } |
@@ -216,7 +216,7 @@ |
||
216 | 216 | * realm (and indirectly that of the links and statuses of involved proxies |
217 | 217 | * and returns a judgment whether external Monitoring API tests are warranted |
218 | 218 | * or not |
219 | - * @return boolean TRUE if external tests have to be run |
|
219 | + * @return boolean|null TRUE if external tests have to be run |
|
220 | 220 | */ |
221 | 221 | private function CATInternalTests() { |
222 | 222 | // we are expecting to get a REJECT from all runs, because that means the packet got through to the IdP. |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | <th>Device</th> |
119 | 119 | <th>Admin Downloads</th> |
120 | 120 | <th>User Downloads (classic)</th> |
121 | - <th>User Downloads (<?php echo \core\ProfileSilverbullet::PRODUCTNAME;?>)</th> |
|
121 | + <th>User Downloads (<?php echo \core\ProfileSilverbullet::PRODUCTNAME; ?>)</th> |
|
122 | 122 | <th>User Downloads (total)</th> |
123 | 123 | </tr> |
124 | 124 | <?php |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | $admin_query = $dbHandle->exec("SELECT SUM(downloads_admin) AS admin, SUM(downloads_user) AS user, SUM(downloads_silverbullet) as silverbullet FROM downloads WHERE device_id = '$index'"); |
131 | 131 | // SELECT -> mysqli_result, not boolean |
132 | 132 | while ($a = mysqli_fetch_object(/** @scrutinizer ignore-type */ $admin_query)) { |
133 | - echo "<td>" . $device_array['display'] . "</td><td>" . $a->admin . "</td><td>" . $a->user . "</td><td>" . $a->silverbullet . "</td><td>" . sprintf("%s",$a->user + $a->silverbullet) . "</td>"; |
|
133 | + echo "<td>" . $device_array['display'] . "</td><td>" . $a->admin . "</td><td>" . $a->user . "</td><td>" . $a->silverbullet . "</td><td>" . sprintf("%s", $a->user + $a->silverbullet) . "</td>"; |
|
134 | 134 | $gross_admin = $gross_admin + $a->admin; |
135 | 135 | $gross_user = $gross_user + $a->user; |
136 | 136 | $gross_silverbullet = $gross_silverbullet + $a->silverbullet; |
@@ -254,7 +254,7 @@ |
||
254 | 254 | * create a CSR |
255 | 255 | * |
256 | 256 | * @param resource $privateKey the private key to create the CSR with |
257 | - * @return array with the CSR and some meta info |
|
257 | + * @return integer with the CSR and some meta info |
|
258 | 258 | */ |
259 | 259 | private function generateCsr($privateKey) { |
260 | 260 | // token leads us to the NRO, to set the OU property of the cert |
@@ -455,7 +455,7 @@ |
||
455 | 455 | $indexStatement = "$certstatus\t$expiryIndexTxt\t" . ($certstatus == "R" ? "$nowIndexTxt,unspecified" : "") . "\t$serialHex\tunknown\t/O=" . CONFIG_CONFASSISTANT['CONSORTIUM']['name'] . "/OU=$federation/CN=$cn/emailAddress=$cn\n"; |
456 | 456 | $logHandle->debug(4, "index.txt contents-to-be: $indexStatement"); |
457 | 457 | if (!file_put_contents($tempdir . "/index.txt", $indexStatement)) { |
458 | - $logHandle->debug(1,"Unable to write openssl index.txt file for revocation handling!"); |
|
458 | + $logHandle->debug(1, "Unable to write openssl index.txt file for revocation handling!"); |
|
459 | 459 | } |
460 | 460 | // index.txt.attr is dull but needs to exist |
461 | 461 | file_put_contents($tempdir . "/index.txt.attr", "unique_subject = yes\n"); |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | case "core\User": |
115 | 115 | return $this->userName; |
116 | 116 | default: |
117 | - throw new Exception("Operating on a class where we don't know the relevant identifier in the DB - ".get_class($this)."!"); |
|
117 | + throw new Exception("Operating on a class where we don't know the relevant identifier in the DB - " . get_class($this) . "!"); |
|
118 | 118 | } |
119 | 119 | } |
120 | 120 | |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | $handle = DBConnection::handle("INST"); |
246 | 246 | $blobQuery = $handle->exec("SELECT option_value from $table WHERE row = $row"); |
247 | 247 | // SELECT -> returns resource, not boolean |
248 | - while ($returnedData = /** @scrutinizer ignore-type */ mysqli_fetch_object($blobQuery)) { |
|
248 | + while ($returnedData = /** @scrutinizer ignore-type */ mysqli_fetch_object($blobQuery)) { |
|
249 | 249 | $blob = $returnedData->option_value; |
250 | 250 | } |
251 | 251 | if (!isset($blob)) { |
@@ -549,7 +549,7 @@ |
||
549 | 549 | if (count($logoAttribute) == 0) { |
550 | 550 | return(NULL); |
551 | 551 | } |
552 | - $this->loggerInstance->debug(4,"RESIZE:$width:$height\n"); |
|
552 | + $this->loggerInstance->debug(4, "RESIZE:$width:$height\n"); |
|
553 | 553 | $meta = $this->processImage($logoAttribute[0]['value'], $logoFile, $width, $height, $resize); |
554 | 554 | $filetype = $meta['filetype']; |
555 | 555 | $expiresString = $meta['expires']; |
@@ -138,6 +138,7 @@ discard block |
||
138 | 138 | * |
139 | 139 | * @param string $device |
140 | 140 | * @param AbstractProfile $profile |
141 | + * @param string $generatedFor |
|
141 | 142 | * @return array info about the new installer (mime and link) |
142 | 143 | */ |
143 | 144 | private function generateNewInstaller($device, $profile, $generatedFor, $token, $password) { |
@@ -327,6 +328,7 @@ discard block |
||
327 | 328 | * @param string either 'idp' or 'federation' is allowed |
328 | 329 | * @param int $width maximum width of the generated image - if 0 then it is treated as no upper bound |
329 | 330 | * @param int $height maximum height of the generated image - if 0 then it is treated as no upper bound |
331 | + * @param string $type |
|
330 | 332 | * @return array|null array with image information or NULL if there is no logo |
331 | 333 | */ |
332 | 334 | protected function getLogo($identifier, $type, $width = 0, $height = 0) { |
@@ -371,6 +373,10 @@ discard block |
||
371 | 373 | return ["filetype" => $filetype, "expires" => $expiresString, "blob" => $blob]; |
372 | 374 | } |
373 | 375 | |
376 | + /** |
|
377 | + * @param integer $width |
|
378 | + * @param integer $height |
|
379 | + */ |
|
374 | 380 | private function testForResize($width, $height) { |
375 | 381 | if (is_numeric($width) && is_numeric($height) && ($width > 0 || $height > 0)) { |
376 | 382 | if ($height == 0) { |
@@ -474,6 +480,7 @@ discard block |
||
474 | 480 | /** |
475 | 481 | * Order active identity providers according to their distance and name |
476 | 482 | * @param array $currentLocation - current location |
483 | + * @param string $country |
|
477 | 484 | * @return array $IdPs - list of arrays ('id', 'name'); |
478 | 485 | */ |
479 | 486 | public function orderIdentityProviders($country, $currentLocation = NULL) { |
@@ -396,14 +396,14 @@ |
||
396 | 396 | } |
397 | 397 | |
398 | 398 | /** |
399 | - * Lists all identity providers in the database |
|
400 | - * adding information required by DiscoJuice. |
|
401 | - * |
|
402 | - * @param int $activeOnly if set to non-zero will cause listing of only those institutions which have some valid profiles defined. |
|
403 | - * @param string $country if set, only list IdPs in a specific country |
|
404 | - * @return array the list of identity providers |
|
405 | - * |
|
406 | - */ |
|
399 | + * Lists all identity providers in the database |
|
400 | + * adding information required by DiscoJuice. |
|
401 | + * |
|
402 | + * @param int $activeOnly if set to non-zero will cause listing of only those institutions which have some valid profiles defined. |
|
403 | + * @param string $country if set, only list IdPs in a specific country |
|
404 | + * @return array the list of identity providers |
|
405 | + * |
|
406 | + */ |
|
407 | 407 | public function listAllIdentityProviders($activeOnly = 0, $country = "") { |
408 | 408 | return(IdPlist::listAllIdentityProviders($activeOnly, $country)); |
409 | 409 | } |
@@ -124,7 +124,7 @@ |
||
124 | 124 | * @return string |
125 | 125 | */ |
126 | 126 | private function zipInstaller($attr) { |
127 | - if (count($attr)==0) { |
|
127 | + if (count($attr) == 0) { |
|
128 | 128 | // never mind, just checking. You CAN use the $attr array to extract |
129 | 129 | // information about the IdP/Profile if there's a need |
130 | 130 | } |