@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | } else { |
| 161 | 161 | $this->databaseHandle->exec("INSERT INTO ownership (user_id, institution_id, blesslevel, orig_mail) VALUES(?, ?, ?, ?)", "siss", $owner, $catId, $level, $destMail); |
| 162 | 162 | } |
| 163 | - common\Logging::writeAudit_s((string) $owner, "OWN", "IdP " . $invitationDetails['cat_institution_id'] . " - added user as owner"); |
|
| 163 | + common\Logging::writeAudit_s((string) $owner, "OWN", "IdP ".$invitationDetails['cat_institution_id']." - added user as owner"); |
|
| 164 | 164 | common\Entity::outOfThePotatoes(); |
| 165 | 165 | return new IdP($invitationDetails['cat_institution_id']); |
| 166 | 166 | } |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | $idp = new IdP($fed->newIdP('TOKEN', $invitationDetails['invite_fortype'], $owner, $invitationDetails['invite_issuer_level'], $invitationDetails['invite_dest_mail'], $bestnameguess)); |
| 175 | 175 | $idp->addAttribute("general:instname", 'C', $bestnameguess); |
| 176 | 176 | } |
| 177 | - common\Logging::writeAudit_s($owner, "NEW", "IdP " . $idp->identifier . " - created from invitation"); |
|
| 177 | + common\Logging::writeAudit_s($owner, "NEW", "IdP ".$idp->identifier." - created from invitation"); |
|
| 178 | 178 | |
| 179 | 179 | // in case we have more admins in the queue which were invited to |
| 180 | 180 | // administer the same inst but haven't redeemed their invitations |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | 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']); |
| 189 | 189 | // SELECT -> resource, no boolean |
| 190 | 190 | while ($pendingDetail = mysqli_fetch_object(/** @scrutinizer ignore-type */ $otherPending)) { |
| 191 | - $this->databaseHandle->exec("UPDATE invitations SET cat_institution_id = " . $idp->identifier . " WHERE id = " . $pendingDetail->id); |
|
| 191 | + $this->databaseHandle->exec("UPDATE invitations SET cat_institution_id = ".$idp->identifier." WHERE id = ".$pendingDetail->id); |
|
| 192 | 192 | } |
| 193 | 193 | common\Entity::outOfThePotatoes(); |
| 194 | 194 | return $idp; |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | 'invite_dest_mail' => $_SESSION['auth_email'], |
| 214 | 214 | ]; |
| 215 | 215 | $idp = $this->newIdPFromExternal($extId, $fed, $invitationDetails, $owner, $externalinfo); |
| 216 | - common\Logging::writeAudit_s($owner, "NEW", "IdP " . $idp->identifier . " - created from auto-registration of $extId"); |
|
| 216 | + common\Logging::writeAudit_s($owner, "NEW", "IdP ".$idp->identifier." - created from auto-registration of $extId"); |
|
| 217 | 217 | return $idp; |
| 218 | 218 | } |
| 219 | 219 | |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | $extinfo = $cat->getExternalDBEntityDetails($externalId, $ROid); |
| 310 | 310 | $extCountry = $extinfo['country']; |
| 311 | 311 | $extType = $extinfo['type']; |
| 312 | - if(\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] === 'MSP') { |
|
| 312 | + if (\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] === 'MSP') { |
|
| 313 | 313 | $extType = \core\IdP::TYPE_SP; |
| 314 | 314 | } |
| 315 | 315 | $this->databaseHandle->exec("INSERT INTO invitations (invite_fortype, invite_issuer_level, invite_dest_mail, invite_token,name,country, external_db_uniquehandle) VALUES(?, ?, ?, ?, ?, ?, ?)", "sssssss", $extType, $level, $oneDest, $token, $instIdentifier, $extCountry, $externalId); |
@@ -338,9 +338,9 @@ discard block |
||
| 338 | 338 | $retval = []; |
| 339 | 339 | $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 |
| 340 | 340 | FROM invitations |
| 341 | - WHERE cat_institution_id " . ( $idpIdentifier != 0 ? "= $idpIdentifier" : "IS NULL") . " AND invite_created >= TIMESTAMPADD(DAY, -1, NOW()) AND used = 0"); |
|
| 341 | + WHERE cat_institution_id " . ($idpIdentifier != 0 ? "= $idpIdentifier" : "IS NULL")." AND invite_created >= TIMESTAMPADD(DAY, -1, NOW()) AND used = 0"); |
|
| 342 | 342 | // SELECT -> resource, not boolean |
| 343 | - common\Logging::debug_s(4, "Retrieving pending invitations for " . ($idpIdentifier != 0 ? "IdP $idpIdentifier" : "IdPs awaiting initial creation" ) . ".\n"); |
|
| 343 | + common\Logging::debug_s(4, "Retrieving pending invitations for ".($idpIdentifier != 0 ? "IdP $idpIdentifier" : "IdPs awaiting initial creation").".\n"); |
|
| 344 | 344 | while ($invitationQuery = mysqli_fetch_object(/** @scrutinizer ignore-type */ $invitations)) { |
| 345 | 345 | $retval[] = ["country" => $invitationQuery->country, "name" => $invitationQuery->name, "mail" => $invitationQuery->invite_dest_mail, "token" => $invitationQuery->invite_token, "expiry" => $invitationQuery->expiry]; |
| 346 | 346 | } |
@@ -411,7 +411,7 @@ discard block |
||
| 411 | 411 | // these require no further checking |
| 412 | 412 | foreach ($extInstListTmp as $country => $extInstCountryList) { |
| 413 | 413 | $len = count($extInstCountryList); |
| 414 | - for($i = 0; $i < $len; ++$i) { |
|
| 414 | + for ($i = 0; $i < $len; ++$i) { |
|
| 415 | 415 | $extInst = $extInstCountryList[$i]; |
| 416 | 416 | if ($extInst['inst_id'] != NULL && in_array($extInst['inst_id'], $this->currentInstitutions['existing'])) { |
| 417 | 417 | unset($extInstList[$country][$i]); |
@@ -497,7 +497,7 @@ discard block |
||
| 497 | 497 | $names = $disectedNames['joint']; |
| 498 | 498 | $realms = ExternalEduroamDBData::dissectCollapsedInstitutionRealms($extInst['realm']); |
| 499 | 499 | $foundMatch = $this->checkForSimilarInstitutions($names, $realms); |
| 500 | - common\Logging::debug_s(4, $foundMatch, "checkForSimilarInstitutions returned: ","\n"); |
|
| 500 | + common\Logging::debug_s(4, $foundMatch, "checkForSimilarInstitutions returned: ", "\n"); |
|
| 501 | 501 | if ($foundMatch == 0) { |
| 502 | 502 | $this->currentInstitutions['new'][] = [$extInst['external_db_id'], $disectedNames['perlang'], $country]; |
| 503 | 503 | } |
@@ -697,7 +697,7 @@ discard block |
||
| 697 | 697 | * @return string NULL - the date last seen or NULL if not recorded yet |
| 698 | 698 | */ |
| 699 | 699 | public function getAdminLastAuth($user) { |
| 700 | - $truncatedUser = substr($user,0,999); |
|
| 700 | + $truncatedUser = substr($user, 0, 999); |
|
| 701 | 701 | $result = $this->databaseHandle->exec("SELECT DATE(last_login) FROM admin_logins WHERE user_id='$truncatedUser'"); |
| 702 | 702 | if ($result->num_rows == 1) { |
| 703 | 703 | $date = $result ->fetch_row()[0]; |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | parent::__construct(); |
| 110 | 110 | common\Entity::intoThePotatoes(); |
| 111 | 111 | |
| 112 | - $this->catVersionString = sprintf("Unreleased %s Git Revision" , "<a href='https://github.com/GEANT/CAT/tree/master/Changes.md'>") . "</a>"; |
|
| 112 | + $this->catVersionString = sprintf("Unreleased %s Git Revision", "<a href='https://github.com/GEANT/CAT/tree/master/Changes.md'>")."</a>"; |
|
| 113 | 113 | |
| 114 | 114 | if (CAT::RELEASE_VERSION) { |
| 115 | 115 | $major = CAT::VERSION_MAJOR; |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | if (CAT::VERSION_EXTRA != "") { |
| 126 | 126 | $temp_version .= "-$extra"; |
| 127 | 127 | } |
| 128 | - $this->catVersionString = sprintf("Release <a href='%s'>%s</a>", "https://github.com/GEANT/CAT/tree/" . $branch . "/Changes.md", $temp_version); |
|
| 128 | + $this->catVersionString = sprintf("Release <a href='%s'>%s</a>", "https://github.com/GEANT/CAT/tree/".$branch."/Changes.md", $temp_version); |
|
| 129 | 129 | |
| 130 | 130 | } |
| 131 | 131 | $product = \config\Master::APPEARANCE['productname']; |
@@ -133,9 +133,9 @@ discard block |
||
| 133 | 133 | $maxYear = self::COPYRIGHT_MAX_YEAR; |
| 134 | 134 | $holder = self::COPYRIGHT_HOLDER; |
| 135 | 135 | $consortia = self::COPYRIGHT_CONSORTIA; |
| 136 | - $this->catCopyright = "$product - " . $this->catVersionString . " © $minYear-$maxYear $holder<br/>on behalf of $consortia; and others <a href='copyright.php'>Full Copyright and Licenses</a>"; |
|
| 136 | + $this->catCopyright = "$product - ".$this->catVersionString." © $minYear-$maxYear $holder<br/>on behalf of $consortia; and others <a href='copyright.php'>Full Copyright and Licenses</a>"; |
|
| 137 | 137 | $this->catCopyrifhtAndLicense = "© $minYear-$maxYear $holder<br/>on behalf of $consortia; and others <a href='copyright.php'>Full Copyright and Licenses</a>"; |
| 138 | - $this->catVersion = "$product<br>" . $this->catVersionString; |
|
| 138 | + $this->catVersion = "$product<br>".$this->catVersionString; |
|
| 139 | 139 | |
| 140 | 140 | /* Federations are created in DB with bootstrapFederation, and listed via listFederations |
| 141 | 141 | */ |
@@ -315,12 +315,12 @@ |
||
| 315 | 315 | } |
| 316 | 316 | |
| 317 | 317 | switch ($operationMode) { |
| 318 | - case OPERATION_MODE_SELF_ADMIN_ADD: |
|
| 319 | - case OPERATION_MODE_SELF_NEWFROMDB: |
|
| 320 | - print("SUCCESS"); |
|
| 321 | - break; |
|
| 322 | - default: |
|
| 323 | - header("Location: $redirectDestination" . $finalDestParams); |
|
| 318 | + case OPERATION_MODE_SELF_ADMIN_ADD: |
|
| 319 | + case OPERATION_MODE_SELF_NEWFROMDB: |
|
| 320 | + print("SUCCESS"); |
|
| 321 | + break; |
|
| 322 | + default: |
|
| 323 | + header("Location: $redirectDestination" . $finalDestParams); |
|
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | * <base_url>/copyright.php after deploying the software |
| 21 | 21 | */ |
| 22 | 22 | |
| 23 | -require_once dirname(dirname(dirname(__DIR__))) . "/config/_config.php"; |
|
| 23 | +require_once dirname(dirname(dirname(__DIR__)))."/config/_config.php"; |
|
| 24 | 24 | |
| 25 | 25 | $auth = new \web\lib\admin\Authentication(); |
| 26 | 26 | $auth->authenticate(); |
@@ -114,9 +114,9 @@ discard block |
||
| 114 | 114 | $idp = $validator->existingIdP($_GET['inst_id']); |
| 115 | 115 | // editing IdPs is done from within the popup. When we're done, send the |
| 116 | 116 | // user back to the popup (append the result of the operation later) |
| 117 | - $redirectDestination = "manageAdmins.inc.php?inst_id=" . $idp->identifier . "&"; |
|
| 117 | + $redirectDestination = "manageAdmins.inc.php?inst_id=".$idp->identifier."&"; |
|
| 118 | 118 | if (count($validAddresses) == 0) { |
| 119 | - header("Location: $redirectDestination" . "invitation=INVALIDSYNTAX"); |
|
| 119 | + header("Location: $redirectDestination"."invitation=INVALIDSYNTAX"); |
|
| 120 | 120 | exit(1); |
| 121 | 121 | } |
| 122 | 122 | // is the user primary admin of this IdP? |
@@ -125,12 +125,12 @@ discard block |
||
| 125 | 125 | $fedadmin = $userObject->isFederationAdmin($idp->federation); |
| 126 | 126 | // check if he is either one, if not, complain |
| 127 | 127 | if (!$is_owner && !$fedadmin) { |
| 128 | - echo "<p>" . sprintf(_("Something's wrong... you are a %s admin, but not for the %s the requested %s belongs to!"), $uiElements->nomenclatureFed, $uiElements->nomenclatureFed, $uiElements->nomenclatureParticipant) . "</p>"; |
|
| 128 | + echo "<p>".sprintf(_("Something's wrong... you are a %s admin, but not for the %s the requested %s belongs to!"), $uiElements->nomenclatureFed, $uiElements->nomenclatureFed, $uiElements->nomenclatureParticipant)."</p>"; |
|
| 129 | 129 | exit(1); |
| 130 | 130 | } |
| 131 | 131 | $prettyprintname = $idp->name; |
| 132 | 132 | $newtokens = $mgmt->createTokens($fedadmin, $validAddresses, $idp); |
| 133 | - \core\common\Logging::writeSQLAudit_s($_SESSION['user'], "NEW", "IdP " . $idp->identifier . " - Token created for " . implode(",", $validAddresses)); |
|
| 133 | + \core\common\Logging::writeSQLAudit_s($_SESSION['user'], "NEW", "IdP ".$idp->identifier." - Token created for ".implode(",", $validAddresses)); |
|
| 134 | 134 | $introtext = "CO-ADMIN"; |
| 135 | 135 | $participant_type = $idp->type; |
| 136 | 136 | break; |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | $validAddresses = [$_SESSION['auth_email']]; |
| 144 | 144 | $prettyprintname = $idp->name; |
| 145 | 145 | $newtokens = $mgmt->createTokens("FED", $validAddresses, $idp); |
| 146 | - \core\common\Logging::writeSQLAudit_s($_SESSION['user'], "NEW", "IdP (self)" . $idp->identifier . " - Token created for " . implode(",", $validAddresses)); |
|
| 146 | + \core\common\Logging::writeSQLAudit_s($_SESSION['user'], "NEW", "IdP (self)".$idp->identifier." - Token created for ".implode(",", $validAddresses)); |
|
| 147 | 147 | $participant_type = $idp->type; |
| 148 | 148 | $introtext = "SELF-ADMIN"; |
| 149 | 149 | break; |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | $participant_type = $validator->partType($_POST['participant_type']); |
| 160 | 160 | $new_idp_authorized_fedadmin = $userObject->isFederationAdmin($newcountry); |
| 161 | 161 | if ($new_idp_authorized_fedadmin !== TRUE) { |
| 162 | - throw new Exception("Something's wrong... you want to create a new " . $uiElements->nomenclatureParticipant . ", but are not a " . $uiElements->nomenclatureFed . " admin for the " . $uiElements->nomenclatureFed . " it should be in!"); |
|
| 162 | + throw new Exception("Something's wrong... you want to create a new ".$uiElements->nomenclatureParticipant.", but are not a ".$uiElements->nomenclatureFed." admin for the ".$uiElements->nomenclatureFed." it should be in!"); |
|
| 163 | 163 | } |
| 164 | 164 | $federation = $validator->existingFederation($newcountry); |
| 165 | 165 | $prettyprintname = $newinstname; |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | // send the user back to his federation overview page, append the result of the operation later |
| 168 | 168 | // do the token creation magic |
| 169 | 169 | $newtokens = $mgmt->createTokens(TRUE, $validAddresses, $newinstname, 0, $newcountry, $participant_type); |
| 170 | - \core\common\Logging::writeSQLAudit_s($_SESSION['user'], "NEW", "ORG FUTURE - Token created for $participant_type " . implode(",", $validAddresses)); |
|
| 170 | + \core\common\Logging::writeSQLAudit_s($_SESSION['user'], "NEW", "ORG FUTURE - Token created for $participant_type ".implode(",", $validAddresses)); |
|
| 171 | 171 | break; |
| 172 | 172 | case OPERATION_MODE_SELF_NEWFROMDB: |
| 173 | 173 | $validAddresses = [$_SESSION['auth_email']]; |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | $found = []; |
| 181 | 181 | foreach ($newIdPs as $allowed) { |
| 182 | 182 | \core\common\Logging::debug_s(4, $allowed, "Allowed:\n", "\n"); |
| 183 | - if (strtoupper($allowed[2]) === $fedId && $allowed[0] === $newexternalid) { |
|
| 183 | + if (strtoupper($allowed[2]) === $fedId && $allowed[0] === $newexternalid) { |
|
| 184 | 184 | $found = $allowed; |
| 185 | 185 | } |
| 186 | 186 | } |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | $prettyprintname = $name; |
| 209 | 209 | } |
| 210 | 210 | } |
| 211 | - if(\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] === 'MSP') { |
|
| 211 | + if (\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] === 'MSP') { |
|
| 212 | 212 | $participant_type = \core\IdP::TYPE_SP; |
| 213 | 213 | } else { |
| 214 | 214 | $participant_type = $extinfo['type']; |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | $introtext = "EXISTING-FED"; |
| 218 | 218 | // do the token creation magic |
| 219 | 219 | $newtokens = $mgmt->createTokens(TRUE, $validAddresses, $prettyprintname, $newexternalid, $fedId); |
| 220 | - \core\common\Logging::writeSQLAudit_s($_SESSION['user'], "NEW", "IdP FUTURE (self) - Token created for " . implode(",", $validAddresses)); |
|
| 220 | + \core\common\Logging::writeSQLAudit_s($_SESSION['user'], "NEW", "IdP FUTURE (self) - Token created for ".implode(",", $validAddresses)); |
|
| 221 | 221 | break; |
| 222 | 222 | case OPERATION_MODE_NEWFROMDB: |
| 223 | 223 | $redirectDestination = "../overview_federation.php?"; |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | $extinfo = $catInstance->getExternalDBEntityDetails($newexternalid, strtoupper($fedId).'01'); |
| 232 | 232 | $new_idp_authorized_fedadmin = $userObject->isFederationAdmin($extinfo['country']); |
| 233 | 233 | if ($new_idp_authorized_fedadmin !== TRUE) { |
| 234 | - throw new Exception("Something's wrong... you want to create a new " . $uiElements->nomenclatureParticipant . ", but are not a " . $uiElements->nomenclatureFed . " admin for the " . $uiElements->nomenclatureFed . " it should be in!"); |
|
| 234 | + throw new Exception("Something's wrong... you want to create a new ".$uiElements->nomenclatureParticipant.", but are not a ".$uiElements->nomenclatureFed." admin for the ".$uiElements->nomenclatureFed." it should be in!"); |
|
| 235 | 235 | } |
| 236 | 236 | $federation = $validator->existingFederation($extinfo['country']); |
| 237 | 237 | $newcountry = $extinfo['country']; |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | $prettyprintname = $name; |
| 251 | 251 | } |
| 252 | 252 | } |
| 253 | - if(\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] === 'MSP') { |
|
| 253 | + if (\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] === 'MSP') { |
|
| 254 | 254 | $participant_type = \core\IdP::TYPE_SP; |
| 255 | 255 | } else { |
| 256 | 256 | $participant_type = $extinfo['type']; |
@@ -259,14 +259,14 @@ discard block |
||
| 259 | 259 | $introtext = "EXISTING-FED"; |
| 260 | 260 | // do the token creation magic |
| 261 | 261 | $newtokens = $mgmt->createTokens(TRUE, $validAddresses, $prettyprintname, $newexternalid, $fedId); |
| 262 | - \core\common\Logging::writeSQLAudit_s($_SESSION['user'], "NEW", "IdP FUTURE - Token created for " . implode(",", $validAddresses)); |
|
| 262 | + \core\common\Logging::writeSQLAudit_s($_SESSION['user'], "NEW", "IdP FUTURE - Token created for ".implode(",", $validAddresses)); |
|
| 263 | 263 | break; |
| 264 | 264 | default: // includes OPERATION_MODE_INVALID |
| 265 | 265 | // second param is TRUE, so the variable *will* contain a string |
| 266 | 266 | // i.e. ignore Scrutinizer type warning later |
| 267 | 267 | $wrongcontent = print_r($_POST, TRUE); |
| 268 | 268 | echo "<pre>Wrong parameters in POST: |
| 269 | -" . htmlspecialchars(/** @scrutinizer ignore-type */ $wrongcontent) . " |
|
| 269 | +" . htmlspecialchars(/** @scrutinizer ignore-type */ $wrongcontent)." |
|
| 270 | 270 | </pre>"; |
| 271 | 271 | exit(1); |
| 272 | 272 | } |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | print("FAILURE"); |
| 298 | 298 | break; |
| 299 | 299 | default: |
| 300 | - header("Location: $redirectDestination" . "invitation=FAILURE"); |
|
| 300 | + header("Location: $redirectDestination"."invitation=FAILURE"); |
|
| 301 | 301 | exit; |
| 302 | 302 | } |
| 303 | 303 | } |
@@ -305,7 +305,7 @@ discard block |
||
| 305 | 305 | if (count($status) < count($totalSegments)) { // only a subset of mails was sent, update status |
| 306 | 306 | $finalDestParams = "invitation=PARTIAL"; |
| 307 | 307 | } |
| 308 | -$finalDestParams .= "&successcount=" . count($status); |
|
| 308 | +$finalDestParams .= "&successcount=".count($status); |
|
| 309 | 309 | if ($allEncrypted === TRUE) { |
| 310 | 310 | $finalDestParams .= "&transportsecurity=ENCRYPTED"; |
| 311 | 311 | } elseif ($allClear === TRUE) { |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | print("SUCCESS"); |
| 321 | 321 | break; |
| 322 | 322 | default: |
| 323 | - header("Location: $redirectDestination" . $finalDestParams); |
|
| 323 | + header("Location: $redirectDestination".$finalDestParams); |
|
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | ?> |
| 22 | 22 | <?php |
| 23 | -require_once dirname(dirname(dirname(dirname(__FILE__)))) . "/config/_config.php"; |
|
| 23 | +require_once dirname(dirname(dirname(dirname(__FILE__))))."/config/_config.php"; |
|
| 24 | 24 | |
| 25 | 25 | $auth = new \web\lib\admin\Authentication(); |
| 26 | 26 | $languageInstance = new \core\common\Language(); |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | default: |
| 124 | 124 | throw new Exception("Error: unknown encryption status of invitation!?!"); |
| 125 | 125 | } |
| 126 | - echo $uiElements->boxRemark(ngettext("The invitation email was sent successfully.", "All invitation emails were sent successfully.", $counter) . " " . $cryptText, _("Sent successfully.")); |
|
| 126 | + echo $uiElements->boxRemark(ngettext("The invitation email was sent successfully.", "All invitation emails were sent successfully.", $counter)." ".$cryptText, _("Sent successfully.")); |
|
| 127 | 127 | break; |
| 128 | 128 | case "FAILURE": |
| 129 | 129 | echo $uiElements->boxError(_("No invitation email could be sent!"), _("Sending failure!")); |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | default: |
| 144 | 144 | throw new Exception("Error: unknown encryption status of invitation!?!"); |
| 145 | 145 | } |
| 146 | - echo $uiElements->boxWarning(sprintf(_("Some invitation emails were sent successfully (%s in total), the others failed."), $counter) . " " . $cryptText, _("Partial success.")); |
|
| 146 | + echo $uiElements->boxWarning(sprintf(_("Some invitation emails were sent successfully (%s in total), the others failed."), $counter)." ".$cryptText, _("Partial success.")); |
|
| 147 | 147 | break; |
| 148 | 148 | case "INVALIDSYNTAX": |
| 149 | 149 | echo $uiElements->boxError(_("The invitation email address was malformed, no invitation was sent!"), _("The invitation email address was malformed, no invitation was sent!")); |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | ?> |
| 203 | 203 | </td> |
| 204 | 204 | <td> |
| 205 | - <form action='inc/manageAdmins.inc.php?inst_id=<?php echo $my_inst->identifier ?>' method='post' <?php echo ( $oneowner['ID'] != $_SESSION['user'] ? "onsubmit='popupRedirectWindow(this); return false;'" : "" ); ?> accept-charset='UTF-8'> |
|
| 205 | + <form action='inc/manageAdmins.inc.php?inst_id=<?php echo $my_inst->identifier ?>' method='post' <?php echo ($oneowner['ID'] != $_SESSION['user'] ? "onsubmit='popupRedirectWindow(this); return false;'" : ""); ?> accept-charset='UTF-8'> |
|
| 206 | 206 | <input type='hidden' name='admin_id' value='<?php echo $oneowner['ID']; ?>'></input> |
| 207 | 207 | <button type='submit' name='submitbutton' class='delete' value='<?php echo web\lib\common\FormElements::BUTTON_DELETE; ?>'><?php echo _("Delete Administrator") ?></button> |
| 208 | 208 | </form> |
@@ -226,10 +226,10 @@ discard block |
||
| 226 | 226 | $pending_invites = $mgmt->listPendingInvitations($my_inst->identifier); |
| 227 | 227 | $loggerInstance->debug(4, "Displaying pending invitations for $my_inst->identifier.\n"); |
| 228 | 228 | if (count($pending_invites) > 0) { |
| 229 | - echo "<strong>" . _("Pending invitations for this IdP") . "</strong>"; |
|
| 229 | + echo "<strong>"._("Pending invitations for this IdP")."</strong>"; |
|
| 230 | 230 | echo "<table>"; |
| 231 | 231 | foreach ($pending_invites as $invitee) { |
| 232 | - echo "<tr><td>" . $invitee['mail'] . "</td><td>" . sprintf(_("(expires %s)"), $invitee['expiry']) . "</td></tr>"; |
|
| 232 | + echo "<tr><td>".$invitee['mail']."</td><td>".sprintf(_("(expires %s)"), $invitee['expiry'])."</td></tr>"; |
|
| 233 | 233 | } |
| 234 | 234 | echo "</table>"; |
| 235 | 235 | } |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | |
| 254 | 254 | if (!$is_admin_himself) { |
| 255 | 255 | echo "<form action='inc/manageAdmins.inc.php?inst_id=$my_inst->identifier' method='post' onsubmit='popupRedirectWindow(this); return false;' accept-charset='UTF-8'> |
| 256 | - <button type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_TAKECONTROL . "'>" . sprintf(_("Take control of this %s"), $uiElements->nomenclatureParticipant) . "</button> |
|
| 256 | + <button type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_TAKECONTROL."'>".sprintf(_("Take control of this %s"), $uiElements->nomenclatureParticipant)."</button> |
|
| 257 | 257 | </form>"; |
| 258 | 258 | } |
| 259 | 259 | } |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | namespace core; |
| 23 | 23 | |
| 24 | -require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php"; |
|
| 24 | +require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php"; |
|
| 25 | 25 | |
| 26 | 26 | $instMgmt = new \core\UserManagement(); |
| 27 | 27 | $deco = new \web\lib\admin\PageDecoration(); |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | <?php echo $uiElements->infoblock($user->getAttributes(), "user", "User"); ?> |
| 114 | 114 | <tr> |
| 115 | 115 | <td> |
| 116 | - <?php echo "" . _("Unique Identifier") ?> |
|
| 116 | + <?php echo ""._("Unique Identifier") ?> |
|
| 117 | 117 | </td> |
| 118 | 118 | <td> |
| 119 | 119 | </td> |
@@ -128,14 +128,14 @@ discard block |
||
| 128 | 128 | |
| 129 | 129 | <?php |
| 130 | 130 | if (\config\Master::DB['USER']['readonly'] === FALSE) { |
| 131 | - echo "<a href='edit_user.php'><button>" . _("Edit User Details") . "</button></a>"; |
|
| 131 | + echo "<a href='edit_user.php'><button>"._("Edit User Details")."</button></a>"; |
|
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | if ($user->isFederationAdmin()) { |
| 135 | - echo "<form action='overview_federation.php' method='GET' accept-charset='UTF-8'><button type='submit'>" . sprintf(_('Click here for %s management tasks'), $uiElements->nomenclatureFed) . "</button></form>"; |
|
| 135 | + echo "<form action='overview_federation.php' method='GET' accept-charset='UTF-8'><button type='submit'>".sprintf(_('Click here for %s management tasks'), $uiElements->nomenclatureFed)."</button></form>"; |
|
| 136 | 136 | } |
| 137 | 137 | if ($user->isSuperadmin()) { |
| 138 | - echo "<form action='112365365321.php' method='GET' accept-charset='UTF-8'><button type='submit'>" . _('Click here to access the superadmin page') . "</button></form>"; |
|
| 138 | + echo "<form action='112365365321.php' method='GET' accept-charset='UTF-8'><button type='submit'>"._('Click here to access the superadmin page')."</button></form>"; |
|
| 139 | 139 | } |
| 140 | 140 | ?> |
| 141 | 141 | </div> |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | if (\config\Master::FUNCTIONALITY_LOCATIONS['CONFASSISTANT_SILVERBULLET'] == "LOCAL") { |
| 149 | 149 | $target = "https://wiki.geant.org/x/6Zg7Bw"; // Managed IdP manual |
| 150 | 150 | } |
| 151 | - $helptext = "<h3 style='display:inline;'>" . sprintf(_("(Need help? Refer to the <a href='%s'>%s administrator manual</a>)"), $target, $uiElements->nomenclatureParticipant) . "</h3>"; |
|
| 151 | + $helptext = "<h3 style='display:inline;'>".sprintf(_("(Need help? Refer to the <a href='%s'>%s administrator manual</a>)"), $target, $uiElements->nomenclatureParticipant)."</h3>"; |
|
| 152 | 152 | } else { |
| 153 | 153 | $helptext = ""; |
| 154 | 154 | } |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | // we need to run the Federation constructor |
| 158 | 158 | $cat = new \core\CAT; |
| 159 | 159 | /// first parameter: number of Identity Providers; second param is the literal configured term for 'Identity Provider' (you may or may not be able to add a plural suffix for your locale) |
| 160 | - echo "<h2>" . sprintf(ngettext("You are managing the following <span style='display:none'>%d </span>%s:", "You are managing the following <strong>%d</strong> %s:", sizeof($hasInst)), sizeof($hasInst), $uiElements->nomenclatureParticipant) . "</h2>"; |
|
| 160 | + echo "<h2>".sprintf(ngettext("You are managing the following <span style='display:none'>%d </span>%s:", "You are managing the following <strong>%d</strong> %s:", sizeof($hasInst)), sizeof($hasInst), $uiElements->nomenclatureParticipant)."</h2>"; |
|
| 161 | 161 | $instlist = []; |
| 162 | 162 | $my_idps = []; |
| 163 | 163 | $myFeds = []; |
@@ -249,14 +249,14 @@ discard block |
||
| 249 | 249 | <td> |
| 250 | 250 | <?php |
| 251 | 251 | if ($blessedUser && \config\Master::DB['INST']['readonly'] === FALSE) { |
| 252 | - echo "<div style='white-space: nowrap;'><form method='post' action='inc/manageAdmins.inc.php?inst_id=" . $the_inst->identifier . "' onsubmit='popupRedirectWindow(this); return false;' accept-charset='UTF-8'><button type='submit'>" . _("Add/Remove Administrators") . "</button></form></div>"; |
|
| 252 | + echo "<div style='white-space: nowrap;'><form method='post' action='inc/manageAdmins.inc.php?inst_id=".$the_inst->identifier."' onsubmit='popupRedirectWindow(this); return false;' accept-charset='UTF-8'><button type='submit'>"._("Add/Remove Administrators")."</button></form></div>"; |
|
| 253 | 253 | } |
| 254 | 254 | ?> |
| 255 | 255 | </td> |
| 256 | 256 | <td> <!-- danger zone --> |
| 257 | 257 | |
| 258 | 258 | <form action='edit_participant_result.php?inst_id=<?php echo $the_inst->identifier; ?>' method='post' accept-charset='UTF-8'> |
| 259 | - <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 %s, you can not recreate it yourself - you need a new invitation token from the %s administrator!"), $uiElements->nomenclatureParticipant, $uiElements->nomenclatureFed) . " " : "" ) . sprintf(_("Do you really want to delete your %s %s?"), $uiElements->nomenclatureParticipant, $the_inst->name); ?>')"><?php echo sprintf(_("Delete %s"), $uiElements->nomenclatureParticipant); ?></button> |
|
| 259 | + <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 %s, you can not recreate it yourself - you need a new invitation token from the %s administrator!"), $uiElements->nomenclatureParticipant, $uiElements->nomenclatureFed)." " : "").sprintf(_("Do you really want to delete your %s %s?"), $uiElements->nomenclatureParticipant, $the_inst->name); ?>')"><?php echo sprintf(_("Delete %s"), $uiElements->nomenclatureParticipant); ?></button> |
|
| 260 | 260 | </form> |
| 261 | 261 | <form action='edit_participant_result.php?inst_id=<?php echo $the_inst->identifier; ?>' method='post' accept-charset='UTF-8'> |
| 262 | 262 | <button class='delete' type='submit' name='submitbutton' value='<?php echo \web\lib\common\FormElements::BUTTON_FLUSH_AND_RESTART; ?>' onclick="return confirm('<?php echo sprintf(_("This action will delete all properties of the %s and start over the configuration from scratch. Do you really want to reset all settings of the %s %s?"), $uiElements->nomenclatureParticipant, $uiElements->nomenclatureParticipant, $the_inst->name); ?>')"><?php echo sprintf(_("Reset all %s settings"), $uiElements->nomenclatureParticipant); ?></button> |
@@ -271,19 +271,19 @@ discard block |
||
| 271 | 271 | </table> |
| 272 | 272 | <?php |
| 273 | 273 | } else { |
| 274 | - echo "<h2>" . sprintf(_("You are not managing any %s."), $uiElements->nomenclatureParticipant) . "</h2>"; |
|
| 274 | + echo "<h2>".sprintf(_("You are not managing any %s."), $uiElements->nomenclatureParticipant)."</h2>"; |
|
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | if (\config\Master::DB['INST']['readonly'] === FALSE) { |
| 278 | 278 | if (\config\ConfAssistant::CONSORTIUM['selfservice_registration'] === NULL) { |
| 279 | - echo "<p>" . sprintf(_("Please ask your %s administrator to invite you to become an %s administrator."), $uiElements->nomenclatureFed, $uiElements->nomenclatureParticipant) . "</p>"; |
|
| 279 | + echo "<p>".sprintf(_("Please ask your %s administrator to invite you to become an %s administrator."), $uiElements->nomenclatureFed, $uiElements->nomenclatureParticipant)."</p>"; |
|
| 280 | 280 | echo "<hr/> |
| 281 | 281 | <div style='white-space: nowrap;'> |
| 282 | 282 | <form action='action_enrollment.php' method='get' accept-charset='UTF-8'>" . |
| 283 | - sprintf(_("Did you receive an invitation token to manage an %s? Please paste it here:"), $uiElements->nomenclatureParticipant) . |
|
| 283 | + sprintf(_("Did you receive an invitation token to manage an %s? Please paste it here:"), $uiElements->nomenclatureParticipant). |
|
| 284 | 284 | " <input type='text' id='token' name='token'/> |
| 285 | 285 | <button type='submit'>" . |
| 286 | - _("Go!") . " |
|
| 286 | + _("Go!")." |
|
| 287 | 287 | </button> |
| 288 | 288 | </form> |
| 289 | 289 | </div>"; |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | echo "<tr><td>"; |
| 314 | 314 | $idp = new \core\IdP($id); |
| 315 | 315 | $names = $idp->getAttributes('general:instname'); |
| 316 | - $i =0; |
|
| 316 | + $i = 0; |
|
| 317 | 317 | foreach ($names as $onename) { |
| 318 | 318 | if ($i > 0) { |
| 319 | 319 | echo "; "; |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | ?> |
| 325 | 325 | </td><td><div> |
| 326 | 326 | <form action='inc/sendinvite.inc.php?inst_id=<?php echo $id; ?>' method='post' onsubmit='popupRedirectWindow(this); return false;' accept-charset='UTF-8'> |
| 327 | - <input type="hidden" name="mailaddr" value="<?php echo $_SESSION['auth_email'];?>"/> |
|
| 327 | + <input type="hidden" name="mailaddr" value="<?php echo $_SESSION['auth_email']; ?>"/> |
|
| 328 | 328 | <input type="hidden" name="self_registration"/> |
| 329 | 329 | <button type='submit' name='submitbutton' class='self-service' id='submintbutton_<?php echo $id; ?>' onclick='document.getElementById("spin").style.display = "block"' value='<?php echo \web\lib\common\FormElements::BUTTON_SAVE; ?>'><?php echo _("Send token"); ?></button><span style='display: none; font-weight: bold' class='token_confirm' id='token_confirm_<?php echo $id; ?>'><?php echo _("Token sent")?></span> |
| 330 | 330 | </form> |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | echo "<table class='inst-selection'>"; |
| 339 | 339 | foreach ($newInst as $inst) { |
| 340 | 340 | echo "<tr><td>"; |
| 341 | - $i =0; |
|
| 341 | + $i = 0; |
|
| 342 | 342 | foreach ($inst[1] as $lang => $name) { |
| 343 | 343 | if ($i > 0) { |
| 344 | 344 | echo "; "; |
@@ -349,7 +349,7 @@ discard block |
||
| 349 | 349 | ?> |
| 350 | 350 | </td><td><div> |
| 351 | 351 | <form action='inc/sendinvite.inc.php' method='post' accept-charset='UTF-8'> |
| 352 | - <input type="hidden" name="mailaddr" value="<?php echo $_SESSION['auth_email'];?>"/> |
|
| 352 | + <input type="hidden" name="mailaddr" value="<?php echo $_SESSION['auth_email']; ?>"/> |
|
| 353 | 353 | <input type="hidden" name="creation" value="existing"/> |
| 354 | 354 | <input type="hidden" name="self_registration"/> |
| 355 | 355 | <input type="hidden" name="country" value="<?php echo $inst[2]; ?>"/> |
@@ -367,7 +367,7 @@ discard block |
||
| 367 | 367 | $idp = new \core\IdP($entitlementInst[0]); |
| 368 | 368 | echo "<tr><th>"; |
| 369 | 369 | $names = $idp->getAttributes('general:instname'); |
| 370 | - $i =0; |
|
| 370 | + $i = 0; |
|
| 371 | 371 | foreach ($names as $onename) { |
| 372 | 372 | if ($i > 0) { |
| 373 | 373 | echo "; "; |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | } |
| 378 | 378 | echo "</th><td>"; |
| 379 | 379 | echo "<form action='inc/manageAdmins.inc.php?inst_id=$idp->identifier' method='post'>"; |
| 380 | - echo "<button type='submit' class='XXX' value='" . \web\lib\common\FormElements::BUTTON_TAKECONTROL . "'>" . _("take control"). "</button><br/>"; |
|
| 380 | + echo "<button type='submit' class='XXX' value='".\web\lib\common\FormElements::BUTTON_TAKECONTROL."'>"._("take control")."</button><br/>"; |
|
| 381 | 381 | echo "</form>"; |
| 382 | 382 | echo "</td></tr>"; |
| 383 | 383 | } |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | <div style='white-space: nowrap;'> |
| 391 | 391 | <form action='action_enrollment.php' method='get'><button type='submit' accept-charset='UTF-8'> |
| 392 | 392 | <input type='hidden' id='token' name='token' value='SELF-REGISTER'/>" . |
| 393 | - sprintf(_("New %s Registration"), $uiElements->nomenclatureParticipant) . " |
|
| 393 | + sprintf(_("New %s Registration"), $uiElements->nomenclatureParticipant)." |
|
| 394 | 394 | </button> |
| 395 | 395 | </form> |
| 396 | 396 | </div>"; |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | if ($trailerPosition !== FALSE) { |
| 143 | 143 | $base = substr($scriptself, 0, $trailerPosition); |
| 144 | 144 | if ($base !== FALSE) { |
| 145 | - $url = "//$servername" . $base . "/logout_check.php"; |
|
| 145 | + $url = "//$servername".$base."/logout_check.php"; |
|
| 146 | 146 | } |
| 147 | 147 | } |
| 148 | 148 | |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | if (!$handle instanceof \core\DBConnection) { |
| 159 | 159 | $frontendHandle = $handle; |
| 160 | 160 | } |
| 161 | - $truncatedUser = substr($user,0,999); |
|
| 161 | + $truncatedUser = substr($user, 0, 999); |
|
| 162 | 162 | $handle->exec("INSERT INTO admin_logins (user_id, last_login) VALUES ('$truncatedUser', NOW()) ON DUPLICATE KEY UPDATE last_login=NOW()"); |
| 163 | 163 | } |
| 164 | 164 | |