@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | $telepath = new \core\diag\Telepath($givenRealm); |
| 109 | 109 | $outerUser = $telepath->getOuter(); |
| 110 | 110 | } |
| 111 | - $testsuite = new \core\diag\RADIUSTests($givenRealm, $outerUser . '@' . $givenRealm); |
|
| 111 | + $testsuite = new \core\diag\RADIUSTests($givenRealm, $outerUser.'@'.$givenRealm); |
|
| 112 | 112 | |
| 113 | 113 | $naptr = $rfc7585suite->relevantNAPTR(); |
| 114 | 114 | if ($naptr != \core\diag\RADIUSTests::RETVAL_NOTCONFIGURED && $naptr > 0) { |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | $json_data = json_encode($returnArray); |
| 207 | 207 | |
| 208 | 208 | if ($token) { |
| 209 | - $loggerInstance->debug(4, 'JSON data written to ' .$jsonDir.'/'.$token); |
|
| 209 | + $loggerInstance->debug(4, 'JSON data written to '.$jsonDir.'/'.$token); |
|
| 210 | 210 | file_put_contents($jsonDir.'/'.$token.'/realm', $json_data); |
| 211 | 211 | } |
| 212 | 212 | header("Content-type: application/json; utf-8"); |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | $serverCandidates[IdPlist::geoDistance($adminLocation, ['lat' => $iterator->location_lat, 'lon' => $iterator->location_lon])] = $iterator->server_id; |
| 317 | 317 | } |
| 318 | 318 | if ($clients > $maxSupportedClients * 0.9) { |
| 319 | - $this->loggerInstance->debug(1, "A RADIUS server for Managed SP (" . $iterator->server_id . ") is serving at more than 90% capacity!"); |
|
| 319 | + $this->loggerInstance->debug(1, "A RADIUS server for Managed SP (".$iterator->server_id.") is serving at more than 90% capacity!"); |
|
| 320 | 320 | } |
| 321 | 321 | } |
| 322 | 322 | if (count($serverCandidates) == 0 && $federation != "DEFAULT") { |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | */ |
| 341 | 341 | private function createTLScredentials() |
| 342 | 342 | { |
| 343 | - $clientName = "SP_" . $this->identifier . '-' . $this->institution; |
|
| 343 | + $clientName = "SP_".$this->identifier.'-'.$this->institution; |
|
| 344 | 344 | $dn = array( |
| 345 | 345 | "organizationName" => "eduroam", |
| 346 | 346 | "organizationalUnitName" => "eduroam Managed SP", |
@@ -354,13 +354,13 @@ discard block |
||
| 354 | 354 | openssl_pkey_export($privkey, $this->radsec_priv); |
| 355 | 355 | // Generate a certificate signing request |
| 356 | 356 | $csr = openssl_csr_new($dn, $privkey, |
| 357 | - array('digest_alg' => 'sha256', 'config' => ROOT . "/config/ManagedSPCerts/openssl.cnf")); |
|
| 357 | + array('digest_alg' => 'sha256', 'config' => ROOT."/config/ManagedSPCerts/openssl.cnf")); |
|
| 358 | 358 | // get CA certificate and private key |
| 359 | - $caprivkey = array(file_get_contents(ROOT . "/config/ManagedSPCerts/eduroamSP-CA.key"), |
|
| 359 | + $caprivkey = array(file_get_contents(ROOT."/config/ManagedSPCerts/eduroamSP-CA.key"), |
|
| 360 | 360 | \config\Master::MANAGEDSP['capass']); |
| 361 | - $cacert = file_get_contents(ROOT . "/config/ManagedSPCerts/eduroamSP-CA.pem"); |
|
| 361 | + $cacert = file_get_contents(ROOT."/config/ManagedSPCerts/eduroamSP-CA.pem"); |
|
| 362 | 362 | $clientcert = openssl_csr_sign($csr, $cacert, $caprivkey, \config\Master::MANAGEDSP['daystoexpiry'], |
| 363 | - array('digest_alg'=>'sha256', 'config' => ROOT . "/config/ManagedSPCerts/openssl.cnf"), rand()); |
|
| 363 | + array('digest_alg'=>'sha256', 'config' => ROOT."/config/ManagedSPCerts/openssl.cnf"), rand()); |
|
| 364 | 364 | openssl_x509_export($clientcert, $this->radsec_cert); |
| 365 | 365 | } |
| 366 | 366 | /** |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | $conditional1 = "AND activity_time > DATE_SUB(NOW(), INTERVAL $backlog SECOND)"; |
| 386 | 386 | $conditional2 = ""; |
| 387 | 387 | } |
| 388 | - $stats = $this->databaseHandle->exec("SELECT activity_time, realm, mac, cui, result, ap_id FROM activity WHERE operatorname = ? $conditional1 ORDER BY activity_time $conditional2", "s", $opName ); |
|
| 388 | + $stats = $this->databaseHandle->exec("SELECT activity_time, realm, mac, cui, result, ap_id FROM activity WHERE operatorname = ? $conditional1 ORDER BY activity_time $conditional2", "s", $opName); |
|
| 389 | 389 | return mysqli_fetch_all($stats, \MYSQLI_ASSOC); |
| 390 | 390 | } |
| 391 | 391 | |
@@ -505,7 +505,7 @@ discard block |
||
| 505 | 505 | { |
| 506 | 506 | $customAttrib = $this->getAttributes("managedsp:operatorname"); |
| 507 | 507 | if (count($customAttrib) == 0) { |
| 508 | - return "1sp." . $this->identifier . "-" . $this->institution . \config\ConfAssistant::SILVERBULLET['realm_suffix']; |
|
| 508 | + return "1sp.".$this->identifier."-".$this->institution.\config\ConfAssistant::SILVERBULLET['realm_suffix']; |
|
| 509 | 509 | } |
| 510 | 510 | return $customAttrib[0]["value"]; |
| 511 | 511 | } |
@@ -520,13 +520,13 @@ discard block |
||
| 520 | 520 | private function sendToRADIUS(int $idx, $post) |
| 521 | 521 | { |
| 522 | 522 | $hostname = "radius_hostname_$idx"; |
| 523 | - $ch = curl_init("http://" . $this->$hostname . ':8080'); |
|
| 523 | + $ch = curl_init("http://".$this->$hostname.':8080'); |
|
| 524 | 524 | if ($ch === FALSE) { |
| 525 | 525 | $res = 'FAILURE'; |
| 526 | 526 | } else { |
| 527 | 527 | curl_setopt($ch, CURLOPT_POST, 1); |
| 528 | 528 | curl_setopt($ch, CURLOPT_POSTFIELDS, $post); |
| 529 | - $this->loggerInstance->debug(1, "Posting to http://" . $this->$hostname . ":8080/$post\n"); |
|
| 529 | + $this->loggerInstance->debug(1, "Posting to http://".$this->$hostname.":8080/$post\n"); |
|
| 530 | 530 | curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); |
| 531 | 531 | curl_setopt($ch, CURLOPT_HEADER, 0); |
| 532 | 532 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
@@ -565,19 +565,19 @@ discard block |
||
| 565 | 565 | } else { |
| 566 | 566 | $txt = $remove ? _('Profile deactivation failed') : _('Profile activation/modification failed'); |
| 567 | 567 | } |
| 568 | - $txt = $txt . ' '; |
|
| 568 | + $txt = $txt.' '; |
|
| 569 | 569 | if (array_count_values($response)[$status] == 2) { |
| 570 | - $txt = $txt . _('on both RADIUS servers: primary and backup') . '.'; |
|
| 570 | + $txt = $txt._('on both RADIUS servers: primary and backup').'.'; |
|
| 571 | 571 | } else { |
| 572 | 572 | if ($response['res[1]'] == $status) { |
| 573 | - $txt = $txt . _('on primary RADIUS server') . '.'; |
|
| 573 | + $txt = $txt._('on primary RADIUS server').'.'; |
|
| 574 | 574 | } else { |
| 575 | - $txt = $txt . _('on backup RADIUS server') . '.'; |
|
| 575 | + $txt = $txt._('on backup RADIUS server').'.'; |
|
| 576 | 576 | } |
| 577 | 577 | } |
| 578 | 578 | $mail = \core\common\OutsideComm::mailHandle(); |
| 579 | 579 | $email = $this->getAttributes("support:email")[0]['value']; |
| 580 | - $mail->FromName = \config\Master::APPEARANCE['productname'] . " Notification System"; |
|
| 580 | + $mail->FromName = \config\Master::APPEARANCE['productname']." Notification System"; |
|
| 581 | 581 | $mail->addAddress($email); |
| 582 | 582 | if ($status == 'OK') { |
| 583 | 583 | $mail->Subject = _('RADIUS profile update problem fixed'); |
@@ -611,7 +611,7 @@ discard block |
||
| 611 | 611 | return NULL; |
| 612 | 612 | } |
| 613 | 613 | $timeout = 10; |
| 614 | - curl_setopt($ch, CURLOPT_URL, 'http://' . $host); |
|
| 614 | + curl_setopt($ch, CURLOPT_URL, 'http://'.$host); |
|
| 615 | 615 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
| 616 | 616 | curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); |
| 617 | 617 | curl_exec($ch); |
@@ -703,41 +703,41 @@ discard block |
||
| 703 | 703 | { |
| 704 | 704 | $remove = ($this->status == \core\AbstractDeployment::INACTIVE) ? 0 : 1; |
| 705 | 705 | $toPost = ($onlyone ? array($onlyone => '') : array(1 => '', 2 => '')); |
| 706 | - $toPostTemplate = 'instid=' . $this->institution . '&deploymentid=' . $this->identifier . |
|
| 707 | - '&secret=' . $this->secret . |
|
| 708 | - '&country=' . $this->getAttributes("internal:country")[0]['value'] . |
|
| 709 | - '&pskkey=' . $this->pskkey . '&'; |
|
| 706 | + $toPostTemplate = 'instid='.$this->institution.'&deploymentid='.$this->identifier. |
|
| 707 | + '&secret='.$this->secret. |
|
| 708 | + '&country='.$this->getAttributes("internal:country")[0]['value']. |
|
| 709 | + '&pskkey='.$this->pskkey.'&'; |
|
| 710 | 710 | if ($remove) { |
| 711 | - $toPostTemplate = $toPostTemplate . 'remove=1&'; |
|
| 711 | + $toPostTemplate = $toPostTemplate.'remove=1&'; |
|
| 712 | 712 | } else { |
| 713 | - $toPostTemplate = $toPostTemplate . 'operatorname=' . $this->getOperatorName() . '&'; |
|
| 713 | + $toPostTemplate = $toPostTemplate.'operatorname='.$this->getOperatorName().'&'; |
|
| 714 | 714 | if ($this->getAttributes("managedsp:vlan")[0]['value'] ?? NULL) { |
| 715 | 715 | $allRealms = $this->getAllRealms(); |
| 716 | 716 | if (!empty($allRealms)) { |
| 717 | - $toPostTemplate = $toPostTemplate . 'vlan=' . $this->getAttributes("managedsp:vlan")[0]['value'] . '&'; |
|
| 718 | - $toPostTemplate = $toPostTemplate . 'realmforvlan[]=' . implode('&realmforvlan[]=', $allRealms) . '&'; |
|
| 717 | + $toPostTemplate = $toPostTemplate.'vlan='.$this->getAttributes("managedsp:vlan")[0]['value'].'&'; |
|
| 718 | + $toPostTemplate = $toPostTemplate.'realmforvlan[]='.implode('&realmforvlan[]=', $allRealms).'&'; |
|
| 719 | 719 | } |
| 720 | 720 | } |
| 721 | 721 | } |
| 722 | 722 | foreach (array_keys($toPost) as $key) { |
| 723 | - $elem = 'port' . $key; |
|
| 724 | - $toPost[$key] = $toPostTemplate . 'port=' . $this->$elem; |
|
| 723 | + $elem = 'port'.$key; |
|
| 724 | + $toPost[$key] = $toPostTemplate.'port='.$this->$elem; |
|
| 725 | 725 | } |
| 726 | 726 | $response = array(); |
| 727 | 727 | foreach ($toPost as $key => $value) { |
| 728 | - $this->loggerInstance->debug(1, 'toPost ' . $toPost[$key] . "\n"); |
|
| 728 | + $this->loggerInstance->debug(1, 'toPost '.$toPost[$key]."\n"); |
|
| 729 | 729 | // temporarly one server $response['res[' . $key . ']'] = $this->sendToRADIUS($key, $toPost[$key]); |
| 730 | 730 | if ($key == 2) { |
| 731 | 731 | $response['res[2]'] = 'OK'; |
| 732 | 732 | } else { |
| 733 | - $response['res[' . $key . ']'] = $this->sendToRADIUS($key, $toPost[$key]); |
|
| 733 | + $response['res['.$key.']'] = $this->sendToRADIUS($key, $toPost[$key]); |
|
| 734 | 734 | } |
| 735 | 735 | } |
| 736 | 736 | if ($onlyone) { |
| 737 | - $response['res[' . ($onlyone == 1) ? 2 : 1 . ']'] = \core\AbstractDeployment::RADIUS_OK; |
|
| 737 | + $response['res['.($onlyone == 1) ? 2 : 1.']'] = \core\AbstractDeployment::RADIUS_OK; |
|
| 738 | 738 | } |
| 739 | 739 | foreach (array('OK', 'FAILURE') as $status) { |
| 740 | - if ( ( ($status == 'OK' && $notify) || ($status == 'FAILURE') ) && ( in_array($status, $response) ) ) { |
|
| 740 | + if ((($status == 'OK' && $notify) || ($status == 'FAILURE')) && (in_array($status, $response))) { |
|
| 741 | 741 | $this->sendMailtoAdmin($remove, $response, $status); |
| 742 | 742 | } |
| 743 | 743 | } |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | return $this->counter; |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | - $cachedNumber = @file_get_contents(ROOT . "/var/tmp/cachedSPNumber.serialised"); |
|
| 129 | + $cachedNumber = @file_get_contents(ROOT."/var/tmp/cachedSPNumber.serialised"); |
|
| 130 | 130 | if ($cachedNumber !== FALSE) { |
| 131 | 131 | $numberData = unserialize($cachedNumber); |
| 132 | 132 | $now = new \DateTime(); |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | } else { // data in cache is too old or doesn't exist. We really need to ask the database |
| 140 | 140 | $list = $this->listAllServiceProviders(); |
| 141 | 141 | $this->counter = count($list); |
| 142 | - file_put_contents(ROOT . "/var/tmp/cachedSPNumber.serialised", serialize(["number" => $this->counter, "timestamp" => new \DateTime()])); |
|
| 142 | + file_put_contents(ROOT."/var/tmp/cachedSPNumber.serialised", serialize(["number" => $this->counter, "timestamp" => new \DateTime()])); |
|
| 143 | 143 | return $this->counter; |
| 144 | 144 | } |
| 145 | 145 | } |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | $returnarray = []; |
| 189 | 189 | $query = "SELECT id_institution AS id, country, inst_realm as realmlist, name AS collapsed_name, contact AS collapsed_contact, type FROM view_active_institution WHERE country = ?"; |
| 190 | 190 | if ($eduroamDbType !== NULL) { |
| 191 | - $query .= " AND ( type = '" . ExternalEduroamDBData::TYPE_IDPSP . "' OR type = '" . $eduroamDbType . "')"; |
|
| 191 | + $query .= " AND ( type = '".ExternalEduroamDBData::TYPE_IDPSP."' OR type = '".$eduroamDbType."')"; |
|
| 192 | 192 | } |
| 193 | 193 | $externals = $this->db->exec($query, "s", $tld); |
| 194 | 194 | // was a SELECT query, so a resource and not a boolean |
@@ -284,19 +284,19 @@ discard block |
||
| 284 | 284 | * |
| 285 | 285 | * @return array |
| 286 | 286 | */ |
| 287 | - public function listExternalTlsServersInstitution($tld, $include_not_ready=FALSE) { |
|
| 287 | + public function listExternalTlsServersInstitution($tld, $include_not_ready = FALSE) { |
|
| 288 | 288 | $retval = []; |
| 289 | 289 | // this includes servers of type "staging", which is fine |
| 290 | 290 | $query = "SELECT ROid, instid, type, inst_name, servers, contacts, ts FROM eduroamv2.view_tls_inst WHERE country = ?"; |
| 291 | 291 | if (!$include_not_ready) { |
| 292 | - $query = $query . " AND servers IS NOT NULL AND contacts IS NOT NULL"; |
|
| 292 | + $query = $query." AND servers IS NOT NULL AND contacts IS NOT NULL"; |
|
| 293 | 293 | } |
| 294 | 294 | $instServerTransaction = $this->db->exec($query, "s", $tld); |
| 295 | 295 | while ($instServerResponses = mysqli_fetch_object(/** @scrutinizer ignore-type */ $instServerTransaction)) { |
| 296 | 296 | $contactList = $this::dissectCollapsedContacts($instServerResponses->contacts); |
| 297 | 297 | $names = $this->splitNames($instServerResponses->inst_name); |
| 298 | 298 | $thelanguage = $names[$this->languageInstance->getLang()] ?? $names["en"] ?? array_shift($names); |
| 299 | - $retval[$instServerResponses->ROid . "-". $instServerResponses->instid] = [ |
|
| 299 | + $retval[$instServerResponses->ROid."-".$instServerResponses->instid] = [ |
|
| 300 | 300 | "names" => $names, |
| 301 | 301 | "name" => $thelanguage, |
| 302 | 302 | "type" => array_search($instServerResponses->type, self::TYPE_MAPPING), |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | // for now (no OpenRoaming client certs available) only run server-side tests |
| 333 | 333 | foreach ($listOfIPs as $oneIP) { |
| 334 | 334 | $connectionResult = $connectionTests->cApathCheck($oneIP); |
| 335 | - if ($connectionResult != \core\diag\AbstractTest::RETVAL_OK || ( isset($connectionTests->TLS_CA_checks_result['cert_oddity']) && count($connectionTests->TLS_CA_checks_result['cert_oddity']) > 0)) { |
|
| 335 | + if ($connectionResult != \core\diag\AbstractTest::RETVAL_OK || (isset($connectionTests->TLS_CA_checks_result['cert_oddity']) && count($connectionTests->TLS_CA_checks_result['cert_oddity']) > 0)) { |
|
| 336 | 336 | $allHostsOkay = FALSE; |
| 337 | 337 | } else { |
| 338 | 338 | $oneHostOkay = TRUE; |
@@ -486,7 +486,7 @@ discard block |
||
| 486 | 486 | // which is different from the outer username we put into installers |
| 487 | 487 | return $this->getAttributes("internal:checkuser_value")[0]['value']."@".$realm; |
| 488 | 488 | } |
| 489 | - if (count($this->getAttributes("internal:use_anon_outer")) > 0 && $this->getAttributes("internal:anon_local_value")[0]['value'] != NULL ) { |
|
| 489 | + if (count($this->getAttributes("internal:use_anon_outer")) > 0 && $this->getAttributes("internal:anon_local_value")[0]['value'] != NULL) { |
|
| 490 | 490 | // no special check username, but there is an anon outer ID for |
| 491 | 491 | // installers - so let's use that one |
| 492 | 492 | return $this->getAttributes("internal:anon_local_value")[0]['value']."@".$realm; |
@@ -642,7 +642,7 @@ discard block |
||
| 642 | 642 | } |
| 643 | 643 | |
| 644 | 644 | $monthlyList = []; |
| 645 | - $monthly = $this->frontendHandle->exec("SELECT downloads_user,device_id FROM downloads_history WHERE profile_id=? AND stat_date=DATE_FORMAT(NOW(),'%Y-%m-01')", "i", $this->identifier); |
|
| 645 | + $monthly = $this->frontendHandle->exec("SELECT downloads_user,device_id FROM downloads_history WHERE profile_id=? AND stat_date=DATE_FORMAT(NOW(),'%Y-%m-01')", "i", $this->identifier); |
|
| 646 | 646 | while ($statsQuery = mysqli_fetch_object(/** @scrutinizer ignore-type */ $monthly)) { |
| 647 | 647 | $monthlyList[$statsQuery->device_id] = $statsQuery->downloads_user; |
| 648 | 648 | } |
@@ -654,7 +654,7 @@ discard block |
||
| 654 | 654 | } |
| 655 | 655 | |
| 656 | 656 | \core\common\Entity::intoThePotatoes(); |
| 657 | - ksort($finalarray, SORT_STRING|SORT_FLAG_CASE); |
|
| 657 | + ksort($finalarray, SORT_STRING | SORT_FLAG_CASE); |
|
| 658 | 658 | \core\common\Entity::outOfThePotatoes(); |
| 659 | 659 | return $finalarray; |
| 660 | 660 | } |
@@ -964,7 +964,7 @@ discard block |
||
| 964 | 964 | $profileStatus = self::CERT_STATUS_NONE; |
| 965 | 965 | foreach ($rows as $row) { |
| 966 | 966 | $encodedCert = $row[0]; |
| 967 | - $tm = $x509->processCertificate(base64_decode($encodedCert))['full_details']['validTo_time_t']- time(); |
|
| 967 | + $tm = $x509->processCertificate(base64_decode($encodedCert))['full_details']['validTo_time_t'] - time(); |
|
| 968 | 968 | if ($tm < \config\ConfAssistant::CERT_WARNINGS['expiry_critical']) { |
| 969 | 969 | $certStatus = self::CERT_STATUS_ERROR; |
| 970 | 970 | } elseif ($tm < \config\ConfAssistant::CERT_WARNINGS['expiry_warning']) { |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | */ |
| 27 | 27 | ?> |
| 28 | 28 | <?php |
| 29 | -require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php"; |
|
| 29 | +require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php"; |
|
| 30 | 30 | |
| 31 | 31 | $auth = new \web\lib\admin\Authentication(); |
| 32 | 32 | $deco = new \web\lib\admin\PageDecoration(); |
@@ -82,9 +82,9 @@ discard block |
||
| 82 | 82 | echo '<br/>'; |
| 83 | 83 | echo _("In the 'Timestamp' column we show last update time."); |
| 84 | 84 | echo '<p/>'; |
| 85 | - echo _('To check eduroam database specification see') . |
|
| 86 | - ' <a target="_blank" href="https://monitor.eduroam.org/eduroam-database/v2/docs/eduroam-database-ver30112021.pdf">' . |
|
| 87 | - _('this document') . '</a>.<p/>'; |
|
| 85 | + echo _('To check eduroam database specification see'). |
|
| 86 | + ' <a target="_blank" href="https://monitor.eduroam.org/eduroam-database/v2/docs/eduroam-database-ver30112021.pdf">'. |
|
| 87 | + _('this document').'</a>.<p/>'; |
|
| 88 | 88 | echo _('If you cannot find your institution on this list it means that this institiution is not present in your upstream data.'); |
| 89 | 89 | echo '<p/>'; |
| 90 | 90 | $allAuthorizedFeds = $user->getAttributes("user:fedadmin"); |
@@ -93,11 +93,11 @@ discard block |
||
| 93 | 93 | ?> |
| 94 | 94 | |
| 95 | 95 | <select name="INST-list" id="INST-list"> |
| 96 | - <option value=""><?php echo _('---PLEASE CHOOSE---');?></option> |
|
| 96 | + <option value=""><?php echo _('---PLEASE CHOOSE---'); ?></option> |
|
| 97 | 97 | <?php |
| 98 | 98 | $instdata = array(); |
| 99 | 99 | foreach ($extInsts as $iid => $oneInst) { |
| 100 | - print '<option value="' . $iid . '">' . $oneInst['name'] . '</option>'; |
|
| 100 | + print '<option value="'.$iid.'">'.$oneInst['name'].'</option>'; |
|
| 101 | 101 | $instdata[$iid] = array(); |
| 102 | 102 | $instdata[$iid]['name'] = $oneInst['name']; |
| 103 | 103 | $instdata[$iid]['type'] = _('no data'); |
@@ -111,22 +111,22 @@ discard block |
||
| 111 | 111 | $contactdata = ''; |
| 112 | 112 | foreach ($oneInst['contacts'] as $oneContact) { |
| 113 | 113 | if ($contactdata != '') { |
| 114 | - $contactdata = $contactdata . '<br>'; |
|
| 114 | + $contactdata = $contactdata.'<br>'; |
|
| 115 | 115 | } |
| 116 | 116 | if ($oneContact['name']) { |
| 117 | - $contactdata = $contactdata . $oneContact['name']; |
|
| 117 | + $contactdata = $contactdata.$oneContact['name']; |
|
| 118 | 118 | } |
| 119 | 119 | if ($contactdata != '') { |
| 120 | - $contactdata = $contactdata . '<br>'; |
|
| 120 | + $contactdata = $contactdata.'<br>'; |
|
| 121 | 121 | } |
| 122 | 122 | if ($oneContact['mail']) { |
| 123 | - $contactdata = $contactdata . $oneContact['mail']; |
|
| 123 | + $contactdata = $contactdata.$oneContact['mail']; |
|
| 124 | 124 | } |
| 125 | 125 | if ($contactdata != '') { |
| 126 | - $contactdata = $contactdata . '<br>'; |
|
| 126 | + $contactdata = $contactdata.'<br>'; |
|
| 127 | 127 | } |
| 128 | 128 | if ($oneContact['phone']) { |
| 129 | - $contactdata = $contactdata . $oneContact['phone']; |
|
| 129 | + $contactdata = $contactdata.$oneContact['phone']; |
|
| 130 | 130 | } |
| 131 | 131 | } |
| 132 | 132 | if ($contactdata == '') { |
@@ -145,11 +145,11 @@ discard block |
||
| 145 | 145 | var instts = []; |
| 146 | 146 | <?php |
| 147 | 147 | foreach (array_keys($instdata) as $iid) { |
| 148 | - echo "instservers['" . $iid . "']='" . $instdata[$iid]['servers']. "';\n"; |
|
| 149 | - echo "instname['" . $iid . "']='" . $instdata[$iid]['name']. "';\n"; |
|
| 150 | - echo "insttype['" . $iid . "']='" . $instdata[$iid]['type']. "';\n"; |
|
| 151 | - echo "instcontact['" . $iid . "']='" . $instdata[$iid]['contacts']. "';\n"; |
|
| 152 | - echo "instts['" . $iid . "']='" . $instdata[$iid]['ts']. "';\n"; |
|
| 148 | + echo "instservers['".$iid."']='".$instdata[$iid]['servers']."';\n"; |
|
| 149 | + echo "instname['".$iid."']='".$instdata[$iid]['name']."';\n"; |
|
| 150 | + echo "insttype['".$iid."']='".$instdata[$iid]['type']."';\n"; |
|
| 151 | + echo "instcontact['".$iid."']='".$instdata[$iid]['contacts']."';\n"; |
|
| 152 | + echo "instts['".$iid."']='".$instdata[$iid]['ts']."';\n"; |
|
| 153 | 153 | } |
| 154 | 154 | ?> |
| 155 | 155 | $(document).ready(function(){ |
@@ -171,18 +171,18 @@ discard block |
||
| 171 | 171 | <div id="instdata_area"> |
| 172 | 172 | <table> |
| 173 | 173 | <tr><th align="left" width="350"> |
| 174 | - <?php echo _('Name');?> |
|
| 174 | + <?php echo _('Name'); ?> |
|
| 175 | 175 | </th><th align="left" width="100"> |
| 176 | - <?php echo _('Type');?> |
|
| 176 | + <?php echo _('Type'); ?> |
|
| 177 | 177 | </th> |
| 178 | 178 | <th align="left" width="200"> |
| 179 | - <?php echo _('Servers');?> |
|
| 179 | + <?php echo _('Servers'); ?> |
|
| 180 | 180 | </th> |
| 181 | 181 | <th align="left" width="200"> |
| 182 | - <?php echo _('Contact data');?> |
|
| 182 | + <?php echo _('Contact data'); ?> |
|
| 183 | 183 | </th> |
| 184 | 184 | <th align="left" width="100"> |
| 185 | - <?php echo _('Timestamp');?> |
|
| 185 | + <?php echo _('Timestamp'); ?> |
|
| 186 | 186 | </th> |
| 187 | 187 | </tr> |
| 188 | 188 | <tr id="toshow"></tr> |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | */ |
| 28 | 28 | ?> |
| 29 | 29 | <?php |
| 30 | -require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php"; |
|
| 30 | +require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php"; |
|
| 31 | 31 | |
| 32 | 32 | $deco = new \web\lib\admin\PageDecoration(); |
| 33 | 33 | $validator = new \web\lib\common\InputValidation(); |
@@ -41,10 +41,10 @@ discard block |
||
| 41 | 41 | ( $_POST['consortium'] == "OpenRoaming" && count($myfed->getAttributes("fed:openroaming")) > 0 ) |
| 42 | 42 | ) |
| 43 | 43 | ) {*/ |
| 44 | - if (isset($_POST['consortium']) && $_POST['consortium'] == "eduroam") |
|
| 44 | + if (isset($_POST['consortium']) && $_POST['consortium'] == "eduroam") |
|
| 45 | 45 | { |
| 46 | 46 | $deployment = $my_inst->newDeployment(\core\AbstractDeployment::DEPLOYMENTTYPE_MANAGED, $_POST['consortium']); |
| 47 | - header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '#profilebox_' . $deployment->identifier); |
|
| 47 | + header("Location: overview_org.php?inst_id=".$my_inst->identifier.'#profilebox_'.$deployment->identifier); |
|
| 48 | 48 | exit(0); |
| 49 | 49 | } else { |
| 50 | 50 | throw new Exception("Desired consortium for Managed SP needs to be specified, and allowed!"); |
@@ -101,23 +101,23 @@ discard block |
||
| 101 | 101 | if (isset($_POST['agreement']) && $_POST['agreement'] == "true") { |
| 102 | 102 | $deployment->addAttribute("hiddenmanagedsp:tou_accepted", NULL, 1); |
| 103 | 103 | } |
| 104 | - header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '#profilebox_' . $deployment->identifier); |
|
| 104 | + header("Location: overview_org.php?inst_id=".$my_inst->identifier.'#profilebox_'.$deployment->identifier); |
|
| 105 | 105 | exit(0); |
| 106 | 106 | case web\lib\common\FormElements::BUTTON_DELETE: |
| 107 | 107 | $response = $deployment->setRADIUSconfig(); |
| 108 | 108 | if (in_array('OK', $response)) { |
| 109 | 109 | $deployment->deactivate(); |
| 110 | 110 | } |
| 111 | - header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '&' . urldecode(http_build_query($response)) . '#profilebox_' . |
|
| 111 | + header("Location: overview_org.php?inst_id=".$my_inst->identifier.'&'.urldecode(http_build_query($response)).'#profilebox_'. |
|
| 112 | 112 | $deployment->identifier); |
| 113 | 113 | exit(0); |
| 114 | 114 | case web\lib\common\FormElements::BUTTON_REMOVESP: |
| 115 | 115 | $deployment->remove(); |
| 116 | - header("Location: overview_org.php?inst_id=" . $my_inst->identifier); |
|
| 116 | + header("Location: overview_org.php?inst_id=".$my_inst->identifier); |
|
| 117 | 117 | exit(0); |
| 118 | 118 | case web\lib\common\FormElements::BUTTON_RENEWTLS: |
| 119 | 119 | $deployment->renewtls(); |
| 120 | - header("Location: overview_org.php?inst_id=" . $my_inst->identifier); |
|
| 120 | + header("Location: overview_org.php?inst_id=".$my_inst->identifier); |
|
| 121 | 121 | exit(0); |
| 122 | 122 | case web\lib\common\FormElements::BUTTON_ACTIVATE: |
| 123 | 123 | if (count($deployment->getAttributes("hiddenmanagedsp:tou_accepted")) > 0) { |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | if (in_array('OK', $response)) { |
| 126 | 126 | $deployment->activate(); |
| 127 | 127 | } |
| 128 | - header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '&' . urldecode(http_build_query($response)) . '#profilebox_' . $deployment->identifier); |
|
| 128 | + header("Location: overview_org.php?inst_id=".$my_inst->identifier.'&'.urldecode(http_build_query($response)).'#profilebox_'.$deployment->identifier); |
|
| 129 | 129 | exit(0); |
| 130 | 130 | } else { |
| 131 | 131 | throw new Exception("Activate button pushed without acknowledged ToUs!"); |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | } else { |
| 155 | 155 | $response = ['NOOP', 'NOOP']; |
| 156 | 156 | } |
| 157 | - header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '&' . urldecode(http_build_query($response)) . '#profilebox_' . $deployment->identifier); |
|
| 157 | + header("Location: overview_org.php?inst_id=".$my_inst->identifier.'&'.urldecode(http_build_query($response)).'#profilebox_'.$deployment->identifier); |
|
| 158 | 158 | exit(0); |
| 159 | 159 | default: |
| 160 | 160 | throw new Exception("Unknown button action requested!"); |
@@ -163,10 +163,10 @@ discard block |
||
| 163 | 163 | if (isset($_POST['command'])) { |
| 164 | 164 | switch ($_POST['command']) { |
| 165 | 165 | case web\lib\common\FormElements::BUTTON_CLOSE: |
| 166 | - header("Location: overview_org.php?inst_id=" . $my_inst->identifier) . '#profilebox_' . $deployment->identifier; |
|
| 166 | + header("Location: overview_org.php?inst_id=".$my_inst->identifier).'#profilebox_'.$deployment->identifier; |
|
| 167 | 167 | exit(0); |
| 168 | 168 | default: |
| 169 | - header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '#profilebox_' . $deployment->identifier); |
|
| 169 | + header("Location: overview_org.php?inst_id=".$my_inst->identifier.'#profilebox_'.$deployment->identifier); |
|
| 170 | 170 | exit(0); |
| 171 | 171 | } |
| 172 | 172 | } |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | echo $uiElements->instLevelInfoBoxes($my_inst); |
| 194 | 194 | $deploymentOptions = $deployment->getAttributes(); |
| 195 | 195 | echo "<form enctype='multipart/form-data' action='edit_hotspot.php?inst_id=$my_inst->identifier&deployment_id=$deployment->identifier' method='post' accept-charset='UTF-8'> |
| 196 | - <input type='hidden' name='MAX_FILE_SIZE' value='" . \config\Master::MAX_UPLOAD_SIZE . "'>"; |
|
| 196 | + <input type='hidden' name='MAX_FILE_SIZE' value='".\config\Master::MAX_UPLOAD_SIZE."'>"; |
|
| 197 | 197 | $optionDisplay = new \web\lib\admin\OptionDisplay($deploymentOptions, \core\Options::LEVEL_PROFILE); |
| 198 | 198 | ?> |
| 199 | 199 | <fieldset class='option_container' id='managedsp_override'> |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | <!-- input for VLAN identifier for home users--> |
| 228 | 228 | <td> |
| 229 | 229 | <span id='vlan_label'> |
| 230 | - <?php echo sprintf(_("VLAN tag for own users%s:"), ($vlan === NULL ? "" : " " . _("(unset with '0')"))); ?> |
|
| 230 | + <?php echo sprintf(_("VLAN tag for own users%s:"), ($vlan === NULL ? "" : " "._("(unset with '0')"))); ?> |
|
| 231 | 231 | </span> |
| 232 | 232 | </td> |
| 233 | 233 | <td> |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | </fieldset> |
| 248 | 248 | |
| 249 | 249 | <?php |
| 250 | - echo "<p><button type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_SAVE . "'>" . _("Save data") . "</button><button type='button' class='delete' name='abortbutton' value='abort' onclick='javascript:window.location = \"overview_org.php?inst_id=$my_inst->identifier\"'>" . _("Discard changes") . "</button></p></form>"; |
|
| 250 | + echo "<p><button type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_SAVE."'>"._("Save data")."</button><button type='button' class='delete' name='abortbutton' value='abort' onclick='javascript:window.location = \"overview_org.php?inst_id=$my_inst->identifier\"'>"._("Discard changes")."</button></p></form>"; |
|
| 251 | 251 | echo $deco->footer(); |
| 252 | 252 | |
| 253 | 253 | |
| 254 | 254 | \ No newline at end of file |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | */ |
| 28 | 28 | ?> |
| 29 | 29 | <?php |
| 30 | -require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php"; |
|
| 30 | +require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php"; |
|
| 31 | 31 | |
| 32 | 32 | function displaySilverbulletPropertyWidget(&$theProfile, $readonly, &$uiElements) { |
| 33 | 33 | ?> |
@@ -44,14 +44,14 @@ discard block |
||
| 44 | 44 | <ul style='margin:1px'> |
| 45 | 45 | <?php |
| 46 | 46 | foreach ($completeness as $missing_attrib) { |
| 47 | - echo "<li>" . $uiElements->displayName($missing_attrib) . "</li>"; |
|
| 47 | + echo "<li>".$uiElements->displayName($missing_attrib)."</li>"; |
|
| 48 | 48 | } |
| 49 | 49 | ?> |
| 50 | 50 | </ul> |
| 51 | 51 | </div> |
| 52 | 52 | <?php |
| 53 | 53 | } else { |
| 54 | - echo sprintf(_("You can create up to %d users."), $maxusers[0]['value']) . "<br/>" . sprintf(_("Their credentials will carry the name <strong>%s</strong>."), $theProfile->realm); |
|
| 54 | + echo sprintf(_("You can create up to %d users."), $maxusers[0]['value'])."<br/>".sprintf(_("Their credentials will carry the name <strong>%s</strong>."), $theProfile->realm); |
|
| 55 | 55 | } |
| 56 | 56 | ?> |
| 57 | 57 | <br/> |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | if ($readonly === FALSE) { |
| 61 | 61 | ?> |
| 62 | 62 | <form action='edit_silverbullet.php?inst_id=<?php echo $theProfile->institution; ?>&profile_id=<?php echo $theProfile->identifier; ?>' method='POST'> |
| 63 | - <button <?php echo ( is_array($completeness) ? "disabled" : "" ); ?> type='submit' name='sb_action' value='sb_edit'><?php echo _("Manage User Base"); ?></button> |
|
| 63 | + <button <?php echo (is_array($completeness) ? "disabled" : ""); ?> type='submit' name='sb_action' value='sb_edit'><?php echo _("Manage User Base"); ?></button> |
|
| 64 | 64 | </form> |
| 65 | 65 | <?php |
| 66 | 66 | } |
@@ -96,21 +96,21 @@ discard block |
||
| 96 | 96 | $has_overrides = TRUE; |
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | - $buffer_eaptypediv = "<div style='margin-bottom:40px; float:left;'>" . _("<strong>EAP Types</strong> (in order of preference):") . "<br/>"; |
|
| 99 | + $buffer_eaptypediv = "<div style='margin-bottom:40px; float:left;'>"._("<strong>EAP Types</strong> (in order of preference):")."<br/>"; |
|
| 100 | 100 | $typelist = $theProfile->getEapMethodsinOrderOfPreference(); |
| 101 | 101 | $allcomplete = TRUE; |
| 102 | 102 | foreach ($typelist as $eaptype) { |
| 103 | 103 | $buffer_eaptypediv .= $eaptype->getPrintableRep(); |
| 104 | 104 | $completeness = $theProfile->isEapTypeDefinitionComplete($eaptype); |
| 105 | 105 | if ($completeness === true) { |
| 106 | - $buffer_eaptypediv .= " <div class='acceptable'>" . _("OK") . "</div>"; |
|
| 106 | + $buffer_eaptypediv .= " <div class='acceptable'>"._("OK")."</div>"; |
|
| 107 | 107 | } else { |
| 108 | 108 | $buffer_eaptypediv .= " <div class='notacceptable'>"; |
| 109 | 109 | $buffer_eaptypediv .= _("Information needed!"); |
| 110 | 110 | if (is_array($completeness)) { |
| 111 | 111 | $buffer_eaptypediv .= "<ul style='margin:1px'>"; |
| 112 | 112 | foreach ($completeness as $missing_attrib) { |
| 113 | - $buffer_eaptypediv .= "<li>" . $uiElements->displayName($missing_attrib) . "</li>"; |
|
| 113 | + $buffer_eaptypediv .= "<li>".$uiElements->displayName($missing_attrib)."</li>"; |
|
| 114 | 114 | } |
| 115 | 115 | $buffer_eaptypediv .= "</ul>"; |
| 116 | 116 | } |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | foreach ($attribs as $attrib) { |
| 123 | 123 | if ($attrib['level'] == \core\Options::LEVEL_METHOD && !preg_match("/^internal:/", $attrib['name']) && !$justOnce) { |
| 124 | 124 | $justOnce = TRUE; |
| 125 | - $buffer_eaptypediv .= "<img src='../resources/images/icons/Tabler/square-rounded-letter-e-blue.svg' alt='" . _("Options on EAP Method/Device level are in effect.") . "'>"; |
|
| 125 | + $buffer_eaptypediv .= "<img src='../resources/images/icons/Tabler/square-rounded-letter-e-blue.svg' alt='"._("Options on EAP Method/Device level are in effect.")."'>"; |
|
| 126 | 126 | } |
| 127 | 127 | } |
| 128 | 128 | $buffer_eaptypediv .= "<br/>"; |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | if ($theProfile->isRedirected()) { |
| 149 | 149 | $iconData = $uiElements->iconData('PROFILES_REDIRECTED'); |
| 150 | 150 | $iconData['text'] = _("Profile redirected"); |
| 151 | - $buffer_headline .= "<br/>" . $uiElements->catIcon(($iconData)); |
|
| 151 | + $buffer_headline .= "<br/>".$uiElements->catIcon(($iconData)); |
|
| 152 | 152 | |
| 153 | 153 | } |
| 154 | 154 | |
@@ -156,15 +156,15 @@ discard block |
||
| 156 | 156 | switch ($certStatus) { |
| 157 | 157 | case core\AbstractProfile::CERT_STATUS_OK: |
| 158 | 158 | $iconData = $uiElements->iconData('CERT_STATUS_OK'); |
| 159 | - $buffer_headline .= "<br/>" . $uiElements->catIcon(($iconData)); |
|
| 159 | + $buffer_headline .= "<br/>".$uiElements->catIcon(($iconData)); |
|
| 160 | 160 | break; |
| 161 | 161 | case core\AbstractProfile::CERT_STATUS_WARN: |
| 162 | 162 | $iconData = $uiElements->iconData('CERT_STATUS_WARN'); |
| 163 | - $buffer_headline .= "<br/>" . $uiElements->catIcon(($iconData)); |
|
| 163 | + $buffer_headline .= "<br/>".$uiElements->catIcon(($iconData)); |
|
| 164 | 164 | break; |
| 165 | 165 | case core\AbstractProfile::CERT_STATUS_ERROR: |
| 166 | 166 | $iconData = $uiElements->iconData('CERT_STATUS_ERROR'); |
| 167 | - $buffer_headline .= "<br/>" . $uiElements->catIcon(($iconData)); |
|
| 167 | + $buffer_headline .= "<br/>".$uiElements->catIcon(($iconData)); |
|
| 168 | 168 | break; |
| 169 | 169 | } |
| 170 | 170 | $buffer_headline .= "</div>"; |
@@ -190,11 +190,11 @@ discard block |
||
| 190 | 190 | if (\config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS'] == "LOCAL") { |
| 191 | 191 | $diagUrl = "../diag/"; |
| 192 | 192 | } else { |
| 193 | - $diagUrl = \config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS'] . "/diag/"; |
|
| 193 | + $diagUrl = \config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS']."/diag/"; |
|
| 194 | 194 | } |
| 195 | 195 | ?> |
| 196 | - <form action='<?php echo $diagUrl . "action_realmcheck.php?inst_id=" . $theProfile->institution . "&profile_id=" . $theProfile->identifier ?>' method='post' accept-charset='UTF-8'> |
|
| 197 | - <input type='hidden' name='comefrom' value='<?php echo htmlspecialchars($link . $_SERVER['SCRIPT_NAME']); ?>'/> |
|
| 196 | + <form action='<?php echo $diagUrl."action_realmcheck.php?inst_id=".$theProfile->institution."&profile_id=".$theProfile->identifier ?>' method='post' accept-charset='UTF-8'> |
|
| 197 | + <input type='hidden' name='comefrom' value='<?php echo htmlspecialchars($link.$_SERVER['SCRIPT_NAME']); ?>'/> |
|
| 198 | 198 | <button type='submit' name='profile_action' value='check' <?php echo ($has_realm ? "" : "disabled='disabled'"); ?> title='<?php echo _("The realm can only be checked if you configure the realm!"); ?>'> |
| 199 | 199 | <?php echo _("Check realm reachability"); ?> |
| 200 | 200 | </button> |
@@ -241,9 +241,9 @@ discard block |
||
| 241 | 241 | ?> |
| 242 | 242 | <div style='display: flex;'> |
| 243 | 243 | <?php |
| 244 | - $idpLevelUrl = $link . dirname(dirname($_SERVER['SCRIPT_NAME'])) . "?idp=" . $theProfile->institution; |
|
| 245 | - $displayurl = $idpLevelUrl . "&profile=" . $theProfile->identifier; |
|
| 246 | - $QRurl = $idpLevelUrl . "&profile=" . $theProfile->identifier; |
|
| 244 | + $idpLevelUrl = $link.dirname(dirname($_SERVER['SCRIPT_NAME']))."?idp=".$theProfile->institution; |
|
| 245 | + $displayurl = $idpLevelUrl."&profile=".$theProfile->identifier; |
|
| 246 | + $QRurl = $idpLevelUrl."&profile=".$theProfile->identifier; |
|
| 247 | 247 | $qrCode = new \chillerlan\QRCode\QRCode(new \chillerlan\QRCode\QROptions([ |
| 248 | 248 | 'outputType' => \chillerlan\QRCode\QRCode::OUTPUT_IMAGE_PNG, |
| 249 | 249 | 'eccLevel' => \chillerlan\QRCode\QRCode::ECC_H, |
@@ -255,9 +255,9 @@ discard block |
||
| 255 | 255 | if (empty($rawQr)) { |
| 256 | 256 | throw new Exception("Something went seriously wrong during QR code generation!"); |
| 257 | 257 | } |
| 258 | - $uri = "data:image/png;base64," . base64_encode($uiElements->pngInjectConsortiumLogo($rawQr, web\lib\admin\UIElements::QRCODE_PIXELS_PER_SYMBOL)); |
|
| 258 | + $uri = "data:image/png;base64,".base64_encode($uiElements->pngInjectConsortiumLogo($rawQr, web\lib\admin\UIElements::QRCODE_PIXELS_PER_SYMBOL)); |
|
| 259 | 259 | $size = getimagesize($uri); |
| 260 | - echo "<img width='" . ($size[0] / 4) . "' height='" . ($size[1] / 4) . "' src='$uri' alt='QR-code'/>"; |
|
| 260 | + echo "<img width='".($size[0] / 4)."' height='".($size[1] / 4)."' src='$uri' alt='QR-code'/>"; |
|
| 261 | 261 | |
| 262 | 262 | //echo "<nobr>$displayurl</nobr></a>"; |
| 263 | 263 | echo "<p>$displayurl</p></a>"; |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | $radius_status = array(); |
| 287 | 287 | $radius_status[0] = $deploymentObject->radius_status_1; |
| 288 | 288 | $radius_status[1] = $deploymentObject->radius_status_2; |
| 289 | - $cacert = file_get_contents(ROOT . "/config/ManagedSPCerts/eduroamSP-CA.pem"); |
|
| 289 | + $cacert = file_get_contents(ROOT."/config/ManagedSPCerts/eduroamSP-CA.pem"); |
|
| 290 | 290 | $retry = $deploymentObject->checkRADIUSHostandConfigDaemon(); |
| 291 | 291 | if (is_array($retry)) { |
| 292 | 292 | foreach ($retry as $id => $stat) { |
@@ -297,11 +297,11 @@ discard block |
||
| 297 | 297 | } |
| 298 | 298 | ?> |
| 299 | 299 | <div style='display: table-row_id;'> |
| 300 | - <div class='profilebox' id="profilebox_<?php echo $deploymentObject->identifier;?>" style='display: table-cell;'> |
|
| 300 | + <div class='profilebox' id="profilebox_<?php echo $deploymentObject->identifier; ?>" style='display: table-cell;'> |
|
| 301 | 301 | <h2><?php |
| 302 | 302 | switch ($deploymentObject->consortium) { |
| 303 | 303 | case "eduroam": |
| 304 | - $displayname = config\ConfAssistant::CONSORTIUM['name'] . " " . core\DeploymentManaged::PRODUCTNAME; |
|
| 304 | + $displayname = config\ConfAssistant::CONSORTIUM['name']." ".core\DeploymentManaged::PRODUCTNAME; |
|
| 305 | 305 | break; |
| 306 | 306 | case "OpenRoaming": |
| 307 | 307 | $displayname = "OpenRoaming ANP"; |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | default: |
| 310 | 310 | throw new Exception("We are supposed to operate on a roaming consortium we don't know."); |
| 311 | 311 | } |
| 312 | - echo $displayname . " (<span style='color:" . ( $deploymentObject->status == \core\AbstractDeployment::INACTIVE ? "red;'>" . _("inactive") : "green;'>" . _("active") ) . "</span>)"; |
|
| 312 | + echo $displayname." (<span style='color:".($deploymentObject->status == \core\AbstractDeployment::INACTIVE ? "red;'>"._("inactive") : "green;'>"._("active"))."</span>)"; |
|
| 313 | 313 | ?></h2> |
| 314 | 314 | <table> |
| 315 | 315 | <caption><?php echo _("Deployment Details"); ?></caption> |
@@ -324,13 +324,13 @@ discard block |
||
| 324 | 324 | <td><strong><?php echo _("Your primary RADIUS server") ?></strong><br/> |
| 325 | 325 | <?php |
| 326 | 326 | if ($deploymentObject->host1_v4 !== NULL) { |
| 327 | - echo _("IPv4") . ": " . $deploymentObject->host1_v4; |
|
| 327 | + echo _("IPv4").": ".$deploymentObject->host1_v4; |
|
| 328 | 328 | } |
| 329 | 329 | if ($deploymentObject->host1_v4 !== NULL && $deploymentObject->host1_v6 !== NULL) { |
| 330 | 330 | echo "<br/>"; |
| 331 | 331 | } |
| 332 | 332 | if ($deploymentObject->host1_v6 !== NULL) { |
| 333 | - echo _("IPv6") . ": " . $deploymentObject->host1_v6; |
|
| 333 | + echo _("IPv6").": ".$deploymentObject->host1_v6; |
|
| 334 | 334 | } |
| 335 | 335 | ?> |
| 336 | 336 | </td> |
@@ -338,9 +338,9 @@ discard block |
||
| 338 | 338 | <td><?php echo $deploymentObject->port1; ?></td> |
| 339 | 339 | <td> |
| 340 | 340 | <?php |
| 341 | - echo "<img src='" . $radiusMessages[$deploymentObject->radius_status_1]['icon'] . |
|
| 342 | - "' alt='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] . |
|
| 343 | - "' title='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] . "' class='cat-icon'>"; |
|
| 341 | + echo "<img src='".$radiusMessages[$deploymentObject->radius_status_1]['icon']. |
|
| 342 | + "' alt='".$radiusMessages[$deploymentObject->radius_status_1]['text']. |
|
| 343 | + "' title='".$radiusMessages[$deploymentObject->radius_status_1]['text']."' class='cat-icon'>"; |
|
| 344 | 344 | ?> |
| 345 | 345 | </td> |
| 346 | 346 | </tr> |
@@ -348,22 +348,22 @@ discard block |
||
| 348 | 348 | <td><strong><?php echo _("Your backup RADIUS server") ?><br/></strong> |
| 349 | 349 | <?php |
| 350 | 350 | if ($deploymentObject->host2_v4 !== NULL) { |
| 351 | - echo _("IPv4") . ": " . $deploymentObject->host2_v4; |
|
| 351 | + echo _("IPv4").": ".$deploymentObject->host2_v4; |
|
| 352 | 352 | } |
| 353 | 353 | if ($deploymentObject->host2_v4 !== NULL && $deploymentObject->host2_v6 !== NULL) { |
| 354 | 354 | echo "<br/>"; |
| 355 | 355 | } |
| 356 | 356 | if ($deploymentObject->host2_v6 !== NULL) { |
| 357 | - echo _("IPv6") . ": " . $deploymentObject->host2_v6; |
|
| 357 | + echo _("IPv6").": ".$deploymentObject->host2_v6; |
|
| 358 | 358 | } |
| 359 | 359 | ?></td> |
| 360 | 360 | <td><?php echo _("RADIUS port number: ") ?></td> |
| 361 | 361 | <td><?php echo $deploymentObject->port2; ?></td> |
| 362 | 362 | <td> |
| 363 | 363 | <?php |
| 364 | - echo "<img src='" . $radiusMessages[$deploymentObject->radius_status_2]['icon'] . |
|
| 365 | - "' alt='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] . |
|
| 366 | - "' title='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] . "' class='cat-icon'>"; |
|
| 364 | + echo "<img src='".$radiusMessages[$deploymentObject->radius_status_2]['icon']. |
|
| 365 | + "' alt='".$radiusMessages[$deploymentObject->radius_status_2]['text']. |
|
| 366 | + "' title='".$radiusMessages[$deploymentObject->radius_status_2]['text']."' class='cat-icon'>"; |
|
| 367 | 367 | ?> |
| 368 | 368 | </td> |
| 369 | 369 | </tr> |
@@ -379,28 +379,28 @@ discard block |
||
| 379 | 379 | <tr> |
| 380 | 380 | <td><strong><?php echo _("RADSEC over TLS credentials"); ?></strong></td> |
| 381 | 381 | <td> |
| 382 | - <input type="hidden" id="priv_key_data_<?php echo $deploymentObject->identifier;?>" value="<?php echo $deploymentObject->radsec_priv;?>"> |
|
| 383 | - <input type="hidden" id="cert_data_<?php echo $deploymentObject->identifier;?>" value="<?php echo $deploymentObject->radsec_cert;?>"> |
|
| 384 | - <input type="hidden" id="ca_cert_data" value="<?php echo $cacert;?>"> |
|
| 385 | - <button class="sp_priv_key" id="priv_key_<?php echo $deploymentObject->identifier;?>" name="showc" style="background-color: gray; color: white" type="submit"><?php echo _('private key');?></button> |
|
| 386 | - <button class="sp_cert" id="cert_<?php echo $deploymentObject->identifier;?>" name="showp" style="background-color: gray; color: white" type="submit"><?php echo _('certificate');?></button> |
|
| 387 | - <button class="ca_cert" name="showca" style="background-color: gray; color: white" type="submit"><?php echo _('CA certificate');?></button> |
|
| 388 | - <button name="sendzip" onclick="location.href='inc/sendzip.inc.php?inst_id=<?php echo $deploymentObject->institution;?>&dep_id=<?php echo $deploymentObject->identifier;?>'" style="background-color: gray; color: white" type="button"><?php echo _('download ZIP-file with full data');?></button> |
|
| 382 | + <input type="hidden" id="priv_key_data_<?php echo $deploymentObject->identifier; ?>" value="<?php echo $deploymentObject->radsec_priv; ?>"> |
|
| 383 | + <input type="hidden" id="cert_data_<?php echo $deploymentObject->identifier; ?>" value="<?php echo $deploymentObject->radsec_cert; ?>"> |
|
| 384 | + <input type="hidden" id="ca_cert_data" value="<?php echo $cacert; ?>"> |
|
| 385 | + <button class="sp_priv_key" id="priv_key_<?php echo $deploymentObject->identifier; ?>" name="showc" style="background-color: gray; color: white" type="submit"><?php echo _('private key'); ?></button> |
|
| 386 | + <button class="sp_cert" id="cert_<?php echo $deploymentObject->identifier; ?>" name="showp" style="background-color: gray; color: white" type="submit"><?php echo _('certificate'); ?></button> |
|
| 387 | + <button class="ca_cert" name="showca" style="background-color: gray; color: white" type="submit"><?php echo _('CA certificate'); ?></button> |
|
| 388 | + <button name="sendzip" onclick="location.href='inc/sendzip.inc.php?inst_id=<?php echo $deploymentObject->institution; ?>&dep_id=<?php echo $deploymentObject->identifier; ?>'" style="background-color: gray; color: white" type="button"><?php echo _('download ZIP-file with full data'); ?></button> |
|
| 389 | 389 | </td |
| 390 | 390 | </tr> |
| 391 | 391 | <tr> <td></td><td> |
| 392 | 392 | <?php |
| 393 | - echo _('Not valid after:') . ' '. date_create_from_format('ymdGis', substr($data['validTo'], 0, -1))->format('Y-m-d H:i:s') . ' UTC'; |
|
| 394 | - $dleft = floor(($data['validTo_time_t']-time())/(24*60*60)); |
|
| 393 | + echo _('Not valid after:').' '.date_create_from_format('ymdGis', substr($data['validTo'], 0, -1))->format('Y-m-d H:i:s').' UTC'; |
|
| 394 | + $dleft = floor(($data['validTo_time_t'] - time()) / (24 * 60 * 60)); |
|
| 395 | 395 | if ($dleft > 0) { |
| 396 | - echo '<br>' . _('Number of days to expiry:') . ' ' . $dleft; |
|
| 396 | + echo '<br>'._('Number of days to expiry:').' '.$dleft; |
|
| 397 | 397 | } else { |
| 398 | - echo '<br>' . _('If you are using RADSEC over TLS you should urgently renew your credentisls') . '!'; |
|
| 398 | + echo '<br>'._('If you are using RADSEC over TLS you should urgently renew your credentisls').'!'; |
|
| 399 | 399 | } |
| 400 | 400 | ?></td></tr> |
| 401 | 401 | <tr> <td></td><td> |
| 402 | 402 | <?php |
| 403 | - echo _('If your certificate is close to expiry or you need to create new RADSEC over TLS credentials') . '<br>' . |
|
| 403 | + echo _('If your certificate is close to expiry or you need to create new RADSEC over TLS credentials').'<br>'. |
|
| 404 | 404 | _('click on "Renew RADSEC over TLS credentials" button'); |
| 405 | 405 | ?> |
| 406 | 406 | </td></tr> |
@@ -411,14 +411,14 @@ discard block |
||
| 411 | 411 | <tr> |
| 412 | 412 | <td><strong><?php echo _("RADSEC TLS-PSK identity"); ?></strong></td> |
| 413 | 413 | <td> |
| 414 | - SP_<?php echo $deploymentObject->identifier . '-' . $deploymentObject->institution;?> |
|
| 414 | + SP_<?php echo $deploymentObject->identifier.'-'.$deploymentObject->institution; ?> |
|
| 415 | 415 | </td> |
| 416 | 416 | </tr> |
| 417 | 417 | |
| 418 | 418 | <tr> |
| 419 | 419 | <td><strong><?php echo _("RADSEC TLS-PSK key"); ?></strong></td> |
| 420 | 420 | <td> |
| 421 | - <?php echo $deploymentObject->pskkey;?> |
|
| 421 | + <?php echo $deploymentObject->pskkey; ?> |
|
| 422 | 422 | </td> |
| 423 | 423 | </tr> |
| 424 | 424 | <?php } ?> |
@@ -473,12 +473,12 @@ discard block |
||
| 473 | 473 | if (array_key_exists('FAILURE', $res) && $res['FAILURE'] > 0) { |
| 474 | 474 | echo '<br>'; |
| 475 | 475 | if ($res['FAILURE'] == 2) { |
| 476 | - echo ' <span style="color: red;">' . _("Activation failure.") . '</span>'; |
|
| 476 | + echo ' <span style="color: red;">'._("Activation failure.").'</span>'; |
|
| 477 | 477 | } else { |
| 478 | 478 | if (isset($_GET['res'][1]) && $_GET['res']['1'] == 'FAILURE') { |
| 479 | - echo ' <span style="color: red;">' . _("Activation failure for your primary RADIUS server.") . '</span>'; |
|
| 479 | + echo ' <span style="color: red;">'._("Activation failure for your primary RADIUS server.").'</span>'; |
|
| 480 | 480 | } else { |
| 481 | - echo ' <span style="color: red;">' . _("Activation failure for your backup RADIUS server.") . '</span>'; |
|
| 481 | + echo ' <span style="color: red;">'._("Activation failure for your backup RADIUS server.").'</span>'; |
|
| 482 | 482 | } |
| 483 | 483 | } |
| 484 | 484 | } |
@@ -513,12 +513,12 @@ discard block |
||
| 513 | 513 | if ($res['FAILURE'] > 0) { |
| 514 | 514 | echo '<br>'; |
| 515 | 515 | if ($res['FAILURE'] == 2) { |
| 516 | - echo ' <span style="color: red;">' . _("Failure during deactivation, your request is queued for handling") . '</span>'; |
|
| 516 | + echo ' <span style="color: red;">'._("Failure during deactivation, your request is queued for handling").'</span>'; |
|
| 517 | 517 | } else { |
| 518 | 518 | if (isset($_GET['res'][1]) && $_GET['res']['1'] == 'FAILURE') { |
| 519 | - echo ' <span style="color: red;">' . _("Deactivation failure for your primary RADIUS server, your request is queued.") . '</span>'; |
|
| 519 | + echo ' <span style="color: red;">'._("Deactivation failure for your primary RADIUS server, your request is queued.").'</span>'; |
|
| 520 | 520 | } else { |
| 521 | - echo ' <span style="color: red;">' . _("Deactivation failure for your backup RADIUS server, your request is queued.") . '</span>'; |
|
| 521 | + echo ' <span style="color: red;">'._("Deactivation failure for your backup RADIUS server, your request is queued.").'</span>'; |
|
| 522 | 522 | } |
| 523 | 523 | } |
| 524 | 524 | } |
@@ -546,24 +546,24 @@ discard block |
||
| 546 | 546 | </div> |
| 547 | 547 | <div style='width:20px;'></div> <!-- QR code space, reserved --> |
| 548 | 548 | <div style='display: table-cell; min-width:200px;'> |
| 549 | - <?php $tablecaption = _("Hotspot Usage Statistics");?> |
|
| 549 | + <?php $tablecaption = _("Hotspot Usage Statistics"); ?> |
|
| 550 | 550 | <h1><?php echo $tablecaption; ?></h1> |
| 551 | - <h2><?php echo _("5 most recent authentications");?></h2> |
|
| 552 | - <p><?php echo _("(AP Identifier is a /-separated tuple of NAS-Identifier/NAS-IP-Address/NAS-IPv6-Address/Called-Station-Id)");?></p> |
|
| 551 | + <h2><?php echo _("5 most recent authentications"); ?></h2> |
|
| 552 | + <p><?php echo _("(AP Identifier is a /-separated tuple of NAS-Identifier/NAS-IP-Address/NAS-IPv6-Address/Called-Station-Id)"); ?></p> |
|
| 553 | 553 | <table class='authrecord'> |
| 554 | - <caption><?php echo $tablecaption;?></caption> |
|
| 554 | + <caption><?php echo $tablecaption; ?></caption> |
|
| 555 | 555 | <tr style='text-align: left;'> |
| 556 | - <th scope="col"><strong><?php echo _("Timestamp (UTC)");?></strong></th> |
|
| 557 | - <th scope="col"><strong><?php echo _("Realm");?></strong></th> |
|
| 558 | - <th scope="col"><strong><?php echo _("MAC Address");?></strong></th> |
|
| 559 | - <th scope="col"><strong><?php echo _("Chargeable-User-Identity");?></strong></th> |
|
| 560 | - <th scope="col"><strong><?php echo _("Result");?></strong></th> |
|
| 561 | - <th scope="col"><strong><?php echo _("AP Identifier");?></strong></th> |
|
| 556 | + <th scope="col"><strong><?php echo _("Timestamp (UTC)"); ?></strong></th> |
|
| 557 | + <th scope="col"><strong><?php echo _("Realm"); ?></strong></th> |
|
| 558 | + <th scope="col"><strong><?php echo _("MAC Address"); ?></strong></th> |
|
| 559 | + <th scope="col"><strong><?php echo _("Chargeable-User-Identity"); ?></strong></th> |
|
| 560 | + <th scope="col"><strong><?php echo _("Result"); ?></strong></th> |
|
| 561 | + <th scope="col"><strong><?php echo _("AP Identifier"); ?></strong></th> |
|
| 562 | 562 | </tr> |
| 563 | 563 | <?php |
| 564 | - $userAuthData = $deploymentObject->retrieveStatistics(0,5); |
|
| 564 | + $userAuthData = $deploymentObject->retrieveStatistics(0, 5); |
|
| 565 | 565 | foreach ($userAuthData as $oneRecord) { |
| 566 | - echo "<tr class='".($oneRecord['result'] == "OK" ? "auth-success" : "auth-fail" )."'>" |
|
| 566 | + echo "<tr class='".($oneRecord['result'] == "OK" ? "auth-success" : "auth-fail")."'>" |
|
| 567 | 567 | . "<td>".$oneRecord['activity_time']."</td>" |
| 568 | 568 | . "<td>".$oneRecord['realm']."</td>" |
| 569 | 569 | . "<td>".$oneRecord['mac']."</td>" |
@@ -755,7 +755,7 @@ discard block |
||
| 755 | 755 | } |
| 756 | 756 | ?> |
| 757 | 757 | </h2> |
| 758 | - <?php if(count($profiles_for_this_idp) > 1 && $readonly === FALSE && $editMode === 'fullaccess') { ?> |
|
| 758 | + <?php if (count($profiles_for_this_idp) > 1 && $readonly === FALSE && $editMode === 'fullaccess') { ?> |
|
| 759 | 759 | <form method='post' action='sort_profiles.php?inst_id=<?php echo $my_inst->identifier; ?>' accept-charset='UTF-8'> |
| 760 | 760 | <div> |
| 761 | 761 | <button type='submit' name='profile_sorting'> |
@@ -824,7 +824,7 @@ discard block |
||
| 824 | 824 | <div> |
| 825 | 825 | <input type="hidden" name="consortium" value="eduroam"/> |
| 826 | 826 | <button type='submit' <?php echo ($hasMail > 0 ? "" : "disabled"); ?> name='profile_action' value='new'> |
| 827 | - <?php echo sprintf(_("Add %s deployment ..."), \config\ConfAssistant::CONSORTIUM['name'] . " " . \core\DeploymentManaged::PRODUCTNAME); ?> |
|
| 827 | + <?php echo sprintf(_("Add %s deployment ..."), \config\ConfAssistant::CONSORTIUM['name']." ".\core\DeploymentManaged::PRODUCTNAME); ?> |
|
| 828 | 828 | </button> |
| 829 | 829 | <span style='color: red;'> |
| 830 | 830 | <?php if ($hasMail == 0) { |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | */ |
| 28 | 28 | ?> |
| 29 | 29 | <?php |
| 30 | -require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php"; |
|
| 30 | +require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php"; |
|
| 31 | 31 | $auth = new \web\lib\admin\Authentication(); |
| 32 | 32 | $deco = new \web\lib\admin\PageDecoration(); |
| 33 | 33 | $validator = new \web\lib\common\InputValidation(); |
@@ -90,23 +90,23 @@ discard block |
||
| 90 | 90 | $subject_prefix = implode(', ', array_reverse($DN)); |
| 91 | 91 | /* Messages */ |
| 92 | 92 | $messages = [ |
| 93 | - 'WRONG_SUBJECT' => _('Submitted Certificate Signing Request contains subject field that does not start with') . ' ' . |
|
| 94 | - $subject_prefix . '<br>' . _("See CSR generation rules below."), |
|
| 93 | + 'WRONG_SUBJECT' => _('Submitted Certificate Signing Request contains subject field that does not start with').' '. |
|
| 94 | + $subject_prefix.'<br>'._("See CSR generation rules below."), |
|
| 95 | 95 | 'WRONG_CSR' => _('Submitted Certificate Signing Request is broken - unable to extract the public key from CSR') |
| 96 | 96 | ]; |
| 97 | 97 | $settings = array(); |
| 98 | - if (isset($_SESSION['CSR_ERRORS']) && $_SESSION['CSR_ERRORS'] != '') { |
|
| 99 | - print '<h3 id="errorbox"><font color="red">'. $messages[$_SESSION['CSR_ERRORS']].'</font></h3>'; |
|
| 98 | + if (isset($_SESSION['CSR_ERRORS']) && $_SESSION['CSR_ERRORS'] != '') { |
|
| 99 | + print '<h3 id="errorbox"><font color="red">'.$messages[$_SESSION['CSR_ERRORS']].'</font></h3>'; |
|
| 100 | 100 | unset($_SESSION['CSR_ERRORS']); |
| 101 | 101 | } |
| 102 | - if (isset($_SESSION['FORM_SETTINGS']) && $_SESSION['FORM_SETTINGS'] != '') { |
|
| 102 | + if (isset($_SESSION['FORM_SETTINGS']) && $_SESSION['FORM_SETTINGS'] != '') { |
|
| 103 | 103 | $settings = $_SESSION['FORM_SETTINGS']; |
| 104 | 104 | unset($_SESSION['FORM_SETTINGS']); |
| 105 | 105 | } |
| 106 | 106 | if (empty($settings) && isset($_POST['LEVEL'])) { |
| 107 | 107 | $settings = array('LEVEL' => $_POST['LEVEL'], 'NRO-list' => $_POST['NRO-list'], 'INST-list' => $_POST['INST-list']); |
| 108 | 108 | } |
| 109 | - if ( isset($_POST['requestcert']) && $_POST['requestcert'] == \web\lib\common\FormElements::BUTTON_SAVE) { |
|
| 109 | + if (isset($_POST['requestcert']) && $_POST['requestcert'] == \web\lib\common\FormElements::BUTTON_SAVE) { |
|
| 110 | 110 | // basic sanity checks before we hand this over to openssl |
| 111 | 111 | $sanitisedCsr = $validator->string($_POST['CSR'] ?? "", TRUE); |
| 112 | 112 | |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | if (!empty($subject_keys)) { |
| 124 | 124 | if ($subject_keys[0] == 'DC' && $subject['DC']) { |
| 125 | 125 | foreach ($subject['DC'] as $v) { |
| 126 | - $dc[] = 'DC=' . $v; |
|
| 126 | + $dc[] = 'DC='.$v; |
|
| 127 | 127 | } |
| 128 | 128 | if ($DN !== array_reverse($dc)) { |
| 129 | 129 | $dc = array(); |
@@ -147,12 +147,12 @@ discard block |
||
| 147 | 147 | } |
| 148 | 148 | $fed = $validator->existingFederation($_POST['NRO-list']); |
| 149 | 149 | $country = strtoupper($fed->tld); |
| 150 | - $code = isset($cat->knownFederations[$country]['code']) ? $cat->knownFederations[$country]['code'] : $country ; |
|
| 150 | + $code = isset($cat->knownFederations[$country]['code']) ? $cat->knownFederations[$country]['code'] : $country; |
|
| 151 | 151 | $DN[] = "C=$code"; |
| 152 | - $DN[] = "O=NRO of " . iconv('UTF-8', 'ASCII//TRANSLIT', $cat->knownFederations[$country]['name']); |
|
| 152 | + $DN[] = "O=NRO of ".iconv('UTF-8', 'ASCII//TRANSLIT', $cat->knownFederations[$country]['name']); |
|
| 153 | 153 | $serverInfo = $externalDb->listExternalTlsServersFederation($fed->tld); |
| 154 | 154 | $serverList = explode(",", array_key_first($serverInfo)); |
| 155 | - $DN[] = "CN=" . $serverList[0]; |
|
| 155 | + $DN[] = "CN=".$serverList[0]; |
|
| 156 | 156 | $policies[] = "eduroam IdP"; |
| 157 | 157 | $policies[] = "eduroam SP"; |
| 158 | 158 | $firstName = $serverInfo[array_key_first($serverInfo)][0]["name"]; |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | throw new Exception(sprintf("Sorry: you are not %s admin for the %s requested in the form.", $uiElements->nomenclatureFed, $uiElements->nomenclatureFed)); |
| 168 | 168 | } |
| 169 | 169 | $country = strtoupper($matches[1]); |
| 170 | - $code = isset($cat->knownFederations[$country]['code']) ? $cat->knownFederations[$country]['code'] : $country ; |
|
| 170 | + $code = isset($cat->knownFederations[$country]['code']) ? $cat->knownFederations[$country]['code'] : $country; |
|
| 171 | 171 | $DN[] = "C=$code"; |
| 172 | 172 | $serverInfo = $extInsts[$_POST['INST-list']]; |
| 173 | 173 | if (isset($serverInfo["names"]["en"])) { |
@@ -180,14 +180,14 @@ discard block |
||
| 180 | 180 | $modou = 1; |
| 181 | 181 | $ou = str_replace(",", "/,", $ou); |
| 182 | 182 | } |
| 183 | - $ou = preg_replace('/\s+/', ' ', $ou); |
|
| 183 | + $ou = preg_replace('/\s+/', ' ', $ou); |
|
| 184 | 184 | if (strlen($ou) >= 64) { |
| 185 | 185 | $ou = substr($ou, 0, 64); |
| 186 | 186 | $modou += 2; |
| 187 | 187 | } |
| 188 | 188 | $DN[] = "O=".iconv('UTF-8', 'ASCII//TRANSLIT', $ou); |
| 189 | 189 | $serverList = explode(",", $serverInfo["servers"]); |
| 190 | - $DN[] = "CN=" . $serverList[0]; |
|
| 190 | + $DN[] = "CN=".$serverList[0]; |
|
| 191 | 191 | switch ($serverInfo["type"]) { |
| 192 | 192 | case core\IdP::TYPE_IDPSP: |
| 193 | 193 | $policies[] = "eduroam IdP"; |
@@ -206,13 +206,13 @@ discard block |
||
| 206 | 206 | default: |
| 207 | 207 | throw new Exception("Sorry: Unknown level of issuance requested."); |
| 208 | 208 | } |
| 209 | - echo "<p style='font-size: large'>" . _("Requesting a certificate with the following properties"); |
|
| 209 | + echo "<p style='font-size: large'>"._("Requesting a certificate with the following properties"); |
|
| 210 | 210 | echo "<ul>"; |
| 211 | - echo "<li>" . _("Policy OIDs: ") . implode(", ", $policies) . "</li>"; |
|
| 212 | - echo "<li>" . _("Distinguished Name: ") . implode(", ", $DN); |
|
| 211 | + echo "<li>"._("Policy OIDs: ").implode(", ", $policies)."</li>"; |
|
| 212 | + echo "<li>"._("Distinguished Name: ").implode(", ", $DN); |
|
| 213 | 213 | if ($modou > 0) { |
| 214 | 214 | echo " ("; |
| 215 | - echo _("Organization field adjusted"). ': '; |
|
| 215 | + echo _("Organization field adjusted").': '; |
|
| 216 | 216 | $desc = array(); |
| 217 | 217 | if ($modou >= 2) { |
| 218 | 218 | $desc[] = _("truncated to 64 chars"); |
@@ -224,8 +224,8 @@ discard block |
||
| 224 | 224 | echo ")"; |
| 225 | 225 | } |
| 226 | 226 | echo "</li>"; |
| 227 | - echo "<li>" . _("subjectAltName:DNS : ") . implode(", ", $serverList) . "</li>"; |
|
| 228 | - echo "<li>" . _("Requester Contact Details: ") . $firstName . " <" . $firstMail . ">" . "</li>"; |
|
| 227 | + echo "<li>"._("subjectAltName:DNS : ").implode(", ", $serverList)."</li>"; |
|
| 228 | + echo "<li>"._("Requester Contact Details: ").$firstName." <".$firstMail.">"."</li>"; |
|
| 229 | 229 | echo "</ul></p>"; |
| 230 | 230 | |
| 231 | 231 | $vettedCsr = $validator->string($_POST['CSR'], true); |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | $loggerInstance->debug(2, $DN, "CERT DN: ", "\n"); |
| 242 | 242 | // our certs can be good for max 5 years |
| 243 | 243 | $fed->requestCertificate($user->identifier, $newCsrWithMeta, $expiryDays); |
| 244 | - echo "<p>" . _("The certificate was requested.") . "</p>"; |
|
| 244 | + echo "<p>"._("The certificate was requested.")."</p>"; |
|
| 245 | 245 | ?> |
| 246 | 246 | <form action="overview_certificates.php" method="GET"> |
| 247 | 247 | <button type="submit"><?php echo _("Back to Certificate Overview"); ?></button> |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | switch (count($feds)) { |
| 260 | 260 | case 0: |
| 261 | 261 | echo "<div>"; |
| 262 | - echo $uiElements->boxRemark("<strong>" . sprintf(_("None of your %s servers has complete information in the database."),$uiElements->nomenclatureFed)."</strong>" . _("At least the DNS names of TLS servers and a role-based contact mail address are required.")); |
|
| 262 | + echo $uiElements->boxRemark("<strong>".sprintf(_("None of your %s servers has complete information in the database."), $uiElements->nomenclatureFed)."</strong>"._("At least the DNS names of TLS servers and a role-based contact mail address are required.")); |
|
| 263 | 263 | echo "</div>"; |
| 264 | 264 | break; |
| 265 | 265 | case 1: |
@@ -267,22 +267,22 @@ discard block |
||
| 267 | 267 | if (empty($settings) || (isset($settings['LEVEL']) && $settings['LEVEL'] == 'NRO')) { |
| 268 | 268 | echo ' checked'; |
| 269 | 269 | } |
| 270 | - echo '>' . sprintf(_("Certificate for %s") ." ", $uiElements->nomenclatureFed) . '</input>'; |
|
| 271 | - echo " <strong>" . $cat->knownFederations[$feds[0]->tld]['name'] . "</strong>"; |
|
| 272 | - echo '<input type="hidden" name="NRO-list" id="NRO-list" value="' . $feds[0]->tld . '"/>'; |
|
| 270 | + echo '>'.sprintf(_("Certificate for %s")." ", $uiElements->nomenclatureFed).'</input>'; |
|
| 271 | + echo " <strong>".$cat->knownFederations[$feds[0]->tld]['name']."</strong>"; |
|
| 272 | + echo '<input type="hidden" name="NRO-list" id="NRO-list" value="'.$feds[0]->tld.'"/>'; |
|
| 273 | 273 | break; |
| 274 | 274 | default: |
| 275 | 275 | echo '<input type="radio" name="LEVEL" id="NRO" value="NRO"'; |
| 276 | 276 | if (empty($settings) || isset($settings['LEVEL']) && $settings['LEVEL'] == 'NRO') { |
| 277 | 277 | echo ' checked'; |
| 278 | 278 | } |
| 279 | - echo '>' . sprintf(_("Certificate for %s") ." ", $uiElements->nomenclatureFed) . '</input>'; |
|
| 279 | + echo '>'.sprintf(_("Certificate for %s")." ", $uiElements->nomenclatureFed).'</input>'; |
|
| 280 | 280 | ?> |
| 281 | 281 | <select name="NRO-list" id="NRO-list"> |
| 282 | 282 | <option value="notset"><?php echo _("---PLEASE CHOOSE---"); ?></option> |
| 283 | 283 | <?php |
| 284 | 284 | foreach ($feds as $oneFed) { |
| 285 | - echo '<option value="' . strtoupper($oneFed->tld) . '">' . $cat->knownFederations[$oneFed->tld]['name'] . "</option>"; |
|
| 285 | + echo '<option value="'.strtoupper($oneFed->tld).'">'.$cat->knownFederations[$oneFed->tld]['name']."</option>"; |
|
| 286 | 286 | #echo '<option value="AAA' . strtoupper($oneFed->tld) . '">' . $oneIdP["names"][$langObject->getLang()] . "</option>"; |
| 287 | 287 | |
| 288 | 288 | } |
@@ -295,18 +295,18 @@ discard block |
||
| 295 | 295 | <script> |
| 296 | 296 | var instservers = []; |
| 297 | 297 | var instpolicies = []; |
| 298 | - var nroservers = '<?php echo str_replace(",", ", ", array_key_first($serverInfo));?>'; |
|
| 298 | + var nroservers = '<?php echo str_replace(",", ", ", array_key_first($serverInfo)); ?>'; |
|
| 299 | 299 | <?php |
| 300 | 300 | $allIdPs = []; |
| 301 | 301 | foreach ($allAuthorizedFeds as $oneFed) { |
| 302 | 302 | foreach ($externalDb->listExternalTlsServersInstitution($oneFed['value']) as $id => $oneIdP) { |
| 303 | - $allIdPs[$id] = '[' . substr($id, 0, 2) . '] ' . $oneIdP["name"]; |
|
| 304 | - echo "instservers['" . $id . "']='" . str_replace(",", ", ", $oneIdP["servers"]) . "';\n"; |
|
| 305 | - echo "instpolicies['" . $id . "']='"; |
|
| 303 | + $allIdPs[$id] = '['.substr($id, 0, 2).'] '.$oneIdP["name"]; |
|
| 304 | + echo "instservers['".$id."']='".str_replace(",", ", ", $oneIdP["servers"])."';\n"; |
|
| 305 | + echo "instpolicies['".$id."']='"; |
|
| 306 | 306 | if ($oneIdP["type"] == 'IdPSP') { |
| 307 | 307 | echo "eduroam IdP/SP"; |
| 308 | 308 | } else { |
| 309 | - echo "eduroam " . $oneIdP["type"]; |
|
| 309 | + echo "eduroam ".$oneIdP["type"]; |
|
| 310 | 310 | } |
| 311 | 311 | echo "';\n"; |
| 312 | 312 | } |
@@ -352,9 +352,9 @@ discard block |
||
| 352 | 352 | <option value="notset"><?php echo _("---PLEASE CHOOSE---"); ?></option> |
| 353 | 353 | <?php |
| 354 | 354 | foreach ($allIdPs as $id => $name) { |
| 355 | - echo '<option value="' . $id . '"'; |
|
| 355 | + echo '<option value="'.$id.'"'; |
|
| 356 | 356 | if (isset($settings['INST-list']) && $settings['INST-list'] == $id) { echo ' selected'; } |
| 357 | - echo '>' . $name . "</option>"; |
|
| 357 | + echo '>'.$name."</option>"; |
|
| 358 | 358 | } |
| 359 | 359 | ?> |
| 360 | 360 | </select> |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | <?php |
| 369 | 369 | echo _('According to the above settings you will receive') |
| 370 | 370 | ?> |
| 371 | - <span id='certlevel'><?php echo _('NRO level certificate');?></span> |
|
| 371 | + <span id='certlevel'><?php echo _('NRO level certificate'); ?></span> |
|
| 372 | 372 | |
| 373 | 373 | for server names: |
| 374 | 374 | <span id='serversinfo'><?php echo str_replace(",", ", ", array_key_first($serverInfo)); ?></span> |
@@ -384,12 +384,12 @@ discard block |
||
| 384 | 384 | <?php |
| 385 | 385 | } else { |
| 386 | 386 | echo "<div>"; |
| 387 | - echo $uiElements->boxRemark(sprintf(_("<strong>No organisation inside your %s has complete information in the database</strong>."." "._("At least the DNS names of TLS servers and a role-based contact mail address are required.")),$uiElements->nomenclatureFed), "No TLS capable org!", true); |
|
| 387 | + echo $uiElements->boxRemark(sprintf(_("<strong>No organisation inside your %s has complete information in the database</strong>."." "._("At least the DNS names of TLS servers and a role-based contact mail address are required.")), $uiElements->nomenclatureFed), "No TLS capable org!", true); |
|
| 388 | 388 | echo "</div>"; |
| 389 | 389 | } |
| 390 | 390 | ?> |
| 391 | 391 | <?php |
| 392 | - echo '<div id="ondb"><h4 style="margin: 0">' . _("Can't you find an institution on the select list above?") . '</h4>'; |
|
| 392 | + echo '<div id="ondb"><h4 style="margin: 0">'._("Can't you find an institution on the select list above?").'</h4>'; |
|
| 393 | 393 | echo _("Most likely we do not have required data on this institution in the eduroam database."); |
| 394 | 394 | echo '<br/>'; |
| 395 | 395 | ?> |
@@ -397,16 +397,16 @@ discard block |
||
| 397 | 397 | <?php |
| 398 | 398 | echo _('On this page'); |
| 399 | 399 | echo '</a> '; |
| 400 | - echo _('you can check what information is in the datatabase') . '.'; |
|
| 400 | + echo _('you can check what information is in the datatabase').'.'; |
|
| 401 | 401 | echo '</div>'; |
| 402 | 402 | if (count($feds) > 0 || count($allIdPs) > 0) {?> |
| 403 | 403 | <h2><?php echo _("2. CSR generation"); ?></h2> |
| 404 | 404 | <p> |
| 405 | 405 | <?php |
| 406 | - echo _("The CSR subject field has to start with ") .'<b>' . $subject_prefix . '</b><br>'; |
|
| 406 | + echo _("The CSR subject field has to start with ").'<b>'.$subject_prefix.'</b><br>'; |
|
| 407 | 407 | echo _("One way to generate an acceptable certificate request is via this openssl one-liner:"); ?></p> |
| 408 | 408 | <?php |
| 409 | - echo "<b>openssl req -new -newkey rsa:4096 -out test.csr -keyout test.key -subj /". implode('/', array_reverse($DN)) ."/C=XY/O=WillBeReplaced/CN=will.be.replaced</b>"; |
|
| 409 | + echo "<b>openssl req -new -newkey rsa:4096 -out test.csr -keyout test.key -subj /".implode('/', array_reverse($DN))."/C=XY/O=WillBeReplaced/CN=will.be.replaced</b>"; |
|
| 410 | 410 | ?> |
| 411 | 411 | <h2><?php echo _("3. Submission"); ?></h2> |
| 412 | 412 | <?php echo _("Please paste your CSR here:"); ?><br/><textarea name="CSR" id="CSR" rows="20" cols="85"/></textarea><br/> |