@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | $serverCandidates[IdPlist::geoDistance($adminLocation, ['lat' => $iterator->location_lat, 'lon' => $iterator->location_lon])] = $iterator->server_id; |
338 | 338 | } |
339 | 339 | if ($clients > $maxSupportedClients * 0.9) { |
340 | - $this->loggerInstance->debug(1, "A RADIUS server for Managed SP (" . $iterator->server_id . ") is serving at more than 90% capacity!"); |
|
340 | + $this->loggerInstance->debug(1, "A RADIUS server for Managed SP (".$iterator->server_id.") is serving at more than 90% capacity!"); |
|
341 | 341 | } |
342 | 342 | } |
343 | 343 | if (count($serverCandidates) == 0 && $federation != "DEFAULT") { |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | * |
360 | 360 | * @throws Exception |
361 | 361 | */ |
362 | - private function setTLSSerialNumber($max=PHP_INT_MAX) { |
|
362 | + private function setTLSSerialNumber($max = PHP_INT_MAX) { |
|
363 | 363 | $nonDupSerialFound = FALSE; |
364 | 364 | do { |
365 | 365 | $serial = random_int(1000000000, $max); |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | */ |
380 | 380 | private function createTLScredentials() |
381 | 381 | { |
382 | - $clientName = 'SP' . $this->identifier . '-' . $this->institution; |
|
382 | + $clientName = 'SP'.$this->identifier.'-'.$this->institution; |
|
383 | 383 | $dn = array( |
384 | 384 | "organizationName" => "eduroam", |
385 | 385 | "organizationalUnitName" => "eduroam Managed SP", |
@@ -393,14 +393,14 @@ discard block |
||
393 | 393 | openssl_pkey_export($privkey, $this->radsec_priv); |
394 | 394 | // Generate a certificate signing request |
395 | 395 | $csr = openssl_csr_new($dn, $privkey, |
396 | - array('digest_alg' => 'sha256', 'config' => ROOT . "/config/ManagedSPCerts/openssl.cnf")); |
|
396 | + array('digest_alg' => 'sha256', 'config' => ROOT."/config/ManagedSPCerts/openssl.cnf")); |
|
397 | 397 | // get CA certificate and private key |
398 | - $caprivkey = array(file_get_contents(ROOT . "/config/ManagedSPCerts/eduroamSP-CA.key"), |
|
398 | + $caprivkey = array(file_get_contents(ROOT."/config/ManagedSPCerts/eduroamSP-CA.key"), |
|
399 | 399 | \config\Master::MANAGEDSP['capass']); |
400 | - $cacert = file_get_contents(ROOT . "/config/ManagedSPCerts/eduroamSP-CA.pem"); |
|
400 | + $cacert = file_get_contents(ROOT."/config/ManagedSPCerts/eduroamSP-CA.pem"); |
|
401 | 401 | $this->setTLSSerialNumber(); |
402 | 402 | $clientcert = openssl_csr_sign($csr, $cacert, $caprivkey, \config\Master::MANAGEDSP['daystoexpiry'], |
403 | - array('digest_alg'=>'sha512', 'config' => ROOT . "/config/ManagedSPCerts/openssl.cnf"), $this->radsec_cert_serial_no); |
|
403 | + array('digest_alg'=>'sha512', 'config' => ROOT."/config/ManagedSPCerts/openssl.cnf"), $this->radsec_cert_serial_no); |
|
404 | 404 | openssl_x509_export($clientcert, $this->radsec_cert); |
405 | 405 | } |
406 | 406 | /** |
@@ -425,8 +425,8 @@ discard block |
||
425 | 425 | $conditional1 = "AND activity_time > DATE_SUB(NOW(), INTERVAL $backlog SECOND )"; |
426 | 426 | $conditional2 = "DESC"; |
427 | 427 | } |
428 | - $client = 'SP' . $this->identifier . '-' . $this->institution; |
|
429 | - $stats = $this->databaseHandle->exec("SELECT activity_time, realm, mac, cui, result, ap_id, prot, outer_user FROM activity WHERE owner = ? $conditional1 ORDER BY activity_time $conditional2", "s", $client ); |
|
428 | + $client = 'SP'.$this->identifier.'-'.$this->institution; |
|
429 | + $stats = $this->databaseHandle->exec("SELECT activity_time, realm, mac, cui, result, ap_id, prot, outer_user FROM activity WHERE owner = ? $conditional1 ORDER BY activity_time $conditional2", "s", $client); |
|
430 | 430 | |
431 | 431 | return mysqli_fetch_all($stats, \MYSQLI_ASSOC); |
432 | 432 | } |
@@ -544,11 +544,11 @@ discard block |
||
544 | 544 | $dn['rdnSequence'][1][0]['value']['utf8String'] = 'eduroam Managed SP'; |
545 | 545 | $dn['rdnSequence'][2] = array(); |
546 | 546 | $dn['rdnSequence'][2][] = array('type' => 'id-at-commonName', 'value' => array()); |
547 | - $dn['rdnSequence'][2][0]['value']['utf8String'] = 'SP' . $this->identifier . "-" . $this->institution; |
|
547 | + $dn['rdnSequence'][2][0]['value']['utf8String'] = 'SP'.$this->identifier."-".$this->institution; |
|
548 | 548 | $csr->setDN($dn); |
549 | - $pemcakey = file_get_contents(ROOT . "/config/ManagedSPCerts/eduroamSP-CA.key"); |
|
550 | - $cakey = \phpseclib3\Crypt\PublicKeyLoader::loadPrivateKey($pemcakey, \config\Master::MANAGEDSP['capass'] ); |
|
551 | - $pemca = file_get_contents(ROOT . "/config/ManagedSPCerts/eduroamSP-CA.pem"); |
|
549 | + $pemcakey = file_get_contents(ROOT."/config/ManagedSPCerts/eduroamSP-CA.key"); |
|
550 | + $cakey = \phpseclib3\Crypt\PublicKeyLoader::loadPrivateKey($pemcakey, \config\Master::MANAGEDSP['capass']); |
|
551 | + $pemca = file_get_contents(ROOT."/config/ManagedSPCerts/eduroamSP-CA.pem"); |
|
552 | 552 | $ca = new \phpseclib3\File\X509(); |
553 | 553 | $ca->loadX509($pemca); |
554 | 554 | $ca->setPrivateKey($cakey); |
@@ -557,7 +557,7 @@ discard block |
||
557 | 557 | $csr->setExtension('id-ce-keyUsage', ['digitalSignature', 'nonRepudiation', 'keyEncipherment']); |
558 | 558 | $csr->setExtension('id-ce-extKeyUsage', ['id-kp-clientAuth']); |
559 | 559 | $csr->setExtension('id-ce-basicConstraints', ['cA' => false], false); |
560 | - $x509->setEndDate('+' . \config\Master::MANAGEDSP['daystoexpiry'] . ' days'); |
|
560 | + $x509->setEndDate('+'.\config\Master::MANAGEDSP['daystoexpiry'].' days'); |
|
561 | 561 | $this->setTLSSerialNumber(999999999999999999); |
562 | 562 | $x509->setSerialNumber($this->radsec_cert_serial_no, 10); |
563 | 563 | $cert = $x509->loadX509($x509->saveX509($x509->sign($ca, $csr))); |
@@ -599,7 +599,7 @@ discard block |
||
599 | 599 | { |
600 | 600 | $customAttrib = $this->getAttributes("managedsp:operatorname"); |
601 | 601 | if (count($customAttrib) == 0) { |
602 | - return "1sp." . $this->identifier . "-" . $this->institution . \config\ConfAssistant::SILVERBULLET['realm_suffix']; |
|
602 | + return "1sp.".$this->identifier."-".$this->institution.\config\ConfAssistant::SILVERBULLET['realm_suffix']; |
|
603 | 603 | } |
604 | 604 | return $customAttrib[0]["value"]; |
605 | 605 | } |
@@ -614,24 +614,24 @@ discard block |
||
614 | 614 | private function sendToRADIUS(int $idx, $post) |
615 | 615 | { |
616 | 616 | $hostname = "radius_hostname_$idx"; |
617 | - $p = "server$idx" . "_secret"; |
|
617 | + $p = "server$idx"."_secret"; |
|
618 | 618 | $key = $this->$p; |
619 | - $p = "server$idx" . "_iv"; |
|
619 | + $p = "server$idx"."_iv"; |
|
620 | 620 | $iv = $this->$p; |
621 | - $p = "server$idx" . "_token"; |
|
621 | + $p = "server$idx"."_token"; |
|
622 | 622 | $token = $this->$p; |
623 | - $encrypted = openssl_encrypt($post . "&token=$token", "CHACHA20", $key, 0, $iv); |
|
623 | + $encrypted = openssl_encrypt($post."&token=$token", "CHACHA20", $key, 0, $iv); |
|
624 | 624 | if ($encrypted !== false) { |
625 | - $post = "enc=". urlencode(base64_encode($encrypted)); |
|
625 | + $post = "enc=".urlencode(base64_encode($encrypted)); |
|
626 | 626 | } |
627 | - $ch = curl_init("http://" . $this->$hostname . ':' . \config\Master::MANAGEDSP['radiusconfigport']); |
|
627 | + $ch = curl_init("http://".$this->$hostname.':'.\config\Master::MANAGEDSP['radiusconfigport']); |
|
628 | 628 | if ($ch === FALSE) { |
629 | 629 | $res = 'FAILURE'; |
630 | 630 | } else { |
631 | 631 | curl_setopt($ch, CURLOPT_USERAGENT, "CAT-ManagedSP"); |
632 | 632 | curl_setopt($ch, CURLOPT_POST, 1); |
633 | 633 | curl_setopt($ch, CURLOPT_POSTFIELDS, $post); |
634 | - $this->loggerInstance->debug(1, "Posting to http://" . $this->$hostname . ':' . \config\Master::MANAGEDSP['radiusconfigport'] . "/$post\n"); |
|
634 | + $this->loggerInstance->debug(1, "Posting to http://".$this->$hostname.':'.\config\Master::MANAGEDSP['radiusconfigport']."/$post\n"); |
|
635 | 635 | curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); |
636 | 636 | curl_setopt($ch, CURLOPT_HEADER, 0); |
637 | 637 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
@@ -671,19 +671,19 @@ discard block |
||
671 | 671 | } else { |
672 | 672 | $txt = $remove ? _('Profile deactivation failed') : _('Profile activation/modification failed'); |
673 | 673 | } |
674 | - $txt = $txt . ' '; |
|
674 | + $txt = $txt.' '; |
|
675 | 675 | if (array_count_values($response)[$status] == 2) { |
676 | - $txt = $txt . _('on both RADIUS servers: primary and backup') . '.'; |
|
676 | + $txt = $txt._('on both RADIUS servers: primary and backup').'.'; |
|
677 | 677 | } else { |
678 | 678 | if ($response['res[1]'] == $status) { |
679 | - $txt = $txt . _('on primary RADIUS server') . '.'; |
|
679 | + $txt = $txt._('on primary RADIUS server').'.'; |
|
680 | 680 | } else { |
681 | - $txt = $txt . _('on backup RADIUS server') . '.'; |
|
681 | + $txt = $txt._('on backup RADIUS server').'.'; |
|
682 | 682 | } |
683 | 683 | } |
684 | 684 | $mail = \core\common\OutsideComm::mailHandle(); |
685 | 685 | $email = $this->getAttributes("support:email")[0]['value']; |
686 | - $mail->FromName = \config\Master::APPEARANCE['productname'] . " Notification System"; |
|
686 | + $mail->FromName = \config\Master::APPEARANCE['productname']." Notification System"; |
|
687 | 687 | $mail->addAddress($email); |
688 | 688 | if ($status == 'OK') { |
689 | 689 | $mail->Subject = _('RADIUS profile update problem fixed'); |
@@ -717,7 +717,7 @@ discard block |
||
717 | 717 | return NULL; |
718 | 718 | } |
719 | 719 | $timeout = 10; |
720 | - curl_setopt($ch, CURLOPT_URL, 'http://' . $host); |
|
720 | + curl_setopt($ch, CURLOPT_URL, 'http://'.$host); |
|
721 | 721 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
722 | 722 | curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); |
723 | 723 | curl_exec($ch); |
@@ -811,52 +811,52 @@ discard block |
||
811 | 811 | { |
812 | 812 | $toPost = ($onlyone ? array($onlyone => '') : array(1 => '', 2 => '')); |
813 | 813 | if ($torevoke != '') { |
814 | - $toPostTemplate = 'instid=' . $this->institution . '&deploymentid=' . $this->identifier . |
|
814 | + $toPostTemplate = 'instid='.$this->institution.'&deploymentid='.$this->identifier. |
|
815 | 815 | "&torevoke=$torevoke"; |
816 | 816 | foreach (array_keys($toPost) as $key) { |
817 | 817 | $toPost[$key] = $toPostTemplate; |
818 | 818 | } |
819 | 819 | } else { |
820 | 820 | $remove = ($this->status == \core\AbstractDeployment::INACTIVE) ? 0 : 1; |
821 | - $toPostTemplate = 'instid=' . $this->institution . '&deploymentid=' . $this->identifier . |
|
822 | - '&secret=' . $this->secret . |
|
823 | - '&country=' . $this->getAttributes("internal:country")[0]['value'] . |
|
824 | - '&pskkey=' . $this->pskkey . '&'; |
|
821 | + $toPostTemplate = 'instid='.$this->institution.'&deploymentid='.$this->identifier. |
|
822 | + '&secret='.$this->secret. |
|
823 | + '&country='.$this->getAttributes("internal:country")[0]['value']. |
|
824 | + '&pskkey='.$this->pskkey.'&'; |
|
825 | 825 | if ($remove) { |
826 | - $toPostTemplate = $toPostTemplate . 'remove=1&'; |
|
826 | + $toPostTemplate = $toPostTemplate.'remove=1&'; |
|
827 | 827 | } else { |
828 | - $toPostTemplate = $toPostTemplate . 'operatorname=' . $this->getOperatorName() . '&'; |
|
828 | + $toPostTemplate = $toPostTemplate.'operatorname='.$this->getOperatorName().'&'; |
|
829 | 829 | if ($this->getAttributes("managedsp:vlan")[0]['value'] ?? NULL) { |
830 | 830 | $allRealms = $this->getAllRealms(); |
831 | 831 | if (!empty($allRealms)) { |
832 | - $toPostTemplate = $toPostTemplate . 'vlan=' . $this->getAttributes("managedsp:vlan")[0]['value'] . '&'; |
|
833 | - $toPostTemplate = $toPostTemplate . 'realmforvlan[]=' . implode('&realmforvlan[]=', $allRealms) . '&'; |
|
832 | + $toPostTemplate = $toPostTemplate.'vlan='.$this->getAttributes("managedsp:vlan")[0]['value'].'&'; |
|
833 | + $toPostTemplate = $toPostTemplate.'realmforvlan[]='.implode('&realmforvlan[]=', $allRealms).'&'; |
|
834 | 834 | } |
835 | 835 | } |
836 | 836 | if ($this->getAttributes("managedsp:guest_vlan")[0]['value'] ?? NULL) { |
837 | - $toPostTemplate = $toPostTemplate . 'guest_vlan=' . $this->getAttributes("managedsp:guest_vlan")[0]['value'] . '&'; |
|
837 | + $toPostTemplate = $toPostTemplate.'guest_vlan='.$this->getAttributes("managedsp:guest_vlan")[0]['value'].'&'; |
|
838 | 838 | } |
839 | 839 | } |
840 | 840 | foreach (array_keys($toPost) as $key) { |
841 | - $elem = 'port' . $key; |
|
842 | - $toPost[$key] = $toPostTemplate . 'port=' . $this->$elem; |
|
841 | + $elem = 'port'.$key; |
|
842 | + $toPost[$key] = $toPostTemplate.'port='.$this->$elem; |
|
843 | 843 | } |
844 | 844 | } |
845 | 845 | $response = array(); |
846 | 846 | foreach ($toPost as $key => $value) { |
847 | - $this->loggerInstance->debug(1, 'toPost ' . $toPost[$key] . "\n"); |
|
847 | + $this->loggerInstance->debug(1, 'toPost '.$toPost[$key]."\n"); |
|
848 | 848 | // temporarly one server $response['res[' . $key . ']'] = $this->sendToRADIUS($key, $toPost[$key]); |
849 | 849 | /*if ($key == 2) { |
850 | 850 | $response['res[2]'] = 'OK'; |
851 | 851 | } else { */ |
852 | - $response['res[' . $key . ']'] = $this->sendToRADIUS($key, $toPost[$key]); |
|
852 | + $response['res['.$key.']'] = $this->sendToRADIUS($key, $toPost[$key]); |
|
853 | 853 | //} |
854 | 854 | } |
855 | 855 | if ($onlyone) { |
856 | - $response['res[' . ($onlyone == 1) ? 2 : 1 . ']'] = \core\AbstractDeployment::RADIUS_OK; |
|
856 | + $response['res['.($onlyone == 1) ? 2 : 1.']'] = \core\AbstractDeployment::RADIUS_OK; |
|
857 | 857 | } |
858 | 858 | foreach (array('OK', 'FAILURE') as $status) { |
859 | - if ( ( ($status == 'OK' && $notify) || ($status == 'FAILURE') ) && ( in_array($status, $response) ) ) { |
|
859 | + if ((($status == 'OK' && $notify) || ($status == 'FAILURE')) && (in_array($status, $response))) { |
|
860 | 860 | $this->sendMailtoAdmin($remove, $response, $status); |
861 | 861 | } |
862 | 862 | } |
@@ -875,7 +875,7 @@ discard block |
||
875 | 875 | $randomiv = ""; |
876 | 876 | if ($logs) { |
877 | 877 | $randomiv = bin2hex(random_bytes(8)); |
878 | - $toPostTemplate = 'logid=DEBUG-' . $this->identifier . '-' .$this->institution . "&backlog=$logs&iv=$randomiv"; |
|
878 | + $toPostTemplate = 'logid=DEBUG-'.$this->identifier.'-'.$this->institution."&backlog=$logs&iv=$randomiv"; |
|
879 | 879 | foreach (array_keys($toPost) as $key) { |
880 | 880 | $toPost[$key] = $toPostTemplate; |
881 | 881 | } |
@@ -884,21 +884,21 @@ discard block |
||
884 | 884 | $tempdir = \core\common\Entity::createTemporaryDirectory("test"); |
885 | 885 | $zipdir = $tempdir['dir']; |
886 | 886 | foreach ($toPost as $key => $value) { |
887 | - $this->loggerInstance->debug(1, 'toPost ' . $toPost[$key] . "\n"); |
|
888 | - $p = "server$key" . "_secret"; |
|
887 | + $this->loggerInstance->debug(1, 'toPost '.$toPost[$key]."\n"); |
|
888 | + $p = "server$key"."_secret"; |
|
889 | 889 | $secret = $this->$p; |
890 | - $p = "server$key" . "_token"; |
|
890 | + $p = "server$key"."_token"; |
|
891 | 891 | $token = $this->$p; |
892 | - $response['res[' . $key . ']'] = $this->sendToRADIUS($key, $toPost[$key]); |
|
892 | + $response['res['.$key.']'] = $this->sendToRADIUS($key, $toPost[$key]); |
|
893 | 893 | $paths = []; |
894 | - if (substr($response['res[' . $key . ']'], 0, 8) == 'ZIPDATA:' && $randomiv != '') { |
|
895 | - $encrypted = substr($response['res[' . $key . ']'], 8); |
|
894 | + if (substr($response['res['.$key.']'], 0, 8) == 'ZIPDATA:' && $randomiv != '') { |
|
895 | + $encrypted = substr($response['res['.$key.']'], 8); |
|
896 | 896 | $data = openssl_decrypt($encrypted, "CHACHA20", $secret, 0, $randomiv); |
897 | 897 | if ($data !== false && substr($data, 0, strlen($token)) == $token) { |
898 | 898 | $data = substr($data, strlen($token)); |
899 | 899 | } |
900 | 900 | if (!file_exists("$zipdir/$key")) { |
901 | - mkdir("$zipdir/$key", 0755, true ); |
|
901 | + mkdir("$zipdir/$key", 0755, true); |
|
902 | 902 | } |
903 | 903 | $fileHandle = fopen("$zipdir/$key/detail.zip", "wb"); |
904 | 904 | fwrite($fileHandle, $data); |
@@ -906,7 +906,7 @@ discard block |
||
906 | 906 | } |
907 | 907 | } |
908 | 908 | $zipt = new \ZipArchive; |
909 | - $zipt->open("$zipdir/detail-" . $this->identifier . '-' .$this->institution . '.zip', \ZipArchive::CREATE); |
|
909 | + $zipt->open("$zipdir/detail-".$this->identifier.'-'.$this->institution.'.zip', \ZipArchive::CREATE); |
|
910 | 910 | $cnt = 0; |
911 | 911 | foreach ($toPost as $key => $value) { |
912 | 912 | if (file_exists("$zipdir/$key/detail.zip")) { |
@@ -918,7 +918,7 @@ discard block |
||
918 | 918 | $zipf->close(); |
919 | 919 | unlink("$zipdir/$key/detail.zip"); |
920 | 920 | $files = scandir("$zipdir/$key/"); |
921 | - foreach($files as $file) { |
|
921 | + foreach ($files as $file) { |
|
922 | 922 | if ($file == '.' || $file == '..') continue; |
923 | 923 | $data = file_get_contents("$zipdir/$key/$file"); |
924 | 924 | $zipt->addFromString("radius-$key/$file", $data); |
@@ -934,14 +934,14 @@ discard block |
||
934 | 934 | $zipt->addEmptyDir('.'); |
935 | 935 | } |
936 | 936 | $zipt->close(); |
937 | - if (file_exists("$zipdir/detail-" . $this->identifier . '-' .$this->institution . '.zip')) { |
|
938 | - $data = file_get_contents("$zipdir/detail-" . $this->identifier . '-' .$this->institution . '.zip'); |
|
939 | - unlink("$zipdir/detail-" . $this->identifier . '-' .$this->institution . '.zip'); |
|
937 | + if (file_exists("$zipdir/detail-".$this->identifier.'-'.$this->institution.'.zip')) { |
|
938 | + $data = file_get_contents("$zipdir/detail-".$this->identifier.'-'.$this->institution.'.zip'); |
|
939 | + unlink("$zipdir/detail-".$this->identifier.'-'.$this->institution.'.zip'); |
|
940 | 940 | rmdir($zipdir); |
941 | 941 | } |
942 | 942 | if ($data !== FALSE) { |
943 | 943 | header('Content-Type: application/zip'); |
944 | - header("Content-Disposition: attachment; filename=\"detail-".$this->identifier . '-' .$this->institution.".zip\""); |
|
944 | + header("Content-Disposition: attachment; filename=\"detail-".$this->identifier.'-'.$this->institution.".zip\""); |
|
945 | 945 | header("Content-Transfer-Encoding: binary"); |
946 | 946 | echo $data; |
947 | 947 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * update the local copy |
25 | 25 | */ |
26 | 26 | |
27 | -require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php"; |
|
27 | +require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php"; |
|
28 | 28 | setlocale(LC_CTYPE, "en_US.UTF-8"); |
29 | 29 | require 'config.php'; |
30 | 30 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | $this->db_ext->query("SET NAMES 'utf8'"); |
114 | 114 | $this->db_local->query("SET NAMES 'utf8mb4'"); |
115 | 115 | $result = $this->db_ext->query("SELECT * FROM $table"); |
116 | - $queryFields = implode(',', array_column($this->fields[$db][$table_name],0)); |
|
116 | + $queryFields = implode(',', array_column($this->fields[$db][$table_name], 0)); |
|
117 | 117 | while ($row = $result->fetch_assoc()) { |
118 | 118 | $v = []; |
119 | 119 | foreach ($this->fields[$db][$table_name] as $field) { |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | } |
132 | 132 | } |
133 | 133 | } |
134 | - $queryValues = implode(',',$v); |
|
134 | + $queryValues = implode(',', $v); |
|
135 | 135 | $query = "INSERT INTO $tmpTable (".$queryFields.") VALUES (".$queryValues.")"; |
136 | 136 | $this->db_local->query($query); |
137 | 137 | } |
@@ -153,9 +153,9 @@ discard block |
||
153 | 153 | $realms = explode(',', $row[1]); |
154 | 154 | foreach ($contacts as $contact) { |
155 | 155 | foreach ($realms as $realm) { |
156 | - $email = empty($contact['mail']) ? 'NULL' :'"'.$contact['mail'].'"'; |
|
157 | - $name = empty($contact['name']) ? 'NULL' :'"'.$contact['name'].'"'; |
|
158 | - $phone = empty($contact['phone']) ? 'NULL' :'"'.$contact['phone'].'"'; |
|
156 | + $email = empty($contact['mail']) ? 'NULL' : '"'.$contact['mail'].'"'; |
|
157 | + $name = empty($contact['name']) ? 'NULL' : '"'.$contact['name'].'"'; |
|
158 | + $phone = empty($contact['phone']) ? 'NULL' : '"'.$contact['phone'].'"'; |
|
159 | 159 | $id = $db == 'eduroam' ? $row[2] : '"'.$row[2].'"'; |
160 | 160 | $query = "INSERT INTO tmp_institution_admins (name, email, phone, inst_realm, $instid)" |
161 | 161 | . ' VALUES ('.$name.','.$email.','.$phone.',"'.$realm.'",'.$id.')'; |
@@ -175,9 +175,9 @@ discard block |
||
175 | 175 | } |
176 | 176 | |
177 | 177 | private function escape($inp) { |
178 | - $out=str_replace('\\','\\\\',$inp); |
|
179 | - $out=str_replace('"','\"',$out); |
|
180 | - $out=str_replace('?','\?',$out); |
|
178 | + $out = str_replace('\\', '\\\\', $inp); |
|
179 | + $out = str_replace('"', '\"', $out); |
|
180 | + $out = str_replace('?', '\?', $out); |
|
181 | 181 | $out = 'convert(cast(convert("'.$out.'" using latin1) as binary) using utf8)'; |
182 | 182 | return($out); |
183 | 183 | } |
@@ -3,7 +3,7 @@ |
||
3 | 3 | $databases = [ |
4 | 4 | 'eduroam' => "eduroam1_1_tmp", // this is the local copy of eduroam (v1) database created by update_monitor_copy.php |
5 | 5 | 'eduroamv2' => "eduroam2_1_tmp", // this is the local copy of eduroam (v2) database created by update_monitor_copy.php |
6 | - 'cat' => "cat_twoln_214_test2", // this is the curent production CAT database where we need to put in new identifiers |
|
6 | + 'cat' => "cat_twoln_214_test2", // this is the curent production CAT database where we need to put in new identifiers |
|
7 | 7 | 'eduroam_new' => "monitor_copy2_test_xxx" // this is the resulting monitor_copy database containing all data required by CAT it must exist but tables will be created by the sript |
8 | 8 | ]; |
9 | 9 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php"; |
|
3 | +require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php"; |
|
4 | 4 | setlocale(LC_CTYPE, "en_US.UTF-8"); |
5 | 5 | require 'config.php'; |
6 | 6 |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | * |
9 | 9 | */ |
10 | 10 | |
11 | -require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php"; |
|
11 | +require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php"; |
|
12 | 12 | setlocale(LC_CTYPE, "en_US.UTF-8"); |
13 | 13 | require 'config.php'; |
14 | 14 | |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | |
131 | 131 | // add CAT ids to view_active_institution2 |
132 | 132 | print "add CAT ids to view_active_institution2\n"; |
133 | -$q ="update view_active_institution2 join view_active_institution1 |
|
133 | +$q = "update view_active_institution2 join view_active_institution1 |
|
134 | 134 | on view_active_institution2.instid1=view_active_institution1.id_institution |
135 | 135 | set view_active_institution2.cat_sync_id=view_active_institution1.cat_sync_id"; |
136 | 136 | $result = $db_local->query($q); |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | public function writeInstaller() { |
61 | 61 | $installerPath = $this->installerBasename.".py"; |
62 | 62 | $this->copyFile("main.py", $installerPath); |
63 | - $installer = fopen($installerPath,"a"); |
|
63 | + $installer = fopen($installerPath, "a"); |
|
64 | 64 | if ($installer === FALSE) { |
65 | 65 | throw new Exception("Unable to open installer file for writing!"); |
66 | 66 | } |
@@ -206,11 +206,11 @@ discard block |
||
206 | 206 | $config['user_realm'] = $this->attributes['internal:realm'][0]; |
207 | 207 | } |
208 | 208 | |
209 | - if(!empty($this->attributes['internal:hint_userinput_suffix'][0]) && $this->attributes['internal:hint_userinput_suffix'][0] == 1) { |
|
209 | + if (!empty($this->attributes['internal:hint_userinput_suffix'][0]) && $this->attributes['internal:hint_userinput_suffix'][0] == 1) { |
|
210 | 210 | $configRaw['hint_user_input'] = "True"; |
211 | 211 | } |
212 | 212 | |
213 | - if(!empty($this->attributes['internal:verify_userinput_suffix'][0]) && $this->attributes['internal:verify_userinput_suffix'][0] == 1) { |
|
213 | + if (!empty($this->attributes['internal:verify_userinput_suffix'][0]) && $this->attributes['internal:verify_userinput_suffix'][0] == 1) { |
|
214 | 214 | $configRaw['verify_user_realm_input'] = "True"; |
215 | 215 | } |
216 | 216 | |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | } |
284 | 284 | $out .= "'DNS:$oneServer'"; |
285 | 285 | } |
286 | - return "[".$out. "]"; |
|
286 | + return "[".$out."]"; |
|
287 | 287 | } |
288 | 288 | |
289 | 289 | /** |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | * |
324 | 324 | * @return string |
325 | 325 | */ |
326 | - private function mkCAfile(){ |
|
326 | + private function mkCAfile() { |
|
327 | 327 | $out = ''; |
328 | 328 | $cAlist = $this->attributes['internal:CAs'][0]; |
329 | 329 | foreach ($cAlist as $oneCa) { |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | */ |
340 | 340 | private function mkIntro() { |
341 | 341 | \core\common\Entity::intoThePotatoes(); |
342 | - $out = _("This installer has been prepared for {0}").'\n\n'._("More information and comments:").'\n\nEMAIL: {1}\nWWW: {2}\n\n' . |
|
342 | + $out = _("This installer has been prepared for {0}").'\n\n'._("More information and comments:").'\n\nEMAIL: {1}\nWWW: {2}\n\n'. |
|
343 | 343 | _("Installer created with software from the GEANT project."); |
344 | 344 | \core\common\Entity::outOfThePotatoes(); |
345 | 345 | return $out; |
@@ -173,8 +173,8 @@ discard block |
||
173 | 173 | return false; |
174 | 174 | } |
175 | 175 | $entityId = $matches[1]; |
176 | - $url = \config\Diagnostics::EDUGAINRESOLVER['url'] . "?action=get_entity_name&type=idp&opt=2&e_id=$entityId"; |
|
177 | - \core\common\Logging::debug_s(4, $url, "URL: ","\n"); |
|
176 | + $url = \config\Diagnostics::EDUGAINRESOLVER['url']."?action=get_entity_name&type=idp&opt=2&e_id=$entityId"; |
|
177 | + \core\common\Logging::debug_s(4, $url, "URL: ", "\n"); |
|
178 | 178 | $ch = curl_init($url); |
179 | 179 | if ($ch === false) { |
180 | 180 | $loggerInstance->debug(2, "Unable ask eduGAIN about IdP - CURL init failed!"); |
@@ -200,10 +200,10 @@ discard block |
||
200 | 200 | return false; |
201 | 201 | } |
202 | 202 | if ($responseDetails['name'] === null) { |
203 | - \core\common\Logging::debug_s(4,"User not in eduGAIN\n"); |
|
203 | + \core\common\Logging::debug_s(4, "User not in eduGAIN\n"); |
|
204 | 204 | return false; |
205 | 205 | } |
206 | - \core\common\Logging::debug_s(4,"User in eduGAIN\n"); |
|
206 | + \core\common\Logging::debug_s(4, "User in eduGAIN\n"); |
|
207 | 207 | $_SESSION['eduGAIN'] = $responseDetails['regauth']; |
208 | 208 | return true; |
209 | 209 | } |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | * @return boolean did it work? |
244 | 244 | */ |
245 | 245 | public static function sendMailToCATadmins($subject, $content) { |
246 | - if (!isset(\config\Master::APPEARANCE['cat-admin-mail']) || \config\Master::APPEARANCE['cat-admin-mail'] === []) { |
|
246 | + if (!isset(\config\Master::APPEARANCE['cat-admin-mail']) || \config\Master::APPEARANCE['cat-admin-mail'] === []) { |
|
247 | 247 | return; |
248 | 248 | } |
249 | 249 | foreach (\config\Master::APPEARANCE['cat-admin-mail'] as $mailaddr) { |
@@ -266,8 +266,8 @@ discard block |
||
266 | 266 | common\Entity::intoThePotatoes(); |
267 | 267 | $mail = \core\common\OutsideComm::mailHandle(); |
268 | 268 | // who to whom? |
269 | - $mail->FromName = \config\Master::APPEARANCE['productname'] . " Notification System"; |
|
270 | - $mail->addReplyTo(\config\Master::APPEARANCE['support-contact']['developer-mail'], \config\Master::APPEARANCE['productname'] . " " . _("Feedback")); |
|
269 | + $mail->FromName = \config\Master::APPEARANCE['productname']." Notification System"; |
|
270 | + $mail->addReplyTo(\config\Master::APPEARANCE['support-contact']['developer-mail'], \config\Master::APPEARANCE['productname']." "._("Feedback")); |
|
271 | 271 | $mail->addAddress($mailaddr); |
272 | 272 | // what do we want to say? |
273 | 273 | $mail->Subject = $subject; |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | } |
334 | 334 | $lookFor .= "$name"; |
335 | 335 | } |
336 | - $finding = preg_match("/^(" . $lookFor . "):(.*)/", $oneRow->user_id, $matches); |
|
336 | + $finding = preg_match("/^(".$lookFor."):(.*)/", $oneRow->user_id, $matches); |
|
337 | 337 | if ($finding === 0 || $finding === false) { |
338 | 338 | return false; |
339 | 339 | } |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | $matchedProviders[] = $idp; |
353 | 353 | $name = $idp; |
354 | 354 | if ($skipCurl == 0) { |
355 | - $url = \config\Diagnostics::EDUGAINRESOLVER['url'] . "?action=get_entity_name&opt=2&type=idp&e_id=$idp&lang=$lang"; |
|
355 | + $url = \config\Diagnostics::EDUGAINRESOLVER['url']."?action=get_entity_name&opt=2&type=idp&e_id=$idp&lang=$lang"; |
|
356 | 356 | $ch = curl_init($url); |
357 | 357 | if ($ch === false) { |
358 | 358 | $loggerInstance->debug(2, "Unable ask eduGAIN about IdP - CURL init failed!"); |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | } |
378 | 378 | curl_close($ch); |
379 | 379 | } |
380 | - $listOfProviders[] = User::PROVIDER_STRINGS[$providerStrings[0]] . " - IdP: " . $name; |
|
380 | + $listOfProviders[] = User::PROVIDER_STRINGS[$providerStrings[0]]." - IdP: ".$name; |
|
381 | 381 | } |
382 | 382 | break; |
383 | 383 | case $providerStrings[2]: |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | return false; |
394 | 394 | } |
395 | 395 | } |
396 | - \core\common\Logging::debug_s(4,$listOfProviders, "PROVIDERS:\n", "\n"); |
|
396 | + \core\common\Logging::debug_s(4, $listOfProviders, "PROVIDERS:\n", "\n"); |
|
397 | 397 | return $listOfProviders; |
398 | 398 | } |
399 | 399 | } |
400 | 400 | \ No newline at end of file |
@@ -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 | } |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | // these require no further checking |
413 | 413 | foreach ($extInstListTmp as $country => $extInstCountryList) { |
414 | 414 | $len = count($extInstCountryList); |
415 | - for($i = 0; $i < $len; ++$i) { |
|
415 | + for ($i = 0; $i < $len; ++$i) { |
|
416 | 416 | $extInst = $extInstCountryList[$i]; |
417 | 417 | if ($extInst['inst_id'] != NULL && in_array($extInst['inst_id'], $this->currentInstitutions['existing'])) { |
418 | 418 | unset($extInstList[$country][$i]); |
@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | $names = $disectedNames['joint']; |
504 | 504 | $realms = ExternalEduroamDBData::dissectCollapsedInstitutionRealms($extInst['realm']); |
505 | 505 | $foundMatch = $this->checkForSimilarInstitutions($names, $realms); |
506 | - common\Logging::debug_s(4, $foundMatch, "checkForSimilarInstitutions returned: ","\n"); |
|
506 | + common\Logging::debug_s(4, $foundMatch, "checkForSimilarInstitutions returned: ", "\n"); |
|
507 | 507 | if ($foundMatch == 0) { |
508 | 508 | $this->currentInstitutions['new'][] = [$extInst['external_db_id'], $disectedNames['perlang'], $country]; |
509 | 509 | } |
@@ -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(); |
@@ -102,9 +102,9 @@ discard block |
||
102 | 102 | $idp = $validator->existingIdP($_GET['inst_id']); |
103 | 103 | // editing IdPs is done from within the popup. When we're done, send the |
104 | 104 | // user back to the popup (append the result of the operation later) |
105 | - $redirectDestination = "manageAdmins.inc.php?inst_id=" . $idp->identifier . "&"; |
|
105 | + $redirectDestination = "manageAdmins.inc.php?inst_id=".$idp->identifier."&"; |
|
106 | 106 | if (count($validAddresses) == 0) { |
107 | - header("Location: $redirectDestination" . "invitation=INVALIDSYNTAX"); |
|
107 | + header("Location: $redirectDestination"."invitation=INVALIDSYNTAX"); |
|
108 | 108 | exit(1); |
109 | 109 | } |
110 | 110 | // is the user primary admin of this IdP? |
@@ -113,13 +113,13 @@ discard block |
||
113 | 113 | $fedadmin = $userObject->isFederationAdmin($idp->federation); |
114 | 114 | // check if he is either one, if not, complain |
115 | 115 | if (!$is_owner && !$fedadmin) { |
116 | - 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>"; |
|
116 | + 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>"; |
|
117 | 117 | exit(1); |
118 | 118 | } |
119 | 119 | |
120 | 120 | $prettyprintname = $idp->name; |
121 | 121 | $newtokens = $mgmt->createTokens($fedadmin, $validAddresses, $idp); |
122 | - $loggerInstance->writeAudit($_SESSION['user'], "NEW", "IdP " . $idp->identifier . " - Token created for " . implode(",", $validAddresses)); |
|
122 | + $loggerInstance->writeAudit($_SESSION['user'], "NEW", "IdP ".$idp->identifier." - Token created for ".implode(",", $validAddresses)); |
|
123 | 123 | $introtext = "CO-ADMIN"; |
124 | 124 | $participant_type = $idp->type; |
125 | 125 | break; |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $participant_type = $validator->partType($_POST['participant_type']); |
136 | 136 | $new_idp_authorized_fedadmin = $userObject->isFederationAdmin($newcountry); |
137 | 137 | if ($new_idp_authorized_fedadmin !== TRUE) { |
138 | - 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!"); |
|
138 | + 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!"); |
|
139 | 139 | } |
140 | 140 | $federation = $validator->existingFederation($newcountry); |
141 | 141 | $prettyprintname = $newinstname; |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | // send the user back to his federation overview page, append the result of the operation later |
144 | 144 | // do the token creation magic |
145 | 145 | $newtokens = $mgmt->createTokens(TRUE, $validAddresses, $newinstname, 0, $newcountry, $participant_type); |
146 | - $loggerInstance->writeAudit($_SESSION['user'], "NEW", "ORG FUTURE - Token created for $participant_type " . implode(",", $validAddresses)); |
|
146 | + $loggerInstance->writeAudit($_SESSION['user'], "NEW", "ORG FUTURE - Token created for $participant_type ".implode(",", $validAddresses)); |
|
147 | 147 | break; |
148 | 148 | case OPERATION_MODE_NEWFROMDB: |
149 | 149 | $redirectDestination = "../overview_federation.php?"; |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | $extinfo = $catInstance->getExternalDBEntityDetails($newexternalid, strtoupper($fedId).'01'); |
158 | 158 | $new_idp_authorized_fedadmin = $userObject->isFederationAdmin($extinfo['country']); |
159 | 159 | if ($new_idp_authorized_fedadmin !== TRUE) { |
160 | - 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!"); |
|
160 | + 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!"); |
|
161 | 161 | } |
162 | 162 | $federation = $validator->existingFederation($extinfo['country']); |
163 | 163 | $newcountry = $extinfo['country']; |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | $prettyprintname = $name; |
177 | 177 | } |
178 | 178 | } |
179 | - if(\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] === 'MSP') { |
|
179 | + if (\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] === 'MSP') { |
|
180 | 180 | $participant_type = \core\IdP::TYPE_SP; |
181 | 181 | } else { |
182 | 182 | $participant_type = $extinfo['type']; |
@@ -185,14 +185,14 @@ discard block |
||
185 | 185 | $introtext = "EXISTING-FED"; |
186 | 186 | // do the token creation magic |
187 | 187 | $newtokens = $mgmt->createTokens(TRUE, $validAddresses, $prettyprintname, $newexternalid, $fedId); |
188 | - $loggerInstance->writeAudit($_SESSION['user'], "NEW", "IdP FUTURE - Token created for " . implode(",", $validAddresses)); |
|
188 | + $loggerInstance->writeAudit($_SESSION['user'], "NEW", "IdP FUTURE - Token created for ".implode(",", $validAddresses)); |
|
189 | 189 | break; |
190 | 190 | default: // includes OPERATION_MODE_INVALID |
191 | 191 | // second param is TRUE, so the variable *will* contain a string |
192 | 192 | // i.e. ignore Scrutinizer type warning later |
193 | 193 | $wrongcontent = print_r($_POST, TRUE); |
194 | 194 | echo "<pre>Wrong parameters in POST: |
195 | -" . htmlspecialchars(/** @scrutinizer ignore-type */ $wrongcontent) . " |
|
195 | +" . htmlspecialchars(/** @scrutinizer ignore-type */ $wrongcontent)." |
|
196 | 196 | </pre>"; |
197 | 197 | exit(1); |
198 | 198 | } |
@@ -217,14 +217,14 @@ discard block |
||
217 | 217 | } |
218 | 218 | |
219 | 219 | if (count($status) == 0) { |
220 | - header("Location: $redirectDestination" . "invitation=FAILURE"); |
|
220 | + header("Location: $redirectDestination"."invitation=FAILURE"); |
|
221 | 221 | exit; |
222 | 222 | } |
223 | 223 | $finalDestParams = "invitation=SUCCESS"; |
224 | 224 | if (count($status) < count($totalSegments)) { // only a subset of mails was sent, update status |
225 | 225 | $finalDestParams = "invitation=PARTIAL"; |
226 | 226 | } |
227 | -$finalDestParams .= "&successcount=" . count($status); |
|
227 | +$finalDestParams .= "&successcount=".count($status); |
|
228 | 228 | if ($allEncrypted === TRUE) { |
229 | 229 | $finalDestParams .= "&transportsecurity=ENCRYPTED"; |
230 | 230 | } elseif ($allClear === TRUE) { |
@@ -233,4 +233,4 @@ discard block |
||
233 | 233 | $finalDestParams .= "&transportsecurity=PARTIAL"; |
234 | 234 | } |
235 | 235 | |
236 | -header("Location: $redirectDestination" . $finalDestParams); |
|
236 | +header("Location: $redirectDestination".$finalDestParams); |