@@ -16,11 +16,11 @@ discard block |
||
16 | 16 | * |
17 | 17 | * @package Developer |
18 | 18 | */ |
19 | -function check_my_nonce($nonce, $optSalt='') { |
|
19 | +function check_my_nonce($nonce, $optSalt = '') { |
|
20 | 20 | $remote = filter_input(INPUT_SERVER, 'REMOTE_ADDR'); |
21 | - $lasthour = date("G")-1<0 ? date('Ymd').'23' : date("YmdG")-1; |
|
22 | - if (hash_hmac('sha256', session_id().$optSalt, date("YmdG").'1qaz2wsx3edc!QAZ@WSX#EDC'.$remote) == $nonce || |
|
23 | - hash_hmac('sha256', session_id().$optSalt, $lasthour.'1qaz2wsx3edc!QAZ@WSX#EDC'.$remote) == $nonce) { |
|
21 | + $lasthour = date("G") - 1 < 0 ? date('Ymd') . '23' : date("YmdG") - 1; |
|
22 | + if (hash_hmac('sha256', session_id() . $optSalt, date("YmdG") . '1qaz2wsx3edc!QAZ@WSX#EDC' . $remote) == $nonce || |
|
23 | + hash_hmac('sha256', session_id() . $optSalt, $lasthour . '1qaz2wsx3edc!QAZ@WSX#EDC' . $remote) == $nonce) { |
|
24 | 24 | return true; |
25 | 25 | } else { |
26 | 26 | return false; |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | foreach ($details['admins'] as $admin) { |
53 | 53 | $admins[] = $admin['email']; |
54 | 54 | } |
55 | - $details['admins'] = base64_encode(join(',',$admins)); |
|
55 | + $details['admins'] = base64_encode(join(',', $admins)); |
|
56 | 56 | } else { |
57 | 57 | $details['admins'] = ''; |
58 | 58 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $details = $cat->getExternalDBEntityDetails($realmOu); |
87 | 87 | if (!empty($details)) { |
88 | 88 | $returnArray['status'] = 1; |
89 | - $returnArray['realms'] = explode(',',$details['realmlist']); |
|
89 | + $returnArray['realms'] = explode(',', $details['realmlist']); |
|
90 | 90 | } |
91 | 91 | } |
92 | 92 | } |
@@ -56,34 +56,34 @@ |
||
56 | 56 | // let's start the numbering at 1 |
57 | 57 | $this->qaArray = [ |
58 | 58 | 1 => ["AREA" => AbstractTest::INFRA_DEVICE, |
59 | - "TXT" => _("Have you ever used the network succesfully, e.g. at your home institution without roaming?"), |
|
60 | - "FACTOR" => 0.5, |
|
61 | - "VERDICTLECTURE" => sprintf(_("If your device has never worked before with this setup, then very likely your device configuation is wrong. %s"), $confAssistantText)], |
|
59 | + "TXT" => _("Have you ever used the network succesfully, e.g. at your home institution without roaming?"), |
|
60 | + "FACTOR" => 0.5, |
|
61 | + "VERDICTLECTURE" => sprintf(_("If your device has never worked before with this setup, then very likely your device configuation is wrong. %s"), $confAssistantText)], |
|
62 | 62 | 2 => ["AREA" => AbstractTest::INFRA_DEVICE, |
63 | - "TXT" => _("Did the device previously work when roaming, i.e. at other hotspots away from your home institution?"), |
|
64 | - "FACTOR" => 0.33, |
|
65 | - "VERDICTLECTURE" => sprintf(_("If roaming consistently does not work, then very likely your device configuration is wrong. Typical errors causing this symptom include: using a routing ('outer') username without the @realm.tld suffix - those potentially work at home, but can not be used when roaming. %s"),$confAssistantText)], |
|
63 | + "TXT" => _("Did the device previously work when roaming, i.e. at other hotspots away from your home institution?"), |
|
64 | + "FACTOR" => 0.33, |
|
65 | + "VERDICTLECTURE" => sprintf(_("If roaming consistently does not work, then very likely your device configuration is wrong. Typical errors causing this symptom include: using a routing ('outer') username without the @realm.tld suffix - those potentially work at home, but can not be used when roaming. %s"),$confAssistantText)], |
|
66 | 66 | 3 => ["AREA" => AbstractTest::INFRA_DEVICE, |
67 | - "TXT" => _("Did you recently change the configuration on your device?"), |
|
68 | - "FACTOR" => 3, |
|
69 | - "VERDICTLECTURE" => _("Accounts only need to be configured once, and can then be used anywhere on the planet without any changes. If you recently changed the configuration, that change may very well be at fault. You should never change your network configuration unless explicitly instructed so by your Identity Provider; even in the case of temporary login issues.")], |
|
67 | + "TXT" => _("Did you recently change the configuration on your device?"), |
|
68 | + "FACTOR" => 3, |
|
69 | + "VERDICTLECTURE" => _("Accounts only need to be configured once, and can then be used anywhere on the planet without any changes. If you recently changed the configuration, that change may very well be at fault. You should never change your network configuration unless explicitly instructed so by your Identity Provider; even in the case of temporary login issues.")], |
|
70 | 70 | 4 => ["AREA" => AbstractTest::INFRA_DEVICE, |
71 | - "TXT" => _("Do your other devices still work?"), |
|
72 | - "VERDICTLECTURE" => _("If all devices stopped working simultaneously, there may be a problem with your account as such. Maybe your account expired, or you were forced to change the password? These questions are best answered by your Identity Provider [MGW: display contact info]"), |
|
73 | - "FACTOR" => 0.33], |
|
71 | + "TXT" => _("Do your other devices still work?"), |
|
72 | + "VERDICTLECTURE" => _("If all devices stopped working simultaneously, there may be a problem with your account as such. Maybe your account expired, or you were forced to change the password? These questions are best answered by your Identity Provider [MGW: display contact info]"), |
|
73 | + "FACTOR" => 0.33], |
|
74 | 74 | 5 => ["AREA" => AbstractTest::INFRA_SP_80211, |
75 | - "TXT" => _("Is the place you are currently at heavily crowded, or is a network-intensive workload going on?"), |
|
76 | - "FACTOR" => 3, |
|
77 | - "VERDICTLECTURE" => _("The network is likely overloaded at this location and point in time. You may have to wait until later before you get a better connectivity. If you think the network should be reinforced for more capacity at this place, you should inform the hotspot provider. [MGW: add contact info]")], |
|
75 | + "TXT" => _("Is the place you are currently at heavily crowded, or is a network-intensive workload going on?"), |
|
76 | + "FACTOR" => 3, |
|
77 | + "VERDICTLECTURE" => _("The network is likely overloaded at this location and point in time. You may have to wait until later before you get a better connectivity. If you think the network should be reinforced for more capacity at this place, you should inform the hotspot provider. [MGW: add contact info]")], |
|
78 | 78 | 6 => ["AREA" => AbstractTest::INFRA_SP_80211, |
79 | - "TXT" => _("Does the connection get better when you move around?"), |
|
80 | - "FACTOR" => 3, |
|
81 | - "VERDICTLECTURE" => _("You should move to a different location to achieve better network coverage and service. If you think the exact spot you are at deserves better coverage, you should inform the hotspot provider. [MGW: add contact info]")], |
|
79 | + "TXT" => _("Does the connection get better when you move around?"), |
|
80 | + "FACTOR" => 3, |
|
81 | + "VERDICTLECTURE" => _("You should move to a different location to achieve better network coverage and service. If you think the exact spot you are at deserves better coverage, you should inform the hotspot provider. [MGW: add contact info]")], |
|
82 | 82 | |
83 | 83 | 7 => ["AREA" => AbstractTest::INFRA_SP_LAN, |
84 | - "TXT" => _("Do you see errors stating something similar to 'Unable to get IP address'?"), |
|
85 | - "FACTOR" => 3, |
|
86 | - "VERDICTLECTURE" => _("The evidence at hand suggests that there may be an infrastructure problem at this particular hotspot provider. There is nothing you can do to solve this problem locally. Please be patient and try again at a later time.")], |
|
84 | + "TXT" => _("Do you see errors stating something similar to 'Unable to get IP address'?"), |
|
85 | + "FACTOR" => 3, |
|
86 | + "VERDICTLECTURE" => _("The evidence at hand suggests that there may be an infrastructure problem at this particular hotspot provider. There is nothing you can do to solve this problem locally. Please be patient and try again at a later time.")], |
|
87 | 87 | ]; |
88 | 88 | } |
89 | 89 |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | 2 => ["AREA" => AbstractTest::INFRA_DEVICE, |
63 | 63 | "TXT" => _("Did the device previously work when roaming, i.e. at other hotspots away from your home institution?"), |
64 | 64 | "FACTOR" => 0.33, |
65 | - "VERDICTLECTURE" => sprintf(_("If roaming consistently does not work, then very likely your device configuration is wrong. Typical errors causing this symptom include: using a routing ('outer') username without the @realm.tld suffix - those potentially work at home, but can not be used when roaming. %s"),$confAssistantText)], |
|
65 | + "VERDICTLECTURE" => sprintf(_("If roaming consistently does not work, then very likely your device configuration is wrong. Typical errors causing this symptom include: using a routing ('outer') username without the @realm.tld suffix - those potentially work at home, but can not be used when roaming. %s"), $confAssistantText)], |
|
66 | 66 | 3 => ["AREA" => AbstractTest::INFRA_DEVICE, |
67 | 67 | "TXT" => _("Did you recently change the configuration on your device?"), |
68 | 68 | "FACTOR" => 3, |
@@ -100,12 +100,12 @@ discard block |
||
100 | 100 | $questionDetails = $this->qaArray[$questionNumber]; |
101 | 101 | if ($answer === TRUE) { |
102 | 102 | $this->possibleFailureReasons[$questionDetails['AREA']] = $this->possibleFailureReasons[$questionDetails['AREA']] * $questionDetails["FACTOR"]; |
103 | - $this->loggerInstance->debug(3,"Adjusting ".$questionDetails['AREA']." by ".$questionDetails["FACTOR"]."\n"); |
|
103 | + $this->loggerInstance->debug(3, "Adjusting " . $questionDetails['AREA'] . " by " . $questionDetails["FACTOR"] . "\n"); |
|
104 | 104 | $factor = $questionDetails["FACTOR"]; |
105 | 105 | } elseif ($answer === FALSE) { |
106 | 106 | $this->possibleFailureReasons[$questionDetails['AREA']] = $this->possibleFailureReasons[$questionDetails['AREA']] / $questionDetails["FACTOR"]; |
107 | - $this->loggerInstance->debug(3,"Adjusting ".$questionDetails['AREA']." by 1/".$questionDetails["FACTOR"]."\n"); |
|
108 | - $factor = 1/$questionDetails["FACTOR"]; |
|
107 | + $this->loggerInstance->debug(3, "Adjusting " . $questionDetails['AREA'] . " by 1/" . $questionDetails["FACTOR"] . "\n"); |
|
108 | + $factor = 1 / $questionDetails["FACTOR"]; |
|
109 | 109 | } else { |
110 | 110 | $factor = 1; |
111 | 111 | } |
@@ -114,8 +114,8 @@ discard block |
||
114 | 114 | $this->additionalFindings["QUESTIONSASKED"] = $this->previousQuestions; |
115 | 115 | $_SESSION["SUSPECTS"] = $this->possibleFailureReasons; |
116 | 116 | $_SESSION["EVIDENCE"] = $this->additionalFindings; |
117 | - $this->loggerInstance->debug(3,$_SESSION['SUSPECTS']); |
|
118 | - $this->loggerInstance->debug(3,$_SESSION['EVIDENCE']); |
|
117 | + $this->loggerInstance->debug(3, $_SESSION['SUSPECTS']); |
|
118 | + $this->loggerInstance->debug(3, $_SESSION['EVIDENCE']); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | /** |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | // if both are identical, take any of the questions in the pool of both |
135 | 135 | foreach ($this->qaArray as $questionNumber => $questionDetails) { |
136 | 136 | // if we find a question we didn't ask before AND it is related to our currently high-scoring problem area, ask it |
137 | - if (!array_key_exists($questionNumber, $this->previousQuestions) && ( $questionDetails["AREA"] == $highestCategory || $questionDetails["AREA"] == $nextCategory) ) { |
|
137 | + if (!array_key_exists($questionNumber, $this->previousQuestions) && ($questionDetails["AREA"] == $highestCategory || $questionDetails["AREA"] == $nextCategory)) { |
|
138 | 138 | return json_encode(["NEXTEXISTS" => TRUE, "NUMBER" => $questionNumber, "TEXT" => $questionDetails["TXT"]]); |
139 | 139 | } |
140 | 140 | } |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | * @return string JSON encoded array with all the info we have |
148 | 148 | */ |
149 | 149 | public function getCurrentGuessState() { |
150 | - return json_encode([ "SUSPECTS" => $this->possibleFailureReasons, "EVIDENCE" => $this->additionalFindings ]); |
|
150 | + return json_encode(["SUSPECTS" => $this->possibleFailureReasons, "EVIDENCE" => $this->additionalFindings]); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | /** |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | $text = $this->genericVerdictTexts[$area]; |
160 | 160 | foreach ($this->previousQuestions as $number => $factor) { |
161 | 161 | if ($this->qaArray[$number]["AREA"] == $area && $factor > 1) { |
162 | - $text .= "\n\n".$this->qaArray[$number]["VERDICTLECTURE"]; |
|
162 | + $text .= "\n\n" . $this->qaArray[$number]["VERDICTLECTURE"]; |
|
163 | 163 | } |
164 | 164 | } |
165 | 165 | return $text; |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $dummy_inst1 = _("identity provider"); |
48 | 48 | $dummy_inst2 = _("organisation"); |
49 | 49 | // and do something useless with the strings so that there's no "unused" complaint |
50 | - if ( $dummy_NRO . $dummy_inst1 . $dummy_inst2 == "") { |
|
50 | + if ($dummy_NRO . $dummy_inst1 . $dummy_inst2 == "") { |
|
51 | 51 | // Oh well. |
52 | 52 | } |
53 | 53 | $this->nomenclature_fed = _(CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_federation']); |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | } |
187 | 187 | break; |
188 | 188 | case "boolean": |
189 | - $retval .= "<tr><td>" . $this->displayName($option['name']) . "</td><td>$language</td><td><strong>" . ($content == "on" ? _("on") : _("off") ) . "</strong></td></tr>"; |
|
189 | + $retval .= "<tr><td>" . $this->displayName($option['name']) . "</td><td>$language</td><td><strong>" . ($content == "on" ? _("on") : _("off")) . "</strong></td></tr>"; |
|
190 | 190 | break; |
191 | 191 | default: |
192 | 192 | $retval .= "<tr><td>" . $this->displayName($option['name']) . "</td><td>$language</td><td><strong>$content</strong></td></tr>"; |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | |
314 | 314 | private function checkROWIDpresence($reference) { |
315 | 315 | $found = preg_match("/^ROWID-.*/", $reference); |
316 | - if ($found != 1) { // get excited on not-found AND on execution error |
|
316 | + if ($found != 1) { // get excited on not-found AND on execution error |
|
317 | 317 | throw new Exception("Error, ROWID expected."); |
318 | 318 | } |
319 | 319 | } |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | |
337 | 337 | $details['name'] = preg_replace('/(.)\/(.)/', "$1<br/>$2", $details['name']); |
338 | 338 | $details['name'] = preg_replace('/\//', "", $details['name']); |
339 | - $certstatus = ( $details['root'] == 1 ? "R" : "I"); |
|
339 | + $certstatus = ($details['root'] == 1 ? "R" : "I"); |
|
340 | 340 | if ($details['ca'] == 0 && $details['root'] != 1) { |
341 | 341 | return "<div class='ca-summary' style='background-color:red'><div style='position:absolute; right: 0px; width:20px; height:20px; background-color:maroon; border-radius:10px; text-align: center;'><div style='padding-top:3px; font-weight:bold; color:#ffffff;'>S</div></div>" . _("This is a <strong>SERVER</strong> certificate!") . "<br/>" . $details['name'] . "</div>"; |
342 | 342 | } |
@@ -59,12 +59,12 @@ discard block |
||
59 | 59 | */ |
60 | 60 | |
61 | 61 | /** |
62 | - * Various paths. |
|
63 | - * eapol_test: absolute path to the eapol_test executable. If you just fill in "eapol_test" the one from the system $PATH will be taken. |
|
64 | - * c_rehash: absolute path to the c_rehash executable. If you just fill in "c_rehash" the one from the system $PATH will be taken. |
|
65 | - * See also NSIS_VERSION further down |
|
66 | - * @var array |
|
67 | - */ |
|
62 | + * Various paths. |
|
63 | + * eapol_test: absolute path to the eapol_test executable. If you just fill in "eapol_test" the one from the system $PATH will be taken. |
|
64 | + * c_rehash: absolute path to the c_rehash executable. If you just fill in "c_rehash" the one from the system $PATH will be taken. |
|
65 | + * See also NSIS_VERSION further down |
|
66 | + * @var array |
|
67 | + */ |
|
68 | 68 | 'PATHS' => [ |
69 | 69 | 'c_rehash' => 'c_rehash', |
70 | 70 | 'eapol_test' => 'eapol_test', |
@@ -101,45 +101,45 @@ discard block |
||
101 | 101 | ], |
102 | 102 | |
103 | 103 | 'TLS-clientcerts' => [ |
104 | - 'CA1' => [ |
|
104 | + 'CA1' => [ |
|
105 | 105 | 'status' => 'ACCREDITED', |
106 | 106 | 'issuerCA' => '/DC=org/DC=pki1/CN=PKI 1', |
107 | 107 | 'certificates' => [ |
108 | - [ |
|
108 | + [ |
|
109 | 109 | 'status' => 'CORRECT', |
110 | 110 | 'public' => 'ca1-client-cert.pem', |
111 | 111 | 'private' => 'ca1-client-key.pem', |
112 | 112 | 'expected' => 'PASS'], |
113 | - [ |
|
113 | + [ |
|
114 | 114 | 'status' => 'WRONGPOLICY', |
115 | 115 | 'public' => 'ca1-nopolicy-cert.pem', |
116 | 116 | 'private' => 'ca1-nopolicy-key.key', |
117 | 117 | 'expected' => 'FAIL'], |
118 | - [ |
|
118 | + [ |
|
119 | 119 | 'status' => 'EXPIRED', |
120 | 120 | 'public' => 'ca1-exp.pem', |
121 | 121 | 'private' => 'ca1-exp.key', |
122 | 122 | 'expected' => 'FAIL'], |
123 | - [ |
|
123 | + [ |
|
124 | 124 | 'status' => 'REVOKED', |
125 | 125 | 'public' => 'ca1-revoked.pem', |
126 | 126 | 'private' => 'ca1-revoked.key', |
127 | 127 | 'expected' => 'FAIL'], |
128 | 128 | ] |
129 | - ], |
|
130 | - 'CA-N' => [ |
|
129 | + ], |
|
130 | + 'CA-N' => [ |
|
131 | 131 | 'status' => 'NONACCREDITED', |
132 | 132 | 'issuerCA' => '/DC=org/DC=pkiN/CN=PKI N', |
133 | 133 | 'certificates' => [ |
134 | - [ |
|
134 | + [ |
|
135 | 135 | 'status' => 'CORRECT', |
136 | 136 | 'public' => 'caN-client-cert.pem', |
137 | 137 | 'private' => 'caN-client-cert.key', |
138 | 138 | 'expected' => 'FAIL'], |
139 | - ] |
|
140 | - ] |
|
141 | - ], |
|
142 | - 'accreditedCAsURL' => '', |
|
139 | + ] |
|
140 | + ] |
|
141 | + ], |
|
142 | + 'accreditedCAsURL' => '', |
|
143 | 143 | ], |
144 | 144 | 'eduGainResolver' => [ |
145 | 145 | 'url' => 'https://technical.edugain.org/api.php', |
@@ -24,7 +24,7 @@ |
||
24 | 24 | |
25 | 25 | // if we have a pushed close button, submit attributes and send user back to the overview page |
26 | 26 | // if external DB sync is disabled globally, the user never gets to this page. If he came here *anyway* -> send him back immediately. |
27 | -if ((isset($_POST['submitbutton']) && $_POST['submitbutton'] == web\lib\common\FormElements::BUTTON_CLOSE ) || CONFIG['DB']['enforce-external-sync'] == FALSE) { |
|
27 | +if ((isset($_POST['submitbutton']) && $_POST['submitbutton'] == web\lib\common\FormElements::BUTTON_CLOSE) || CONFIG['DB']['enforce-external-sync'] == FALSE) { |
|
28 | 28 | header("Location: ../overview_federation.php"); |
29 | 29 | exit; |
30 | 30 | } |
@@ -159,7 +159,7 @@ |
||
159 | 159 | |
160 | 160 | echo "</td> |
161 | 161 | <td> |
162 | - <form action='inc/manageAdmins.inc.php?inst_id=" . $my_inst->identifier . "' method='post' " . ( $oneowner['ID'] != $_SESSION['user'] ? "onsubmit='popupRedirectWindow(this); return false;'" : "" ) . " accept-charset='UTF-8'> |
|
162 | + <form action='inc/manageAdmins.inc.php?inst_id=" . $my_inst->identifier . "' method='post' " . ($oneowner['ID'] != $_SESSION['user'] ? "onsubmit='popupRedirectWindow(this); return false;'" : "") . " accept-charset='UTF-8'> |
|
163 | 163 | <input type='hidden' name='admin_id' value='" . $oneowner['ID'] . "'></input> |
164 | 164 | <button type='submit' name='submitbutton' class='delete' value='" . web\lib\common\FormElements::BUTTON_DELETE . "'>" . _("Delete Administrator") . "</button> |
165 | 165 | </form> |
@@ -191,7 +191,7 @@ |
||
191 | 191 | case "SILVERBULLET": |
192 | 192 | $theProfile = new ProfileSilverbullet($identifier, $this); |
193 | 193 | $theProfile->addSupportedEapMethod(new \core\common\EAP(\core\common\EAP::EAPTYPE_SILVERBULLET), 1); |
194 | - $theProfile->setRealm($this->identifier."-".$theProfile->identifier."." . strtolower($this->federation) . strtolower(CONFIG_CONFASSISTANT['SILVERBULLET']['realm_suffix'])); |
|
194 | + $theProfile->setRealm($this->identifier . "-" . $theProfile->identifier . "." . strtolower($this->federation) . strtolower(CONFIG_CONFASSISTANT['SILVERBULLET']['realm_suffix'])); |
|
195 | 195 | return $theProfile; |
196 | 196 | default: |
197 | 197 | throw new Exception("This type of profile is unknown and can not be added."); |
@@ -155,12 +155,12 @@ |
||
155 | 155 | * @return bool TRUE if this user is an admin with FED-level blessing |
156 | 156 | */ |
157 | 157 | public function isPrimaryOwner($user) { |
158 | - foreach ($this->listOwners() as $oneOwner) { |
|
159 | - if ($oneOwner['ID'] == $user && $oneOwner['LEVEL'] == "FED") { |
|
160 | - return TRUE; |
|
161 | - } |
|
162 | - } |
|
163 | - return FALSE; |
|
158 | + foreach ($this->listOwners() as $oneOwner) { |
|
159 | + if ($oneOwner['ID'] == $user && $oneOwner['LEVEL'] == "FED") { |
|
160 | + return TRUE; |
|
161 | + } |
|
162 | + } |
|
163 | + return FALSE; |
|
164 | 164 | } |
165 | 165 | |
166 | 166 | /** |
@@ -175,11 +175,11 @@ discard block |
||
175 | 175 | public function invitationMailBody($invitationLink) { |
176 | 176 | $text = _("Hello!"); |
177 | 177 | $text .= "\n\n"; |
178 | - $text .= sprintf(_("A new %s access credential has been created for you by your network administrator."),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']); |
|
178 | + $text .= sprintf(_("A new %s access credential has been created for you by your network administrator."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']); |
|
179 | 179 | $text .= " "; |
180 | 180 | $text .= sprintf(_("Please follow the following link with the device you want to enable for %s to get a custom %s installation program just for you. You can click on the link, copy and paste it into a browser or scan the attached QR code."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']); |
181 | 181 | $text .= "\n\n$invitationLink\n\n"; // gets replaced with the token value by getBody() |
182 | - $text .= sprintf(_("Please keep this email or bookmark this link for future use. After picking up your %s installation program, you can use the same link to get status information about your %s account."),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']); |
|
182 | + $text .= sprintf(_("Please keep this email or bookmark this link for future use. After picking up your %s installation program, you can use the same link to get status information about your %s account."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']); |
|
183 | 183 | $text .= "\n\n"; |
184 | 184 | $text .= _("Regards,"); |
185 | 185 | $text .= "\n\n"; |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | $indexStatement = "$certstatus\t$expiryIndexTxt\t" . ($certstatus == "R" ? "$nowIndexTxt,unspecified" : "") . "\t$serialHex\tunknown\t/O=" . CONFIG_CONFASSISTANT['CONSORTIUM']['name'] . "/OU=$federation/CN=$cn/emailAddress=$cn\n"; |
463 | 463 | $logHandle->debug(4, "index.txt contents-to-be: $indexStatement"); |
464 | 464 | if (!file_put_contents($tempdir . "/index.txt", $indexStatement)) { |
465 | - $logHandle->debug(1,"Unable to write openssl index.txt file for revocation handling!"); |
|
465 | + $logHandle->debug(1, "Unable to write openssl index.txt file for revocation handling!"); |
|
466 | 466 | } |
467 | 467 | // index.txt.attr is dull but needs to exist |
468 | 468 | file_put_contents($tempdir . "/index.txt.attr", "unique_subject = yes\n"); |
@@ -572,7 +572,7 @@ discard block |
||
572 | 572 | if ($invitationsResult->num_rows == 0) { |
573 | 573 | $loggerInstance->debug(2, "Token $tokenvalue not found in database or database query error!\n"); |
574 | 574 | return ["status" => self::SB_TOKENSTATUS_INVALID, |
575 | - "cert_status" => [],]; |
|
575 | + "cert_status" => [], ]; |
|
576 | 576 | } |
577 | 577 | // if not returned, we found the token in the DB |
578 | 578 | $invitationRow = mysqli_fetch_object(/** @scrutinizer ignore-type */ $invitationsResult); |
@@ -742,7 +742,7 @@ discard block |
||
742 | 742 | throw new Exception("Impossible: the string ends with '/admin' but it's not possible to cut six characters from the end?!"); |
743 | 743 | } |
744 | 744 | } |
745 | - $link .= '/accountstatus/accountstatus.php?token='.$token; |
|
745 | + $link .= '/accountstatus/accountstatus.php?token=' . $token; |
|
746 | 746 | return $link; |
747 | 747 | } |
748 | 748 |
@@ -254,7 +254,7 @@ |
||
254 | 254 | * create a CSR |
255 | 255 | * |
256 | 256 | * @param resource $privateKey the private key to create the CSR with |
257 | - * @return array with the CSR and some meta info |
|
257 | + * @return integer with the CSR and some meta info |
|
258 | 258 | */ |
259 | 259 | private function generateCsr($privateKey) { |
260 | 260 | // token leads us to the NRO, to set the OU property of the cert |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | <div class='infobox' style='text-align:center;'> |
57 | 57 | <h2><?php echo sprintf(_("QR Code for %s download area"), $uiElements->nomenclature_inst); ?></h2> |
58 | 58 | <?php |
59 | - $displayurl = ( isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on" ? 'https://' : 'http://') . $_SERVER['SERVER_NAME'] . dirname(dirname($_SERVER['SCRIPT_NAME'])) . "?idp=" . $my_inst->identifier; |
|
59 | + $displayurl = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on" ? 'https://' : 'http://') . $_SERVER['SERVER_NAME'] . dirname(dirname($_SERVER['SCRIPT_NAME'])) . "?idp=" . $my_inst->identifier; |
|
60 | 60 | $uri = "data:image/png;base64," . base64_encode($uiElements->pngInjectConsortiumLogo(QRcode::png($displayurl, FALSE, QR_ECLEVEL_Q, QRCODE_PIXELS_PER_SYMBOL), QRCODE_PIXELS_PER_SYMBOL)); |
61 | 61 | $size = getimagesize($uri); |
62 | 62 | echo "<img width='" . ($size[0] / 4) . "' height='" . ($size[1] / 4) . "' src='$uri' alt='QR-code'/>"; |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | </td> |
94 | 94 | <td> |
95 | 95 | <form action='edit_idp_result.php?inst_id=<?php echo $my_inst->identifier; ?>' method='post' accept-charset='UTF-8'> |
96 | - <button class='delete' type='submit' name='submitbutton' value='<?php echo web\lib\common\FormElements::BUTTON_DELETE; ?>' onclick="return confirm('<?php echo ( CONFIG_CONFASSISTANT['CONSORTIUM']['selfservice_registration'] === NULL ? sprintf(_("After deleting the IdP, you can not recreate it yourself - you need a new invitation token from the %s administrator!"), $uiElements->nomenclature_fed) . " " : "" ) . sprintf(_("Do you really want to delete your %s %s?"), $uiElements->nomenclature_inst, $my_inst->name); ?>')"><?php echo sprintf(_("Delete %s"), $uiElements->nomenclature_inst); ?></button> |
|
96 | + <button class='delete' type='submit' name='submitbutton' value='<?php echo web\lib\common\FormElements::BUTTON_DELETE; ?>' onclick="return confirm('<?php echo (CONFIG_CONFASSISTANT['CONSORTIUM']['selfservice_registration'] === NULL ? sprintf(_("After deleting the IdP, you can not recreate it yourself - you need a new invitation token from the %s administrator!"), $uiElements->nomenclature_fed) . " " : "") . sprintf(_("Do you really want to delete your %s %s?"), $uiElements->nomenclature_inst, $my_inst->name); ?>')"><?php echo sprintf(_("Delete %s"), $uiElements->nomenclature_inst); ?></button> |
|
97 | 97 | </form> |
98 | 98 | |
99 | 99 | </td> |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | if ($readonly === FALSE) { |
182 | 182 | ?> |
183 | 183 | <form action='edit_silverbullet.php?inst_id=<?php echo $my_inst->identifier; ?>&profile_id=<?php echo $profile_list->identifier; ?>' method='POST'> |
184 | - <button <?php echo ( is_array($completeness) ? "disabled" : "" ); ?> type='submit' name='sb_action' value='sb_edit'><?php echo _("Manage User Base"); ?></button> |
|
184 | + <button <?php echo (is_array($completeness) ? "disabled" : ""); ?> type='submit' name='sb_action' value='sb_edit'><?php echo _("Manage User Base"); ?></button> |
|
185 | 185 | </form> |
186 | 186 | <?php |
187 | 187 | } |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | if (isset($URL['device-specific:redirect'])) { |
316 | 316 | $displayurl = $URL['device-specific:redirect'][0]; |
317 | 317 | } else { |
318 | - $displayurl = ( isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on" ? 'https://' : 'http://') . $_SERVER['SERVER_NAME'] . dirname(dirname($_SERVER['SCRIPT_NAME'])) . "?idp=" . $my_inst->identifier . "&profile=" . $profile_list->identifier; |
|
318 | + $displayurl = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on" ? 'https://' : 'http://') . $_SERVER['SERVER_NAME'] . dirname(dirname($_SERVER['SCRIPT_NAME'])) . "?idp=" . $my_inst->identifier . "&profile=" . $profile_list->identifier; |
|
319 | 319 | } |
320 | 320 | echo "<a href='$displayurl' style='white-space: nowrap; text-align: center;'>"; |
321 | 321 | $uri = "data:image/png;base64," . base64_encode($uiElements->pngInjectConsortiumLogo(QRcode::png($displayurl, FALSE, QR_ECLEVEL_Q, QRCODE_PIXELS_PER_SYMBOL), QRCODE_PIXELS_PER_SYMBOL)); |