@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | namespace core\common; |
12 | 12 | use \Exception; |
13 | 13 | |
14 | -require_once(dirname(dirname(__DIR__))."/config/_config.php"); |
|
14 | +require_once(dirname(dirname(__DIR__)) . "/config/_config.php"); |
|
15 | 15 | |
16 | 16 | class Logging { |
17 | 17 | |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | echo " ($category) "; |
87 | 87 | echo " " . $user . ": "; |
88 | 88 | if (is_string($message)) { |
89 | - echo $message ."\n"; |
|
89 | + echo $message . "\n"; |
|
90 | 90 | } else { |
91 | 91 | var_export($message); |
92 | 92 | } |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | "row" => $attributeQuery->row, |
177 | 177 | "flag" => $optinfo['flag'], |
178 | 178 | "device" => ($devicesOrEAPMethods == "DEVICES" ? $attributeQuery->deviceormethod : NULL), |
179 | - "eapmethod" => ($devicesOrEAPMethods == "DEVICES" ? 0 : (new \core\common\EAP($attributeQuery->deviceormethod))->getArrayRep() )]; |
|
179 | + "eapmethod" => ($devicesOrEAPMethods == "DEVICES" ? 0 : (new \core\common\EAP($attributeQuery->deviceormethod))->getArrayRep())]; |
|
180 | 180 | } |
181 | 181 | return $temparray; |
182 | 182 | } |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | */ |
277 | 277 | public function setRealmCheckUser($shallwe, $localpart = NULL) { |
278 | 278 | $this->databaseHandle->exec("UPDATE profile SET checkuser_outer = " . ($shallwe === true ? "1" : "0") . |
279 | - ( $localpart !== NULL ? ", checkuser_value = '$localpart' " : "") . |
|
279 | + ($localpart !== NULL ? ", checkuser_value = '$localpart' " : "") . |
|
280 | 280 | " WHERE profile_id = $this->identifier"); |
281 | 281 | } |
282 | 282 |
@@ -276,9 +276,9 @@ |
||
276 | 276 | $retval = []; |
277 | 277 | $invitations = $this->databaseHandle->exec("SELECT cat_institution_id, country, name, invite_issuer_level, invite_dest_mail, invite_token |
278 | 278 | FROM invitations |
279 | - WHERE cat_institution_id " . ( $idpIdentifier != 0 ? "= $idpIdentifier" : "IS NULL") . " AND invite_created >= TIMESTAMPADD(DAY, -1, NOW()) AND used = 0"); |
|
279 | + WHERE cat_institution_id " . ($idpIdentifier != 0 ? "= $idpIdentifier" : "IS NULL") . " AND invite_created >= TIMESTAMPADD(DAY, -1, NOW()) AND used = 0"); |
|
280 | 280 | // SELECT -> resource, not boolean |
281 | - $this->loggerInstance->debug(4, "Retrieving pending invitations for " . ($idpIdentifier != 0 ? "IdP $idpIdentifier" : "IdPs awaiting initial creation" ) . ".\n"); |
|
281 | + $this->loggerInstance->debug(4, "Retrieving pending invitations for " . ($idpIdentifier != 0 ? "IdP $idpIdentifier" : "IdPs awaiting initial creation") . ".\n"); |
|
282 | 282 | while ($invitationQuery = mysqli_fetch_object(/** @scrutinizer ignore-type */ $invitations)) { |
283 | 283 | $retval[] = ["country" => $invitationQuery->country, "name" => $invitationQuery->name, "mail" => $invitationQuery->invite_dest_mail, "token" => $invitationQuery->invite_token]; |
284 | 284 | } |
@@ -188,11 +188,11 @@ discard block |
||
188 | 188 | $logoCount = count($logosToPlace); |
189 | 189 | if ($logoCount > 0) { |
190 | 190 | $voffset = $freeTop; |
191 | - $freeSpace = (int)round($this->background['freeHeight'] / ($logoCount + 1)); |
|
191 | + $freeSpace = (int) round($this->background['freeHeight'] / ($logoCount + 1)); |
|
192 | 192 | foreach ($logosToPlace as $logo) { |
193 | 193 | $voffset += $freeSpace; |
194 | 194 | $logoSize = $logo->getImageGeometry(); |
195 | - $hoffset = (int)round(($bgImageSize['width'] - $logoSize['width']) / 2); |
|
195 | + $hoffset = (int) round(($bgImageSize['width'] - $logoSize['width']) / 2); |
|
196 | 196 | $bgImage->compositeImage($logo, $logo->getImageCompose(), $hoffset, $voffset); |
197 | 197 | $voffset += $logoSize['height']; |
198 | 198 | } |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | $fcontents .= "\n" . '!define USER_GROUP "' . $this->translateString(str_replace('"', '$\\"', $attr['profile:name'][0]), $this->codePage) . '" |
233 | 233 | '; |
234 | 234 | } |
235 | - $fcontents .= ' |
|
235 | + $fcontents .= ' |
|
236 | 236 | Caption "' . $this->translateString(sprintf(WindowsCommon::sprint_nsi(_("%s installer for %s")), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $attr['general:instname'][0]), $this->codePage) . '" |
237 | 237 | !define APPLICATION "' . $this->translateString(sprintf(WindowsCommon::sprint_nsi(_("%s installer for %s")), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $attr['general:instname'][0]), $this->codePage) . '" |
238 | 238 | !define VERSION "' . \core\CAT::VERSION_MAJOR . '.' . \core\CAT::VERSION_MINOR . '" |
@@ -241,8 +241,8 @@ discard block |
||
241 | 241 | !define LOCALE "' . preg_replace('/\..*$/', '', CONFIG['LANGUAGES'][$this->languageInstance->getLang()]['locale']) . '" |
242 | 242 | ;-------------------------------- |
243 | 243 | !define ORGANISATION "' . $this->translateString($attr['general:instname'][0], $this->codePage) . '" |
244 | -!define SUPPORT "' . ((isset($attr['support:email'][0]) && $attr['support:email'][0] ) ? $attr['support:email'][0] : $this->translateString($this->support_email_substitute, $this->codePage)) . '" |
|
245 | -!define URL "' . ((isset($attr['support:url'][0]) && $attr['support:url'][0] ) ? $attr['support:url'][0] : $this->translateString($this->support_url_substitute, $this->codePage)) . '" |
|
244 | +!define SUPPORT "' . ((isset($attr['support:email'][0]) && $attr['support:email'][0]) ? $attr['support:email'][0] : $this->translateString($this->support_email_substitute, $this->codePage)) . '" |
|
245 | +!define URL "' . ((isset($attr['support:url'][0]) && $attr['support:url'][0]) ? $attr['support:url'][0] : $this->translateString($this->support_url_substitute, $this->codePage)) . '" |
|
246 | 246 | '; |
247 | 247 | |
248 | 248 | |
@@ -256,11 +256,11 @@ discard block |
||
256 | 256 | $fcontents .= '!define REALM "' . $attr['internal:realm'][0] . '" |
257 | 257 | '; |
258 | 258 | } |
259 | - if(!empty($attr['internal:hint_userinput_suffix'][0]) && $attr['internal:hint_userinput_suffix'][0] == 1) { |
|
259 | + if (!empty($attr['internal:hint_userinput_suffix'][0]) && $attr['internal:hint_userinput_suffix'][0] == 1) { |
|
260 | 260 | $fcontents .= '!define HINT_USER_INPUT "' . $attr['internal:hint_userinput_suffix'][0] . '" |
261 | 261 | '; |
262 | 262 | } |
263 | - if(!empty($attr['internal:verify_userinput_suffix'][0]) && $attr['internal:verify_userinput_suffix'][0] == 1) { |
|
263 | + if (!empty($attr['internal:verify_userinput_suffix'][0]) && $attr['internal:verify_userinput_suffix'][0] == 1) { |
|
264 | 264 | $fcontents .= '!define VERIFY_USER_REALM_INPUT "' . $attr['internal:verify_userinput_suffix'][0] . '" |
265 | 265 | '; |
266 | 266 | } |
@@ -95,7 +95,7 @@ |
||
95 | 95 | |
96 | 96 | while ($oneAttrib = mysqli_fetch_object(/** @scrutinizer ignore-type */ $idpWideOptionsQuery)) { |
97 | 97 | if (!isset($profiles[$oneAttrib->institution_id])) { |
98 | - $idp = new \core\IdP((int)$oneAttrib->institution_id); |
|
98 | + $idp = new \core\IdP((int) $oneAttrib->institution_id); |
|
99 | 99 | $profiles[$oneAttrib->institution_id] = ['IdP' => $idp, 'Profiles' => $idp->listProfiles()]; |
100 | 100 | echo "Debug: IdP " . $idp->identifier . " has profiles "; |
101 | 101 | foreach ($profiles[$oneAttrib->institution_id]['Profiles'] as $oneProfileObject) { |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | |
28 | 28 | function disp_name($eap) { |
29 | 29 | $displayName = \core\common\EAP::eapDisplayName($eap); |
30 | - return $displayName['OUTER'] . ( $displayName['INNER'] != '' ? '-' . $displayName['INNER'] : ''); |
|
30 | + return $displayName['OUTER'] . ($displayName['INNER'] != '' ? '-' . $displayName['INNER'] : ''); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | if (!isset($_REQUEST['test_type']) || !$_REQUEST['test_type']) { |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | $testsuite = new \core\diag\RADIUSTests($check_realm, $my_profile->getRealmCheckOuterUsername(), $my_profile->getEapMethodsinOrderOfPreference(1), $my_profile->getCollapsedAttributes()['eap:server_name'], $my_profile->getCollapsedAttributes()['eap:ca_file']); |
51 | 51 | } else { |
52 | 52 | $my_profile = NULL; |
53 | - $testsuite = new \core\diag\RADIUSTests($check_realm, "@".$check_realm); |
|
53 | + $testsuite = new \core\diag\RADIUSTests($check_realm, "@" . $check_realm); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | // contains port number; needs to be redacted for filter_var to work |
67 | 67 | // in any case, it's a printable string, so filter it initially |
68 | 68 | |
69 | - $filteredHost = filter_input(INPUT_GET,'src', FILTER_SANITIZE_STRING) ?? filter_input(INPUT_POST,'src', FILTER_SANITIZE_STRING); |
|
69 | + $filteredHost = filter_input(INPUT_GET, 'src', FILTER_SANITIZE_STRING) ?? filter_input(INPUT_POST, 'src', FILTER_SANITIZE_STRING); |
|
70 | 70 | $hostonly1 = preg_replace('/:[0-9]*$/', "", $filteredHost); |
71 | 71 | $hostonly2 = preg_replace('/^\[/', "", $hostonly1); |
72 | 72 | $hostonly3 = preg_replace('/\]$/', "", $hostonly2); |
@@ -295,12 +295,12 @@ discard block |
||
295 | 295 | $returnarray['time_millisec'] = sprintf("%d", $testsuite->UDP_reachability_result[$host]['time_millisec']); |
296 | 296 | |
297 | 297 | if (preg_match('/verify error:num=19/', implode($opensslbabble))) { |
298 | - $printedres .= "<tr><td>"._("<strong>ERROR</strong>: the server presented a certificate which is from an unknown authority!") . $measure ."</td></tr>"; |
|
298 | + $printedres .= "<tr><td>" . _("<strong>ERROR</strong>: the server presented a certificate which is from an unknown authority!") . $measure . "</td></tr>"; |
|
299 | 299 | $my_ip_addrs[$key]["status"] = "FAILED"; |
300 | 300 | $goterror = 1; |
301 | 301 | } |
302 | 302 | if (preg_match('/verify return:1/', implode($opensslbabble))) { |
303 | - $printedres .= "<tr><td>"._("Completed.") . $measure . "</td></tr>"; |
|
303 | + $printedres .= "<tr><td>" . _("Completed.") . $measure . "</td></tr>"; |
|
304 | 304 | $printedres .= "<tr><td></td><td><div class=\"more\">"; |
305 | 305 | $my_ip_addrs[$key]["status"] = "OK"; |
306 | 306 | $servercertRaw = implode("\n", $opensslbabble); |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | */ |
11 | 11 | namespace web\lib\user; |
12 | 12 | |
13 | -require_once(ROOT."/config/_config.php"); |
|
13 | +require_once(ROOT . "/config/_config.php"); |
|
14 | 14 | /** |
15 | 15 | * these constants live in the global space just to ease their use - with class |
16 | 16 | * prefix, the names simply get too long for comfort |
@@ -72,9 +72,9 @@ discard block |
||
72 | 72 | $this->templates[WELCOME_ABOARD_BACKTODOWNLOADS] = _("Back to downloads"); |
73 | 73 | $this->templates[EDUROAM_WELCOME_ADVERTISING] = sprintf(_("we would like to warmly welcome you among the several million users of %s! From now on, you will be able to use internet access resources on thousands of universities, research centres and other places all over the globe. All of this completely free of charge!"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']); |
74 | 74 | $this->templates[HEADING_TOPLEVEL_GREET] = sprintf(_("Welcome to %s"), CONFIG['APPEARANCE']['productname']); |
75 | - $this->templates[HEADING_TOPLEVEL_PURPOSE] = sprintf(_("Connect your device to %s"),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']); |
|
75 | + $this->templates[HEADING_TOPLEVEL_PURPOSE] = sprintf(_("Connect your device to %s"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']); |
|
76 | 76 | $this->templates[FRONTPAGE_ROLLER_EASY] = sprintf(_("%s installation made easy:"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']); |
77 | - $this->templates[FRONTPAGE_ROLLER_CUSTOMBUILT] = sprintf(_("Custom built for your %s"),$parent->nomenclature_inst); |
|
77 | + $this->templates[FRONTPAGE_ROLLER_CUSTOMBUILT] = sprintf(_("Custom built for your %s"), $parent->nomenclature_inst); |
|
78 | 78 | $this->templates[FRONTPAGE_BIGDOWNLOADBUTTON] = sprintf(_("Click here to download your %s installer"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']); |
79 | 79 | $this->templates[PROFILE_SELECTION] = _("Select the user group"); |
80 | 80 | $this->templates[INSTITUTION_SELECTION] = _("select another"); |
@@ -162,7 +162,7 @@ |
||
162 | 162 | $profileFileCont .= ' |
163 | 163 | </ServerSideCredential> |
164 | 164 | <InnerAuthenticationMethod> |
165 | -<NonEAPAuthMethod>' .$innerMethod. '</NonEAPAuthMethod> |
|
165 | +<NonEAPAuthMethod>' .$innerMethod . '</NonEAPAuthMethod> |
|
166 | 166 | </InnerAuthenticationMethod> |
167 | 167 | <VendorSpecific> |
168 | 168 | <SessionResumption>false</SessionResumption> |
@@ -96,6 +96,12 @@ |
||
96 | 96 | */ |
97 | 97 | protected $frontendHandle; |
98 | 98 | |
99 | + /** |
|
100 | + * @param integer $idpIdentifier |
|
101 | + * @param string $deviceId |
|
102 | + * @param string $area |
|
103 | + * @param string $lang |
|
104 | + */ |
|
99 | 105 | protected function saveDownloadDetails($idpIdentifier, $profileId, $deviceId, $area, $lang, $eapType) { |
100 | 106 | if (CONFIG['PATHS']['logdir']) { |
101 | 107 | $file = fopen(CONFIG['PATHS']['logdir'] . "/download_details.log", "a"); |