@@ -30,7 +30,7 @@ |
||
30 | 30 | final public function __construct() { |
31 | 31 | parent::__construct(); |
32 | 32 | $this->setSupportedEapMethods([\core\common\EAP::EAPTYPE_NONE]); |
33 | - $this->loggerInstance->debug(4,"RedirectEx called"); |
|
33 | + $this->loggerInstance->debug(4, "RedirectEx called"); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
@@ -58,8 +58,8 @@ discard block |
||
58 | 58 | parent::__construct(); |
59 | 59 | $Dev = \devices\Devices::listDevices(); |
60 | 60 | if (isset($Dev[$blueprint])) { |
61 | - $this->loggerInstance->debug(4, "loaded: devices/" . $Dev[$blueprint]['directory'] . "/" . $Dev[$blueprint]['module'] . ".php\n"); |
|
62 | - $class_name = "\devices\\".$Dev[$blueprint]['directory']."\Device" . $Dev[$blueprint]['module']; |
|
61 | + $this->loggerInstance->debug(4, "loaded: devices/".$Dev[$blueprint]['directory']."/".$Dev[$blueprint]['module'].".php\n"); |
|
62 | + $class_name = "\devices\\".$Dev[$blueprint]['directory']."\Device".$Dev[$blueprint]['module']; |
|
63 | 63 | $this->device = new $class_name(); |
64 | 64 | if (!$this->device) { |
65 | 65 | $this->loggerInstance->debug(2, "module loading failed"); |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | } else { |
69 | 69 | print("unknown devicename:$blueprint\n"); |
70 | 70 | } |
71 | - $this->device->module_path = ROOT . '/devices/' . $Dev[$blueprint]['directory']; |
|
71 | + $this->device->module_path = ROOT.'/devices/'.$Dev[$blueprint]['directory']; |
|
72 | 72 | $this->device->signer = isset($Dev[$blueprint]['signer']) ? $Dev[$blueprint]['signer'] : 0; |
73 | 73 | $this->device->device_id = $blueprint; |
74 | 74 | $options = \devices\Devices::$Options; |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | } else { |
147 | 147 | $this->databaseHandle->exec("INSERT INTO ownership (user_id, institution_id, blesslevel, orig_mail) VALUES(?, ?, ?, ?)", "siss", $owner, $catId, $level, $destMail); |
148 | 148 | } |
149 | - $this->loggerInstance->writeAudit((string) $owner, "OWN", "IdP " . $invitationDetails->cat_institution_id . " - added user as owner"); |
|
149 | + $this->loggerInstance->writeAudit((string) $owner, "OWN", "IdP ".$invitationDetails->cat_institution_id." - added user as owner"); |
|
150 | 150 | common\Entity::outOfThePotatoes(); |
151 | 151 | return new IdP($invitationDetails->cat_institution_id); |
152 | 152 | } |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | $idp = new IdP($fed->newIdP($invitationDetails->invite_fortype, $owner, $invitationDetails->invite_issuer_level, $invitationDetails->invite_dest_mail, $bestnameguess)); |
169 | 169 | } |
170 | 170 | $idp->addAttribute("general:instname", 'C', $bestnameguess); |
171 | - $this->loggerInstance->writeAudit($owner, "NEW", "IdP " . $idp->identifier . " - created from invitation"); |
|
171 | + $this->loggerInstance->writeAudit($owner, "NEW", "IdP ".$idp->identifier." - created from invitation"); |
|
172 | 172 | |
173 | 173 | // in case we have more admins in the queue which were invited to |
174 | 174 | // administer the same inst but haven't redeemed their invitations |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | WHERE invite_created >= TIMESTAMPADD(DAY, -1, NOW()) AND used = 0 AND name = ? AND country = ? AND ( cat_institution_id IS NULL OR external_db_uniquehandle IS NULL ) ", "ss", $invitationDetails->name, $invitationDetails->country); |
183 | 183 | // SELECT -> resource, no boolean |
184 | 184 | while ($pendingDetail = mysqli_fetch_object(/** @scrutinizer ignore-type */ $otherPending)) { |
185 | - $this->databaseHandle->exec("UPDATE invitations SET cat_institution_id = " . $idp->identifier . " WHERE id = " . $pendingDetail->id); |
|
185 | + $this->databaseHandle->exec("UPDATE invitations SET cat_institution_id = ".$idp->identifier." WHERE id = ".$pendingDetail->id); |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | common\Entity::outOfThePotatoes(); |
@@ -281,9 +281,9 @@ discard block |
||
281 | 281 | $retval = []; |
282 | 282 | $invitations = $this->databaseHandle->exec("SELECT cat_institution_id, country, name, invite_issuer_level, invite_dest_mail, invite_token , TIMESTAMPADD(DAY, 1, invite_created) as expiry |
283 | 283 | FROM invitations |
284 | - WHERE cat_institution_id " . ( $idpIdentifier != 0 ? "= $idpIdentifier" : "IS NULL") . " AND invite_created >= TIMESTAMPADD(DAY, -1, NOW()) AND used = 0"); |
|
284 | + WHERE cat_institution_id " . ($idpIdentifier != 0 ? "= $idpIdentifier" : "IS NULL")." AND invite_created >= TIMESTAMPADD(DAY, -1, NOW()) AND used = 0"); |
|
285 | 285 | // SELECT -> resource, not boolean |
286 | - $this->loggerInstance->debug(4, "Retrieving pending invitations for " . ($idpIdentifier != 0 ? "IdP $idpIdentifier" : "IdPs awaiting initial creation" ) . ".\n"); |
|
286 | + $this->loggerInstance->debug(4, "Retrieving pending invitations for ".($idpIdentifier != 0 ? "IdP $idpIdentifier" : "IdPs awaiting initial creation").".\n"); |
|
287 | 287 | while ($invitationQuery = mysqli_fetch_object(/** @scrutinizer ignore-type */ $invitations)) { |
288 | 288 | $retval[] = ["country" => $invitationQuery->country, "name" => $invitationQuery->name, "mail" => $invitationQuery->invite_dest_mail, "token" => $invitationQuery->invite_token, "expiry" => $invitationQuery->expiry]; |
289 | 289 | } |
@@ -35,7 +35,7 @@ |
||
35 | 35 | <div id="user_page" style="display:block"> |
36 | 36 | <?php echo $divs->divPagetitle("eduroam CAT Copyright and Licensing", ""); ?> |
37 | 37 | <div style="padding:20px"> |
38 | - <?php require dirname(dirname(__DIR__)) . "/copyright.inc.php"; ?> |
|
38 | + <?php require dirname(dirname(__DIR__))."/copyright.inc.php"; ?> |
|
39 | 39 | </div> |
40 | 40 | </div> |
41 | 41 | </div> |
@@ -43,10 +43,10 @@ discard block |
||
43 | 43 | $operatingSystem = $Gui->detectOS(); |
44 | 44 | $Gui->loggerInstance->debug(4, $operatingSystem); |
45 | 45 | if ($operatingSystem) { |
46 | - print "recognisedOS = '" . $operatingSystem['device'] . "';\n"; |
|
46 | + print "recognisedOS = '".$operatingSystem['device']."';\n"; |
|
47 | 47 | } |
48 | 48 | |
49 | -print 'downloadMessage = "' . $Gui->textTemplates->templates[\web\lib\user\DOWNLOAD_MESSAGE] . '";'; |
|
49 | +print 'downloadMessage = "'.$Gui->textTemplates->templates[\web\lib\user\DOWNLOAD_MESSAGE].'";'; |
|
50 | 50 | //TODO modify this based on OS detection |
51 | 51 | $userAgent = $_SERVER['HTTP_USER_AGENT'] ?? ""; |
52 | 52 | if (preg_match('/Android/', $userAgent)) { |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | <?php echo $divs->divHeading($visibility); ?> |
76 | 76 | <div id="main_page"> |
77 | 77 | <div id="loading_ico"> |
78 | - <?php echo _("Authenticating") . "..." ?><br><img src="<?php echo $Gui->skinObject->findResourceUrl("IMAGES", "icons/loading51.gif"); ?>" alt="Authenticating ..."/> |
|
78 | + <?php echo _("Authenticating")."..." ?><br><img src="<?php echo $Gui->skinObject->findResourceUrl("IMAGES", "icons/loading51.gif"); ?>" alt="Authenticating ..."/> |
|
79 | 79 | </div> |
80 | 80 | <div id="info_overlay"> <!-- device info --> |
81 | 81 | <div id="info_window"></div> |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | nsArray::Set Delete_files "GEANTLink-ARM64.msi" |
93 | 93 | File "GEANTLink-ARM64.msi" |
94 | 94 | IfSilent +2 |
95 | - MessageBox MB_OK "<?php WindowsCommon::echoNsis( _("An additional piece of software 'GEANTlink' needs to be installed. This installation requires Administrator rights; you will be prompted to give permission for that action."))?>" |
|
95 | + MessageBox MB_OK "<?php WindowsCommon::echoNsis(_("An additional piece of software 'GEANTlink' needs to be installed. This installation requires Administrator rights; you will be prompted to give permission for that action."))?>" |
|
96 | 96 | !insertmacro debug_cat 1 "Run GEANTLink installer" |
97 | 97 | !insertmacro debug_cat 3 'Execute: msiexec.exe /i "$OUTDIR\GEANTLink-$Platform.msi" REBOOT=Supress' |
98 | 98 | ClearErrors |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | Pop $rebootRequired |
105 | 105 | ${Else} |
106 | 106 | IfSilent +2 |
107 | - MessageBox MB_OK "<?php WindowsCommon::echoNsis( _("Error installing GEANTLink.\$\\nEmbedded installer didn't complete succesfully."))?>" |
|
107 | + MessageBox MB_OK "<?php WindowsCommon::echoNsis(_("Error installing GEANTLink.\$\\nEmbedded installer didn't complete succesfully."))?>" |
|
108 | 108 | Quit |
109 | 109 | ${EndIf} |
110 | 110 | Cont2: |
@@ -88,24 +88,24 @@ discard block |
||
88 | 88 | $reqAuthenticator = random_bytes(16); |
89 | 89 | $packetIdentifier = random_bytes(1); |
90 | 90 | // construct Status-Server packet |
91 | - $prePacket = RFC5997Tests::PACKET_TYPE_STATUS_SERVER . |
|
92 | - $packetIdentifier . |
|
93 | - RFC5997Tests::PACKET_LENGTH . |
|
94 | - $reqAuthenticator . |
|
95 | - RFC5997Tests::ATTRIBUTE_NAS_IDENTIFIER . |
|
96 | - RFC5997Tests::LENGTH_NAS_IDENTIFIER . |
|
91 | + $prePacket = RFC5997Tests::PACKET_TYPE_STATUS_SERVER. |
|
92 | + $packetIdentifier. |
|
93 | + RFC5997Tests::PACKET_LENGTH. |
|
94 | + $reqAuthenticator. |
|
95 | + RFC5997Tests::ATTRIBUTE_NAS_IDENTIFIER. |
|
96 | + RFC5997Tests::LENGTH_NAS_IDENTIFIER. |
|
97 | 97 | RFC5997Tests::VALUE_NAS_IDENTIFIER; |
98 | - $sigPacket = $prePacket . |
|
99 | - RFC5997Tests::ATTRIBUTE_MESSAGE_AUTHENTICATOR . |
|
100 | - RFC5997Tests::LENGTH_MESSAGE_AUTHENTICATOR . |
|
98 | + $sigPacket = $prePacket. |
|
99 | + RFC5997Tests::ATTRIBUTE_MESSAGE_AUTHENTICATOR. |
|
100 | + RFC5997Tests::LENGTH_MESSAGE_AUTHENTICATOR. |
|
101 | 101 | "\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0"; |
102 | - $authPacket = $prePacket . |
|
103 | - RFC5997Tests::ATTRIBUTE_MESSAGE_AUTHENTICATOR . |
|
104 | - RFC5997Tests::LENGTH_MESSAGE_AUTHENTICATOR . |
|
102 | + $authPacket = $prePacket. |
|
103 | + RFC5997Tests::ATTRIBUTE_MESSAGE_AUTHENTICATOR. |
|
104 | + RFC5997Tests::LENGTH_MESSAGE_AUTHENTICATOR. |
|
105 | 105 | hash_hmac("md5", $sigPacket, $this->secret, TRUE); |
106 | 106 | $connectErrorNumber = 0; |
107 | 107 | $connectErrorString = ""; |
108 | - $netHandle = fsockopen("udp://" . $this->ipAddr, $this->port, $connectErrorNumber, $connectErrorString, RFC5997Tests::CONNECTION_TIMEOUT); |
|
108 | + $netHandle = fsockopen("udp://".$this->ipAddr, $this->port, $connectErrorNumber, $connectErrorString, RFC5997Tests::CONNECTION_TIMEOUT); |
|
109 | 109 | if ($netHandle === FALSE) { |
110 | 110 | throw new Exception("Unable to establish UDP socket resource. Error number was $connectErrorNumber, '$connectErrorString'"); |
111 | 111 | } |
@@ -123,11 +123,11 @@ discard block |
||
123 | 123 | return AbstractTest::RETVAL_INVALID; |
124 | 124 | } |
125 | 125 | // check the response authenticator to prevent spoofing. |
126 | - $sigResponse = RFC5997Tests::PACKET_TYPE_ACCESS_ACCEPT . |
|
127 | - $packetIdentifier . |
|
128 | - $read[2] . $read[3] . |
|
129 | - $reqAuthenticator . |
|
130 | - substr($read, 20) . |
|
126 | + $sigResponse = RFC5997Tests::PACKET_TYPE_ACCESS_ACCEPT. |
|
127 | + $packetIdentifier. |
|
128 | + $read[2].$read[3]. |
|
129 | + $reqAuthenticator. |
|
130 | + substr($read, 20). |
|
131 | 131 | $this->secret; |
132 | 132 | $expected = hash("md5", $sigResponse, TRUE); |
133 | 133 | if ($expected != substr($read, 4, 16)) { |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | $invitationObject = new SilverbulletInvitation($token); |
196 | 196 | $profile = new ProfileSilverbullet($invitationObject->profile); |
197 | 197 | $inst = new IdP($profile->institution); |
198 | - $loggerInstance->debug(5, "tokenStatus: done, got " . $invitationObject->invitationTokenStatus . ", " . $invitationObject->profile . ", " . $invitationObject->userId . ", " . $invitationObject->expiry . ", " . $invitationObject->invitationTokenString . "\n"); |
|
198 | + $loggerInstance->debug(5, "tokenStatus: done, got ".$invitationObject->invitationTokenStatus.", ".$invitationObject->profile.", ".$invitationObject->userId.", ".$invitationObject->expiry.", ".$invitationObject->invitationTokenString."\n"); |
|
199 | 199 | if ($invitationObject->invitationTokenStatus != SilverbulletInvitation::SB_TOKENSTATUS_VALID && $invitationObject->invitationTokenStatus != SilverbulletInvitation::SB_TOKENSTATUS_PARTIALLY_REDEEMED) { |
200 | 200 | throw new Exception("Attempt to generate a SilverBullet installer with an invalid/redeemed/expired token. The user should never have gotten that far!"); |
201 | 201 | } |
@@ -208,12 +208,12 @@ discard block |
||
208 | 208 | throw new Exception("Despite a valid token, the corresponding user was not found in database or database query error!"); |
209 | 209 | } |
210 | 210 | $expiryObject = mysqli_fetch_object(/** @scrutinizer ignore-type */ $userrow); |
211 | - $loggerInstance->debug(5, "EXP: " . $expiryObject->expiry . "\n"); |
|
211 | + $loggerInstance->debug(5, "EXP: ".$expiryObject->expiry."\n"); |
|
212 | 212 | $expiryDateObject = date_create_from_format("Y-m-d H:i:s", $expiryObject->expiry); |
213 | 213 | if ($expiryDateObject === FALSE) { |
214 | 214 | throw new Exception("The expiry date we got from the DB is bogus!"); |
215 | 215 | } |
216 | - $loggerInstance->debug(5, $expiryDateObject->format("Y-m-d H:i:s") . "\n"); |
|
216 | + $loggerInstance->debug(5, $expiryDateObject->format("Y-m-d H:i:s")."\n"); |
|
217 | 217 | // date_create with no parameters can't fail, i.e. is never FALSE |
218 | 218 | $validity = date_diff(/** @scrutinizer ignore-type */ date_create(), $expiryDateObject); |
219 | 219 | $expiryDays = $validity->days + 1; |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | $certString = ""; |
252 | 252 | openssl_x509_export($cert, $certString); |
253 | 253 | $parsedCert = $x509->processCertificate($certString); |
254 | - $loggerInstance->debug(5, "CERTINFO: " . print_r($parsedCert['full_details'], true)); |
|
254 | + $loggerInstance->debug(5, "CERTINFO: ".print_r($parsedCert['full_details'], true)); |
|
255 | 255 | $realExpiryDate = date_create_from_format("U", $parsedCert['full_details']['validTo_time_t'])->format("Y-m-d H:i:s"); |
256 | 256 | |
257 | 257 | // store new cert info in DB |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | $username = ""; |
299 | 299 | while ($usernameIsUnique === FALSE) { |
300 | 300 | $usernameLocalPart = common\Entity::randomString(64 - 1 - strlen($realm), "0123456789abcdefghijklmnopqrstuvwxyz"); |
301 | - $username = $usernameLocalPart . "@" . $realm; |
|
301 | + $username = $usernameLocalPart."@".$realm; |
|
302 | 302 | $uniquenessQuery = $databaseHandle->exec("SELECT cn from silverbullet_certificate WHERE cn = ? AND ca_type = ?", "ss", $username, $certtype); |
303 | 303 | // SELECT -> resource, not boolean |
304 | 304 | if (mysqli_num_rows(/** @scrutinizer ignore-type */ $uniquenessQuery) == 0) { |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | "eduroamCAT", |
378 | 378 | "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>", |
379 | 379 | "<a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>", |
380 | - "<a target='_blank' href='eduroamCAT-stable.apk'>" . _("as local download") . "</a>"), |
|
380 | + "<a target='_blank' href='eduroamCAT-stable.apk'>"._("as local download")."</a>"), |
|
381 | 381 | ], |
382 | 382 | ], |
383 | 383 | 'android_pie' => [ |
@@ -392,7 +392,7 @@ discard block |
||
392 | 392 | "eduroamCAT", |
393 | 393 | "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>", |
394 | 394 | "<a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>", |
395 | - "<a target='_blank' href='eduroamCAT-stable.apk'>" . _("as local download") . "</a>"), |
|
395 | + "<a target='_blank' href='eduroamCAT-stable.apk'>"._("as local download")."</a>"), |
|
396 | 396 | ], |
397 | 397 | ], |
398 | 398 | 'android_oreo' => [ |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | "eduroamCAT", |
408 | 408 | "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>", |
409 | 409 | "<a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>", |
410 | - "<a target='_blank' href='eduroamCAT-stable.apk'>" . _("as local download") . "</a>"), |
|
410 | + "<a target='_blank' href='eduroamCAT-stable.apk'>"._("as local download")."</a>"), |
|
411 | 411 | ], |
412 | 412 | ], |
413 | 413 | 'android_nougat' => [ |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | "eduroamCAT", |
423 | 423 | "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>", |
424 | 424 | "<a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>", |
425 | - "<a target='_blank' href='eduroamCAT-stable.apk'>" . _("as local download") . "</a>"), |
|
425 | + "<a target='_blank' href='eduroamCAT-stable.apk'>"._("as local download")."</a>"), |
|
426 | 426 | ], |
427 | 427 | ], |
428 | 428 | 'android_marshmallow' => [ |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | "eduroamCAT", |
438 | 438 | "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>", |
439 | 439 | "<a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>", |
440 | - "<a target='_blank' href='eduroamCAT-stable.apk'>" . _("as local download") . "</a>"), |
|
440 | + "<a target='_blank' href='eduroamCAT-stable.apk'>"._("as local download")."</a>"), |
|
441 | 441 | ], |
442 | 442 | ], |
443 | 443 | 'android_lollipop' => [ |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | "eduroamCAT", |
453 | 453 | "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>", |
454 | 454 | "<a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>", |
455 | - "<a target='_blank' href='eduroamCAT-stable.apk'>" . _("as local download") . "</a>"), |
|
455 | + "<a target='_blank' href='eduroamCAT-stable.apk'>"._("as local download")."</a>"), |
|
456 | 456 | ], |
457 | 457 | ], |
458 | 458 | 'android_kitkat' => [ |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | "eduroamCAT", |
468 | 468 | "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>", |
469 | 469 | "<a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>", |
470 | - "<a target='_blank' href='eduroamCAT-stable.apk'>" . _("as local download") . "</a>"), |
|
470 | + "<a target='_blank' href='eduroamCAT-stable.apk'>"._("as local download")."</a>"), |
|
471 | 471 | ], |
472 | 472 | ], |
473 | 473 | 'android_43' => [ |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | "eduroamCAT", |
483 | 483 | "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>", |
484 | 484 | "<a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>", |
485 | - "<a target='_blank' href='eduroamCAT-stable.apk'>" . _("as local download") . "</a>"), |
|
485 | + "<a target='_blank' href='eduroamCAT-stable.apk'>"._("as local download")."</a>"), |
|
486 | 486 | ], |
487 | 487 | ], |
488 | 488 | 'android_legacy' => [ |