Test Failed
Push — master ( a13d19...6b96b9 )
by Tomasz
03:24
created
web/user/API.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 ];
40 40
 
41 41
 
42
-function getRequest($varName,$filter) {
42
+function getRequest($varName, $filter) {
43 43
     $safeText = ["options"=>["regexp"=>"/^[\w\d]+$/"]];
44 44
     switch ($filter) {
45 45
         case 'safe_text':
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 
58 58
 // make sure this is a known action
59 59
 $actionR = getRequest('action', 'safe_text');
60
-$action = array_search($actionR,LISTOFACTIONS) ? $actionR : FALSE;
60
+$action = array_search($actionR, LISTOFACTIONS) ? $actionR : FALSE;
61 61
 if ($action === FALSE) {
62 62
     exit;
63 63
 }
@@ -65,17 +65,17 @@  discard block
 block discarded – undo
65 65
 $lang = $langR ? $validator->supportedLanguage($langR) : FALSE;
66 66
 $deviceR = getRequest('device', 'safe_text');
67 67
 $device = $deviceR ? $validator->Device($deviceR) : FALSE;
68
-$idpR = getRequest('idp','int');
68
+$idpR = getRequest('idp', 'int');
69 69
 $idp = $idpR ? $validator->IdP($idpR)->identifier : FALSE;
70
-$profileR = getRequest('profile','int');
70
+$profileR = getRequest('profile', 'int');
71 71
 $profile = $profileR ? $validator->Profile($profileR)->identifier : FALSE;
72
-$federationR = getRequest('federation','safe_text');
72
+$federationR = getRequest('federation', 'safe_text');
73 73
 $federation = $federationR ? $validator->Federation($deviceR)->identifier : FALSE;
74
-$disco = getRequest('disco','int');
75
-$width = getRequest('width','int') ?? 0;
76
-$height = getRequest('height','int') ?? 0;
77
-$sort = getRequest('sort','int') ?? 0;
78
-$generatedforR = getRequest('generatedfor','safe_text') ?? 'user';
74
+$disco = getRequest('disco', 'int');
75
+$width = getRequest('width', 'int') ?? 0;
76
+$height = getRequest('height', 'int') ?? 0;
77
+$sort = getRequest('sort', 'int') ?? 0;
78
+$generatedforR = getRequest('generatedfor', 'safe_text') ?? 'user';
79 79
 
80 80
 /*
81 81
 $idp = FALSE;
Please login to merge, or discard this patch.
core/DeviceConfig.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -260,6 +260,9 @@  discard block
 block discarded – undo
260 260
         return _("Sorry, this should not happen - no additional information is available");
261 261
     }
262 262
     
263
+    /**
264
+     * @param string $file
265
+     */
263 266
     private function findSourceFile($file) {
264 267
         if (is_file($this->module_path . '/Files/' . $this->device_id . '/' . $file)) {
265 268
             return $this->module_path . '/Files/' . $this->device_id . '/' . $file;
@@ -540,6 +543,9 @@  discard block
 block discarded – undo
540 543
         'application/pdf' => 'pdf',
541 544
     ];
542 545
 
546
+    /**
547
+     * @param string $type
548
+     */
543 549
     private function saveLogoFile($logos,$type) {
544 550
         $iterator = 0;
545 551
         $returnarray = [];
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
         }
213 213
         if (isset($this->attributes['general:logo_file'])) {
214 214
             $this->loggerInstance->debug(5, "saving IDP logo\n");
215
-            $this->attributes['internal:logo_file'] = $this->saveLogoFile($this->attributes['general:logo_file'],'idp');
215
+            $this->attributes['internal:logo_file'] = $this->saveLogoFile($this->attributes['general:logo_file'], 'idp');
216 216
         }
217 217
         if (isset($this->attributes['fed:logo_file'])) {
218 218
             $this->loggerInstance->debug(5, "saving FED logo\n");
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
         'application/pdf' => 'pdf',
541 541
     ];
542 542
 
543
-    private function saveLogoFile($logos,$type) {
543
+    private function saveLogoFile($logos, $type) {
544 544
         $iterator = 0;
545 545
         $returnarray = [];
546 546
         foreach ($logos as $blob) {
Please login to merge, or discard this patch.
core/UserManagement.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
         if ($invitationDetails = mysqli_fetch_object($instinfo)) {
116 116
             if ($invitationDetails->cat_institution_id !== NULL) { // add new admin to existing IdP
117 117
                 $this->databaseHandle->exec("INSERT INTO ownership (user_id, institution_id, blesslevel, orig_mail) VALUES(?, $invitationDetails->cat_institution_id, '$invitationDetails->invite_issuer_level', '$invitationDetails->invite_dest_mail') ON DUPLICATE KEY UPDATE blesslevel='$invitationDetails->invite_issuer_level', orig_mail='$invitationDetails->invite_dest_mail' ", "s", $owner);
118
-                $this->loggerInstance->writeAudit((string)$owner, "OWN", "IdP " . $invitationDetails->cat_institution_id . " - added user as owner");
118
+                $this->loggerInstance->writeAudit((string) $owner, "OWN", "IdP " . $invitationDetails->cat_institution_id . " - added user as owner");
119 119
                 return new IdP($invitationDetails->cat_institution_id);
120 120
             }
121 121
             // create new IdP
@@ -262,8 +262,8 @@  discard block
 block discarded – undo
262 262
         $retval = [];
263 263
         $invitations = $this->databaseHandle->exec("SELECT cat_institution_id, country, name, invite_issuer_level, invite_dest_mail, invite_token 
264 264
                                         FROM invitations 
265
-                                        WHERE cat_institution_id " . ( $idpIdentifier != 0 ? "= $idpIdentifier" : "IS NULL") . " AND invite_created >= TIMESTAMPADD(DAY, -1, NOW()) AND used = 0");
266
-        $this->loggerInstance->debug(4, "Retrieving pending invitations for " . ($idpIdentifier != 0 ? "IdP $idpIdentifier" : "IdPs awaiting initial creation" ) . ".\n");
265
+                                        WHERE cat_institution_id " . ($idpIdentifier != 0 ? "= $idpIdentifier" : "IS NULL") . " AND invite_created >= TIMESTAMPADD(DAY, -1, NOW()) AND used = 0");
266
+        $this->loggerInstance->debug(4, "Retrieving pending invitations for " . ($idpIdentifier != 0 ? "IdP $idpIdentifier" : "IdPs awaiting initial creation") . ".\n");
267 267
         while ($invitationQuery = mysqli_fetch_object($invitations)) {
268 268
             $retval[] = ["country" => $invitationQuery->country, "name" => $invitationQuery->name, "mail" => $invitationQuery->invite_dest_mail, "token" => $invitationQuery->invite_token];
269 269
         }
Please login to merge, or discard this patch.
schema/1_1-1_2-script.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@
 block discarded – undo
94 94
 
95 95
 while ($oneAttrib = mysqli_fetch_object($idpWideOptionsQuery)) {
96 96
     if (!isset($profiles[$oneAttrib->institution_id])) {
97
-        $idp = new \core\IdP((int)$oneAttrib->institution_id);
97
+        $idp = new \core\IdP((int) $oneAttrib->institution_id);
98 98
         $profiles[$oneAttrib->institution_id] = ['IdP' => $idp, 'Profiles' => $idp->listProfiles()];
99 99
         echo "Debug: IdP " . $idp->identifier . " has profiles ";
100 100
         foreach ($profiles[$oneAttrib->institution_id]['Profiles'] as $oneProfileObject) {
Please login to merge, or discard this patch.
devices/ms/Device_W10.php 2 patches
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -297,10 +297,11 @@
 block discarded – undo
297 297
 <allow-save>true</allow-save>
298 298
 ';
299 299
                 if ($use_anon == 1) {
300
-                    if ($outer_user == '')
301
-                        $profileFileCont .= '<AnonymousIdentity>@</AnonymousIdentity>';
302
-                    else
303
-                        $profileFileCont .= '<AnonymousIdentity>' . $outer_id . '</AnonymousIdentity>';
300
+                    if ($outer_user == '') {
301
+                                            $profileFileCont .= '<AnonymousIdentity>@</AnonymousIdentity>';
302
+                    } else {
303
+                                            $profileFileCont .= '<AnonymousIdentity>' . $outer_id . '</AnonymousIdentity>';
304
+                    }
304 305
                 }
305 306
                 $profileFileCont .= '</ClientSideCredential>
306 307
 <ServerSideCredential>
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -446,8 +446,8 @@
 block discarded – undo
446 446
 
447 447
         $fcontents .= ';--------------------------------
448 448
 !define ORGANISATION "' . $this->translateString($attr['general:instname'][0], $this->codePage) . '"
449
-!define SUPPORT "' . ((isset($attr['support:email'][0]) && $attr['support:email'][0] ) ? $attr['support:email'][0] : $this->translateString($this->support_email_substitute, $this->codePage)) . '"
450
-!define URL "' . ((isset($attr['support:url'][0]) && $attr['support:url'][0] ) ? $attr['support:url'][0] : $this->translateString($this->support_url_substitute, $this->codePage)) . '"
449
+!define SUPPORT "' . ((isset($attr['support:email'][0]) && $attr['support:email'][0]) ? $attr['support:email'][0] : $this->translateString($this->support_email_substitute, $this->codePage)) . '"
450
+!define URL "' . ((isset($attr['support:url'][0]) && $attr['support:url'][0]) ? $attr['support:url'][0] : $this->translateString($this->support_url_substitute, $this->codePage)) . '"
451 451
 
452 452
 !ifdef TLS
453 453
 ';
Please login to merge, or discard this patch.
devices/ms/Device_Vista7.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -446,8 +446,8 @@
 block discarded – undo
446 446
 
447 447
         $fcontents .= ';--------------------------------
448 448
 !define ORGANISATION "' . $this->translateString($attr['general:instname'][0], $this->codePage) . '"
449
-!define SUPPORT "' . ((isset($attr['support:email'][0]) && $attr['support:email'][0] ) ? $attr['support:email'][0] : $this->translateString($this->support_email_substitute, $this->codePage)) . '"
450
-!define URL "' . ((isset($attr['support:url'][0]) && $attr['support:url'][0] ) ? $attr['support:url'][0] : $this->translateString($this->support_url_substitute, $this->codePage)) . '"
449
+!define SUPPORT "' . ((isset($attr['support:email'][0]) && $attr['support:email'][0]) ? $attr['support:email'][0] : $this->translateString($this->support_email_substitute, $this->codePage)) . '"
450
+!define URL "' . ((isset($attr['support:url'][0]) && $attr['support:url'][0]) ? $attr['support:url'][0] : $this->translateString($this->support_url_substitute, $this->codePage)) . '"
451 451
 
452 452
 !ifdef TLS
453 453
 ';
Please login to merge, or discard this patch.
devices/ms/Device_W8.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -446,8 +446,8 @@
 block discarded – undo
446 446
 
447 447
         $fcontents .= ';--------------------------------
448 448
 !define ORGANISATION "' . $this->translateString($attr['general:instname'][0], $this->codePage) . '"
449
-!define SUPPORT "' . ((isset($attr['support:email'][0]) && $attr['support:email'][0] ) ? $attr['support:email'][0] : $this->translateString($this->support_email_substitute, $this->codePage)) . '"
450
-!define URL "' . ((isset($attr['support:url'][0]) && $attr['support:url'][0] ) ? $attr['support:url'][0] : $this->translateString($this->support_url_substitute, $this->codePage)) . '"
449
+!define SUPPORT "' . ((isset($attr['support:email'][0]) && $attr['support:email'][0]) ? $attr['support:email'][0] : $this->translateString($this->support_email_substitute, $this->codePage)) . '"
450
+!define URL "' . ((isset($attr['support:url'][0]) && $attr['support:url'][0]) ? $attr['support:url'][0] : $this->translateString($this->support_url_substitute, $this->codePage)) . '"
451 451
 
452 452
 !ifdef TLS
453 453
 ';
Please login to merge, or discard this patch.
devices/ms/WindowsCommon.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 
91 91
     public function __construct() {
92 92
         parent::__construct();
93
-        $this->useGeantLink = (isset($this->options['args']) && $this->options['args'] == 'gl' ) ? 1 : 0;
93
+        $this->useGeantLink = (isset($this->options['args']) && $this->options['args'] == 'gl') ? 1 : 0;
94 94
     }
95 95
 
96 96
     protected function prepareInstallerLang() {
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
             } else {
116 116
                 $out .= sprintf(_("In addition to <strong>%s</strong> the installer will also configure access to:"), implode(', ', CONFIG_CONFASSISTANT['CONSORTIUM']['ssid'])) . " ";
117 117
             }
118
-            $out .= '<strong>' . join ('</strong>, <strong>', array_diff(array_keys($this->attributes['internal:SSID']), CONFIG_CONFASSISTANT['CONSORTIUM']['ssid'])) . '</strong>';
118
+            $out .= '<strong>' . join('</strong>, <strong>', array_diff(array_keys($this->attributes['internal:SSID']), CONFIG_CONFASSISTANT['CONSORTIUM']['ssid'])) . '</strong>';
119 119
             $out .= "<p>";
120 120
         }
121 121
 // TODO - change this below
@@ -126,13 +126,13 @@  discard block
 block discarded – undo
126 126
         // not EAP-TLS
127 127
         $out .= sprintf(_("In order to connect to the network you will need an account from your %s. You should consult the support page to find out how this account can be obtained. It is very likely that your account is already activated."), $this->nomenclature_inst);
128 128
 
129
-        if (! $this->useGeantLink && ( $this->selectedEap == \core\common\EAP::EAPTYPE_TTLS_MSCHAP2 || $this->selectedEap == \core\common\EAP::EAPTYPE_TTLS_PAP )) {
129
+        if (!$this->useGeantLink && ($this->selectedEap == \core\common\EAP::EAPTYPE_TTLS_MSCHAP2 || $this->selectedEap == \core\common\EAP::EAPTYPE_TTLS_PAP)) {
130 130
             $out .= "<p>";
131 131
             $out .= _("When you are connecting to the network for the first time, Windows will pop up a login box, where you should enter your user name and password. This information will be saved so that you will reconnect to the network automatically each time you are in the range.");
132 132
             if ($ssidCount > 1) {
133 133
                 $out .= "<p>";
134 134
                 $out .= _("You will be required to enter the same credentials for each of the configured notworks:") . " ";
135
-                $out .= '<strong>' . join ('</strong>, <strong>', array_keys($this->attributes['internal:SSID'])) . '</strong>';
135
+                $out .= '<strong>' . join('</strong>, <strong>', array_keys($this->attributes['internal:SSID'])) . '</strong>';
136 136
             }
137 137
         }
138 138
         return($out);
Please login to merge, or discard this patch.
web/lib/user/TextTemplates.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
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
@@ -70,9 +70,9 @@  discard block
 block discarded – undo
70 70
         $this->templates[WELCOME_ABOARD_BACKTODOWNLOADS] = _("Back to downloads");
71 71
         $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']);
72 72
         $this->templates[HEADING_TOPLEVEL_GREET] = sprintf(_("Welcome to %s"), CONFIG['APPEARANCE']['productname']);
73
-        $this->templates[HEADING_TOPLEVEL_PURPOSE] = sprintf(_("Connect your device to %s"),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']);
73
+        $this->templates[HEADING_TOPLEVEL_PURPOSE] = sprintf(_("Connect your device to %s"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']);
74 74
         $this->templates[FRONTPAGE_ROLLER_EASY] = sprintf(_("%s installation made easy:"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']);
75
-        $this->templates[FRONTPAGE_ROLLER_CUSTOMBUILT] = sprintf(_("Custom built for your %s"),$parent->nomenclature_inst);
75
+        $this->templates[FRONTPAGE_ROLLER_CUSTOMBUILT] = sprintf(_("Custom built for your %s"), $parent->nomenclature_inst);
76 76
         $this->templates[FRONTPAGE_ROLLER_SIGNEDBY] = sprintf(_("Digitally signed by the organisation that coordinates %s: %s"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], CONFIG_CONFASSISTANT['CONSORTIUM']['signer_name']);
77 77
         $this->templates[FRONTPAGE_BIGDOWNLOADBUTTON] = sprintf(_("Click here to download your %s installer"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']);
78 78
         $this->templates[PROFILE_SELECTION] = _("Select the user group");
Please login to merge, or discard this patch.