Passed
Push — master ( 4a7490...26f0ec )
by Tomasz
07:21 queued 15s
created
core/DBConnection.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -60,14 +60,14 @@  discard block
 block discarded – undo
60 60
             case "EXTERNAL":
61 61
             case "FRONTEND":
62 62
             case "DIAGNOSTICS":
63
-                if (!isset(self::${"instance" . $theDb})) {
63
+                if (!isset(self::${"instance".$theDb})) {
64 64
                     $class = __CLASS__;
65
-                    self::${"instance" . $theDb} = new $class($database);
66
-                    DBConnection::${"instance" . $theDb}->databaseInstance = $theDb;
65
+                    self::${"instance".$theDb} = new $class($database);
66
+                    DBConnection::${"instance".$theDb}->databaseInstance = $theDb;
67 67
                 }
68
-                return self::${"instance" . $theDb};
68
+                return self::${"instance".$theDb};
69 69
             default:
70
-                throw new Exception("This type of database (" . strtoupper($database) . ") is not known!");
70
+                throw new Exception("This type of database (".strtoupper($database).") is not known!");
71 71
         }
72 72
     }
73 73
 
@@ -106,18 +106,18 @@  discard block
 block discarded – undo
106 106
             }
107 107
         }
108 108
         // log exact query to debug log, if log level is at 5
109
-        $this->loggerInstance->debug(5, "DB ATTEMPT: " . $querystring . "\n");
109
+        $this->loggerInstance->debug(5, "DB ATTEMPT: ".$querystring."\n");
110 110
         if ($types !== NULL) {
111
-            $this->loggerInstance->debug(5, "Argument type sequence: $types, parameters are: " . print_r($arguments, true));
111
+            $this->loggerInstance->debug(5, "Argument type sequence: $types, parameters are: ".print_r($arguments, true));
112 112
         }
113 113
 
114 114
         if ($this->connection->connect_error) {
115
-            throw new Exception("ERROR: Cannot send query to $this->databaseInstance database (no connection, error number" . $this->connection->connect_error . ")!");
115
+            throw new Exception("ERROR: Cannot send query to $this->databaseInstance database (no connection, error number".$this->connection->connect_error.")!");
116 116
         }
117 117
         if ($types === NULL) {
118 118
             $result = $this->connection->query($querystring);
119 119
             if ($result === FALSE) {
120
-                throw new Exception("DB: Unable to execute simple statement! Error was --> " . $this->connection->error . " <--");
120
+                throw new Exception("DB: Unable to execute simple statement! Error was --> ".$this->connection->error." <--");
121 121
             }
122 122
         } else {
123 123
             // fancy! prepared statement with dedicated argument list
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
                 }
134 134
                 $prepResult = $statementObject->prepare($querystring);
135 135
                 if ($prepResult === FALSE) {
136
-                    throw new Exception("DB: Unable to prepare statement! Statement was --> $querystring <--, error was --> " . $statementObject->error . " <--.");
136
+                    throw new Exception("DB: Unable to prepare statement! Statement was --> $querystring <--, error was --> ".$statementObject->error." <--.");
137 137
                 }
138 138
                 $this->preparedStatements[$querystring] = $statementObject;
139 139
             }
@@ -146,11 +146,11 @@  discard block
 block discarded – undo
146 146
             array_unshift($localArray, $types);
147 147
             $retval = call_user_func_array([$statementObject, "bind_param"], $localArray);
148 148
             if ($retval === FALSE) {
149
-                throw new Exception("DB: Unable to bind parameters to prepared statement! Argument array was --> " . var_export($localArray, TRUE) . " <--. Error was --> " . $statementObject->error . " <--");
149
+                throw new Exception("DB: Unable to bind parameters to prepared statement! Argument array was --> ".var_export($localArray, TRUE)." <--. Error was --> ".$statementObject->error." <--");
150 150
             }
151 151
             $result = $statementObject->execute();
152 152
             if ($result === FALSE) {
153
-                throw new Exception("DB: Unable to execute prepared statement! Error was --> " . $statementObject->error . " <--");
153
+                throw new Exception("DB: Unable to execute prepared statement! Error was --> ".$statementObject->error." <--");
154 154
             }
155 155
             $selectResult = $statementObject->get_result();
156 156
             if ($selectResult !== FALSE) {
@@ -160,14 +160,14 @@  discard block
 block discarded – undo
160 160
 
161 161
         // all cases where $result could be FALSE have been caught earlier
162 162
         if ($this->connection->errno) {
163
-            throw new Exception("ERROR: Cannot execute query in $this->databaseInstance database - (hopefully escaped) query was '$querystring', errno was " . $this->connection->errno . "!");
163
+            throw new Exception("ERROR: Cannot execute query in $this->databaseInstance database - (hopefully escaped) query was '$querystring', errno was ".$this->connection->errno."!");
164 164
         }
165 165
 
166 166
 
167 167
         if ($isMoreThanSelect) {
168
-            $this->loggerInstance->writeSQLAudit("[DB: " . strtoupper($this->databaseInstance) . "] " . $querystring);
168
+            $this->loggerInstance->writeSQLAudit("[DB: ".strtoupper($this->databaseInstance)."] ".$querystring);
169 169
             if ($types !== NULL) {
170
-                $this->loggerInstance->writeSQLAudit("Argument type sequence: $types, parameters are: " . print_r($arguments, true));
170
+                $this->loggerInstance->writeSQLAudit("Argument type sequence: $types, parameters are: ".print_r($arguments, true));
171 171
             }
172 172
         }
173 173
         return $result;
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
         $databaseCapitalised = strtoupper($database);
253 253
         $this->connection = new \mysqli(\config\Master::DB[$databaseCapitalised]['host'], \config\Master::DB[$databaseCapitalised]['user'], \config\Master::DB[$databaseCapitalised]['pass'], \config\Master::DB[$databaseCapitalised]['db']);
254 254
         if ($this->connection->connect_error) {
255
-            throw new Exception("ERROR: Unable to connect to $database database! This is a fatal error, giving up (error number " . $this->connection->connect_errno . ").");
255
+            throw new Exception("ERROR: Unable to connect to $database database! This is a fatal error, giving up (error number ".$this->connection->connect_errno.").");
256 256
         }
257 257
         $this->readOnly = \config\Master::DB[$databaseCapitalised]['readonly'];
258 258
     }
Please login to merge, or discard this patch.
core/EntityWithDBProperties.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -331,14 +331,14 @@
 block discarded – undo
331 331
     }
332 332
 
333 333
         /**
334
-     * join new attributes to existing ones, but only if not already defined on
335
-     * a different level in the existing set
336
-     * 
337
-     * @param array  $existing the already existing attributes
338
-     * @param array  $new      the new set of attributes
339
-     * @param string $newlevel the level of the new attributes
340
-     * @return array the new set of attributes
341
-     */
334
+         * join new attributes to existing ones, but only if not already defined on
335
+         * a different level in the existing set
336
+         * 
337
+         * @param array  $existing the already existing attributes
338
+         * @param array  $new      the new set of attributes
339
+         * @param string $newlevel the level of the new attributes
340
+         * @return array the new set of attributes
341
+         */
342 342
     protected function levelPrecedenceAttributeJoin($existing, $new, $newlevel) {
343 343
         foreach ($new as $attrib) {
344 344
             $ignore = "";
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
             case "core\User":
130 130
                 return $this->userName;
131 131
             default:
132
-                throw new Exception("Operating on a class where we don't know the relevant identifier in the DB - " . get_class($this) . "!");
132
+                throw new Exception("Operating on a class where we don't know the relevant identifier in the DB - ".get_class($this)."!");
133 133
         }
134 134
     }
135 135
 
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
      * @return array list of row id's of file-based attributes which weren't deleted
166 166
      */
167 167
     public function beginFlushAttributes($extracondition = "") {
168
-        $quotedIdentifier = (!is_int($this->getRelevantIdentifier()) ? "\"" : "") . $this->getRelevantIdentifier() . (!is_int($this->getRelevantIdentifier()) ? "\"" : "");
168
+        $quotedIdentifier = (!is_int($this->getRelevantIdentifier()) ? "\"" : "").$this->getRelevantIdentifier().(!is_int($this->getRelevantIdentifier()) ? "\"" : "");
169 169
         $this->databaseHandle->exec("DELETE FROM $this->entityOptionTable WHERE $this->entityIdColumn = $quotedIdentifier AND option_name NOT LIKE '%_file' $extracondition");
170 170
         $this->updateFreshness();
171 171
         $execFlush = $this->databaseHandle->exec("SELECT row FROM $this->entityOptionTable WHERE $this->entityIdColumn = $quotedIdentifier $extracondition");
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
      * @return void
185 185
      */
186 186
     public function commitFlushAttributes(array $tobedeleted) {
187
-        $quotedIdentifier = (!is_int($this->getRelevantIdentifier()) ? "\"" : "") . $this->getRelevantIdentifier() . (!is_int($this->getRelevantIdentifier()) ? "\"" : "");
187
+        $quotedIdentifier = (!is_int($this->getRelevantIdentifier()) ? "\"" : "").$this->getRelevantIdentifier().(!is_int($this->getRelevantIdentifier()) ? "\"" : "");
188 188
         foreach (array_keys($tobedeleted) as $row) {
189 189
             $this->databaseHandle->exec("DELETE FROM $this->entityOptionTable WHERE $this->entityIdColumn = $quotedIdentifier AND row = $row");
190 190
             $this->updateFreshness();
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
     public function addAttribute($attrName, $attrLang, $attrValue) {
212 212
         $relevantId = $this->getRelevantIdentifier();
213 213
         $identifierType = (is_int($relevantId) ? "i" : "s");
214
-        $this->databaseHandle->exec("INSERT INTO $this->entityOptionTable ($this->entityIdColumn, option_name, option_lang, option_value) VALUES(?,?,?,?)", $identifierType . "sss", $relevantId, $attrName, $attrLang, $attrValue);
214
+        $this->databaseHandle->exec("INSERT INTO $this->entityOptionTable ($this->entityIdColumn, option_name, option_lang, option_value) VALUES(?,?,?,?)", $identifierType."sss", $relevantId, $attrName, $attrLang, $attrValue);
215 215
         $this->updateFreshness();
216 216
     }
217 217
 
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
         foreach ($new as $attrib) {
344 344
             $ignore = "";
345 345
             foreach ($existing as $approvedAttrib) {
346
-                if (($attrib["name"] == $approvedAttrib["name"] && $approvedAttrib["level"] != $newlevel) && ($approvedAttrib["name"] != "device-specific:redirect") ){
346
+                if (($attrib["name"] == $approvedAttrib["name"] && $approvedAttrib["level"] != $newlevel) && ($approvedAttrib["name"] != "device-specific:redirect")) {
347 347
                     $ignore = "YES";
348 348
                 }
349 349
             }
Please login to merge, or discard this patch.
core/AbstractProfile.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
      */
130 130
     protected function saveDownloadDetails($idpIdentifier, $profileId, $deviceId, $area, $lang, $eapType) {
131 131
         if (\config\Master::PATHS['logdir']) {
132
-            $file = fopen(\config\Master::PATHS['logdir'] . "/download_details.log", "a");
132
+            $file = fopen(\config\Master::PATHS['logdir']."/download_details.log", "a");
133 133
             if ($file === FALSE) {
134 134
                 throw new Exception("Unable to open file for append: $file");
135 135
             }
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
             $eaptype = new common\EAP($eapQuery->eap_method_id);
156 156
             $eapTypeArray[] = $eaptype;
157 157
         }
158
-        $this->loggerInstance->debug(4, "This profile supports the following EAP types:\n" . print_r($eapTypeArray, true));
158
+        $this->loggerInstance->debug(4, "This profile supports the following EAP types:\n".print_r($eapTypeArray, true));
159 159
         return $eapTypeArray;
160 160
     }
161 161
 
@@ -230,16 +230,16 @@  discard block
 block discarded – undo
230 230
         if (count($this->getAttributes("internal:checkuser_outer")) > 0) {
231 231
             // we are supposed to use a specific outer username for checks, 
232 232
             // which is different from the outer username we put into installers
233
-            return $this->getAttributes("internal:checkuser_value")[0]['value'] . "@" . $realm;
233
+            return $this->getAttributes("internal:checkuser_value")[0]['value']."@".$realm;
234 234
         }
235 235
         if (count($this->getAttributes("internal:use_anon_outer")) > 0) {
236 236
             // no special check username, but there is an anon outer ID for
237 237
             // installers - so let's use that one
238
-            return $this->getAttributes("internal:anon_local_value")[0]['value'] . "@" . $realm;
238
+            return $this->getAttributes("internal:anon_local_value")[0]['value']."@".$realm;
239 239
         }
240 240
         // okay, no guidance on outer IDs at all - but we need *something* to
241 241
         // test with for the RealmChecks. So:
242
-        return "@" . $realm;
242
+        return "@".$realm;
243 243
     }
244 244
 
245 245
     /**
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
      * @param boolean $shallwe TRUE to enable outer identities (needs valid $realm), FALSE to disable
320 320
      * @return void
321 321
      */
322
-    abstract public function setAnonymousIDSupport($shallwe) ;
322
+    abstract public function setAnonymousIDSupport($shallwe);
323 323
     
324 324
     /**
325 325
      * Log a new download for our stats
@@ -673,7 +673,7 @@  discard block
 block discarded – undo
673 673
      */
674 674
     public function prepShowtime() {
675 675
         $properConfig = $this->readyForShowtime();
676
-        $this->databaseHandle->exec("UPDATE profile SET sufficient_config = " . ($properConfig ? "TRUE" : "FALSE") . " WHERE profile_id = " . $this->identifier);
676
+        $this->databaseHandle->exec("UPDATE profile SET sufficient_config = ".($properConfig ? "TRUE" : "FALSE")." WHERE profile_id = ".$this->identifier);
677 677
 
678 678
         $attribs = $this->getCollapsedAttributes();
679 679
         // if not enough info to go live, set FALSE
Please login to merge, or discard this patch.
devices/xml/XMLElement.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@
 block discarded – undo
123 123
         if (is_scalar($value)) {
124 124
             $this->value = strval($value);
125 125
         } else {
126
-            throw new Exception("unexpected value type passed" . gettype($value));
126
+            throw new Exception("unexpected value type passed".gettype($value));
127 127
         }
128 128
     }
129 129
 
Please login to merge, or discard this patch.
devices/xml/DeviceXML.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -146,11 +146,11 @@  discard block
 block discarded – undo
146 146
         $this->marshalObject($root, $eapIdp);
147 147
         $dom = dom_import_simplexml($root)->ownerDocument;
148 148
         //TODO schema validation makes sense so probably should be used
149
-        if ($dom->schemaValidate(ROOT . '/devices/xml/eap-metadata.xsd') === FALSE) {
149
+        if ($dom->schemaValidate(ROOT.'/devices/xml/eap-metadata.xsd') === FALSE) {
150 150
             throw new Exception("Schema validation failed for eap-metadata");
151 151
         }
152
-        file_put_contents($this->installerBasename . '.eap-config', $dom->saveXML());
153
-        return($this->installerBasename . '.eap-config');
152
+        file_put_contents($this->installerBasename.'.eap-config', $dom->saveXML());
153
+        return($this->installerBasename.'.eap-config');
154 154
     }
155 155
 
156 156
     private const ATTRIBUTENAMES = [
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
             $this->loggerInstance->debug(4, "Missing class definition for $attrName\n");
177 177
             return([]);
178 178
         }
179
-        $className = "\devices\xml\\" . self::ATTRIBUTENAMES[$attrName];
179
+        $className = "\devices\xml\\".self::ATTRIBUTENAMES[$attrName];
180 180
         $objs = [];
181 181
         if ($this->langScope === 'global') {
182 182
             foreach ($attributeList['langs'] as $language => $value) {
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
                 $displayname = new DisplayName();
215 215
                 if (isset($profileNameLangs)) {
216 216
                     $langOrC = isset($profileNameLangs[$language]) ? $profileNameLangs[$language] : $profileNameLangs['C'];
217
-                    $value .= ' - ' . $langOrC;
217
+                    $value .= ' - '.$langOrC;
218 218
                 }
219 219
                 $displayname->setValue($value);
220 220
                 $displayname->setAttributes(['lang' => $language]);
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
             $displayname = new DisplayName();
225 225
             $value = $attr['general:instname'][0];
226 226
             if ($attr['internal:profile_count'][0] > 1) {
227
-                $value .= ' - ' . $attr['profile:name'][0];
227
+                $value .= ' - '.$attr['profile:name'][0];
228 228
             }
229 229
             $displayname->setValue($value);
230 230
             $objs[] = $displayname;
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
         $attr = $this->attributes;
242 242
         if (isset($attr['general:logo_file'][0])) {
243 243
             $logoString = base64_encode($attr['general:logo_file'][0]);
244
-            $logoMime = 'image/' . $attr['internal:logo_file'][0]['mime'];
244
+            $logoMime = 'image/'.$attr['internal:logo_file'][0]['mime'];
245 245
             $providerlogo = new ProviderLogo();
246 246
             $providerlogo->setAttributes(['mime' => $logoMime, 'encoding' => 'base64']);
247 247
             $providerlogo->setValue($logoString);
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
 
347 347
         if (isset($inner["METHOD"]) && $inner["METHOD"]) {
348 348
             $innerauthmethod = new InnerAuthenticationMethod();
349
-            $typeOfInner = "\devices\xml\\" . ($inner["EAP"] ? 'EAPMethod' : 'NonEAPAuthMethod');
349
+            $typeOfInner = "\devices\xml\\".($inner["EAP"] ? 'EAPMethod' : 'NonEAPAuthMethod');
350 350
             $eapmethod = new $typeOfInner();
351 351
             $eaptype = new Type();
352 352
             $eaptype->setValue($inner['METHOD']);
Please login to merge, or discard this patch.
utils/installTranslations.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
  * License: see the web/copyright.php file in the file structure
9 9
  * ******************************************************************************
10 10
  */
11
-require_once dirname(dirname(__FILE__)) . "/config/_config.php";
11
+require_once dirname(dirname(__FILE__))."/config/_config.php";
12 12
 
13 13
 const AREAS = ["web_admin", "web_user", "devices", "core", "diagnostics"];
14 14
 foreach (\config\Master::LANGUAGES as $lang => $details) {
Please login to merge, or discard this patch.
web/skins/modern/accountstatus/accountstatus.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
 $Gui->loggerInstance->debug(4, $operatingSystem);
48 48
 $uiElements = new web\lib\admin\UIElements();
49 49
 if ($operatingSystem) {
50
-    print "recognisedOS = '" . $operatingSystem['device'] . "';\n";
50
+    print "recognisedOS = '".$operatingSystem['device']."';\n";
51 51
 }
52
-require dirname(__DIR__) . '/user/js/cat_js.php';
52
+require dirname(__DIR__).'/user/js/cat_js.php';
53 53
 ?>
54 54
     var lang = "<?php echo($Gui->languageInstance->getLang()) ?>";
55 55
 </script>
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
                         <?php
80 80
                         switch ($statusInfo['errorcode']) {
81 81
                             case "GENERATOR_CONSUMED":
82
-                                echo $uiElements->boxError(_("You attempted to download an installer that was already downloaded before. Please request a new token from your administrator instead."), _("Attempt to re-use download link"), TRUE) . "<p>";
82
+                                echo $uiElements->boxError(_("You attempted to download an installer that was already downloaded before. Please request a new token from your administrator instead."), _("Attempt to re-use download link"), TRUE)."<p>";
83 83
                                 break;
84 84
                             case NULL:
85 85
                             default:
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
                                     echo " ";
103 103
                                     echo sprintf(ngettext("<strong>%d</strong> of your credentials is not valid any more.", "<strong>%d</strong> of your credentials are not valid any more.", $noGoodCerts), $noGoodCerts);
104 104
                                 }
105
-                                echo " <span id='detailtext'>" . _("I want to see the details.") . "</span>";
105
+                                echo " <span id='detailtext'>"._("I want to see the details.")."</span>";
106 106
                                 echo "<table id='cert_details'></table>";
107 107
                             }
108 108
                         }
@@ -111,60 +111,60 @@  discard block
 block discarded – undo
111 111
                             case \core\SilverbulletInvitation::SB_TOKENSTATUS_VALID: // treat both cases as equal
112 112
                             case \core\SilverbulletInvitation::SB_TOKENSTATUS_PARTIALLY_REDEEMED:
113 113
                                 if ($statusInfo['invitation_object']->activationsTotal > 1) { // only show this extra info in the non-trivial case.
114
-                                    echo "<h3>" . sprintf(_("Your invitation token is valid for %d more device activations (%d have already been used)."), $statusInfo['invitation_object']->activationsRemaining, $statusInfo['invitation_object']->activationsTotal - $statusInfo['invitation_object']->activationsRemaining) . "</h3>";
114
+                                    echo "<h3>".sprintf(_("Your invitation token is valid for %d more device activations (%d have already been used)."), $statusInfo['invitation_object']->activationsRemaining, $statusInfo['invitation_object']->activationsTotal - $statusInfo['invitation_object']->activationsRemaining)."</h3>";
115 115
                                 }
116 116
                                 if (!$statusInfo["OS"]) {
117
-                                    echo "<p>" . _("Unfortunately, we are unable to determine your device's operating system. If you have made modifications on your device which prevent it from being recognised (e.g. custom 'User Agent' settings), please undo such modifications. You can come back to this page again; the invitation link has not been used up yet.") . "</p>";
117
+                                    echo "<p>"._("Unfortunately, we are unable to determine your device's operating system. If you have made modifications on your device which prevent it from being recognised (e.g. custom 'User Agent' settings), please undo such modifications. You can come back to this page again; the invitation link has not been used up yet.")."</p>";
118 118
                                     break;
119 119
                                 }
120 120
 
121 121
                                 $dev = new \core\DeviceFactory($statusInfo['OS']['device']);
122 122
                                 $dev->device->calculatePreferredEapType([new \core\common\EAP(\core\common\EAP::EAPTYPE_SILVERBULLET)]);
123 123
                                 if ($dev->device->selectedEap == []) {
124
-                                    echo "<p>" . sprintf(_("Unfortunately, the operating system your device uses (%s) is currently not supported for hosted end-user accounts. You can visit this page with a supported operating system later; the invitation link has not been used up yet."), $statusInfo['OS']['display']) . "</p>";
124
+                                    echo "<p>".sprintf(_("Unfortunately, the operating system your device uses (%s) is currently not supported for hosted end-user accounts. You can visit this page with a supported operating system later; the invitation link has not been used up yet."), $statusInfo['OS']['display'])."</p>";
125 125
                                     break;
126 126
                                 }
127
-                                $message = $dev->device->options['message'] ?? '' ;
127
+                                $message = $dev->device->options['message'] ?? '';
128 128
 
129 129
                                 $sbMessage = $dev->device->options['sb_message'] ?? '';
130 130
                                 if ($message != '' && $sbMessage != '') {
131
-                                    $message = $message . "<p>" . $sbMessage;
131
+                                    $message = $message."<p>".$sbMessage;
132 132
                                 } else {
133
-                                    $message = $message . $sbMessage;
133
+                                    $message = $message.$sbMessage;
134 134
                                 }
135 135
                          
136
-                                echo "<div id='sb_download_message'><p>" . sprintf(_("You can now download a personalised  %s installation program."), \config\ConfAssistant::CONSORTIUM['display_name']);
136
+                                echo "<div id='sb_download_message'><p>".sprintf(_("You can now download a personalised  %s installation program."), \config\ConfAssistant::CONSORTIUM['display_name']);
137 137
 //                       echo sprintf(_("The installation program is <span class='emph'>strictly personal</span>, to be used <span class='emph'>only on this device (%s)</span>, and it is <span class='emph'>not permitted to share</span> this information with anyone."), $statusInfo['OS']['display']);
138 138
                                 echo sprintf(_("The installation program is <span class='emph'>strictly personal</span>, to be used <span class='emph'>only on this device (%s)</span>, and it is <span class='emph'>not permitted to share</span> this information with anyone."), $statusInfo['OS']['display']);
139
-                                echo "<p style='color:red;'>" . sprintf(_("When the system detects abuse such as sharing login data with others, all access rights for you will be revoked and you may be sanctioned by your local %s administrator."), \config\ConfAssistant::CONSORTIUM['display_name']) . "</p>";
140
-                                echo "<p>" . _("During the installation process, you will be asked for the following import PIN. This only happens once during the installation. You do not have to write down this PIN.") . "</p></div>";
139
+                                echo "<p style='color:red;'>".sprintf(_("When the system detects abuse such as sharing login data with others, all access rights for you will be revoked and you may be sanctioned by your local %s administrator."), \config\ConfAssistant::CONSORTIUM['display_name'])."</p>";
140
+                                echo "<p>"._("During the installation process, you will be asked for the following import PIN. This only happens once during the installation. You do not have to write down this PIN.")."</p></div>";
141 141
 
142 142
                                 $importPassword = \core\common\Entity::randomString(4, "0123456789");
143 143
                                 $profile = new \core\ProfileSilverbullet($statusInfo['profile']->identifier, NULL);
144 144
                                 
145
-                                echo "<h2>" . sprintf(_("Import PIN: %s"), $importPassword) . "</h2>";
145
+                                echo "<h2>".sprintf(_("Import PIN: %s"), $importPassword)."</h2>";
146 146
                                 $_SESSION['individualtoken'] = $cleanToken;
147 147
                                 $_SESSION['importpassword'] = $importPassword;
148
-                                echo "<input type='hidden' name='device' value='" . $statusInfo['OS']['device'] . "'/>";
148
+                                echo "<input type='hidden' name='device' value='".$statusInfo['OS']['device']."'/>";
149 149
                                 echo "<input type='hidden' name='generatedfor' value='silverbullet'/>";
150
-                                echo "<button class='large_button' id='user_button_sb' style='height:80px;'><span id='user_buttonnnn'>" . sprintf(_("Click here to download your %s installer!"), \config\ConfAssistant::CONSORTIUM['display_name']) . "</span></button>";
150
+                                echo "<button class='large_button' id='user_button_sb' style='height:80px;'><span id='user_buttonnnn'>".sprintf(_("Click here to download your %s installer!"), \config\ConfAssistant::CONSORTIUM['display_name'])."</span></button>";
151 151
                                 echo "<div class='device_info' id='info_g_sb'></div>";
152 152
                                 break;
153 153
                             case \core\SilverbulletInvitation::SB_TOKENSTATUS_EXPIRED:
154 154
                                 echo "<h2>Invitation link expired</h2>";
155
-                                echo "<p>" . sprintf(_("Unfortunately, the invitation link you just used is too old. The %s sign-up invitation was valid until %s. You cannot use this link any more. Please ask your administrator to issue you a new invitation link."), \config\ConfAssistant::CONSORTIUM['display_name'], $statusInfo['invitation_object']->expiry) . "</p>";
155
+                                echo "<p>".sprintf(_("Unfortunately, the invitation link you just used is too old. The %s sign-up invitation was valid until %s. You cannot use this link any more. Please ask your administrator to issue you a new invitation link."), \config\ConfAssistant::CONSORTIUM['display_name'], $statusInfo['invitation_object']->expiry)."</p>";
156 156
                                 echo "<p>Below is all the information about your account's other login details, if any.</p>";
157 157
 // do NOT break, display full account info instead (this was a previously valid token after all)
158 158
                             case \core\SilverbulletInvitation::SB_TOKENSTATUS_REDEEMED:
159 159
                                 // nothing to say really. User got the breakdown of certs above, and this link doesn't give him any new ones.
160 160
                                 break;
161 161
                             case \core\SilverbulletInvitation::SB_TOKENSTATUS_INVALID:
162
-                                echo "<h2>" . _("Account information not found") . "</h2>";
163
-                                echo "<p>" . sprintf(_("The invitation link you followed does not map to any invititation we have on file.") . "</p><p>" . _("You should use the exact link you got during sign-up to come here. Alternatively, if you have a valid %s credential already, you can visit this page and Accept the question about logging in with a client certificate (select a certificate with a name ending in '…%s')."),\config\ConfAssistant::CONSORTIUM['display_name'], \config\ConfAssistant::SILVERBULLET['realm_suffix']);
162
+                                echo "<h2>"._("Account information not found")."</h2>";
163
+                                echo "<p>".sprintf(_("The invitation link you followed does not map to any invititation we have on file.")."</p><p>"._("You should use the exact link you got during sign-up to come here. Alternatively, if you have a valid %s credential already, you can visit this page and Accept the question about logging in with a client certificate (select a certificate with a name ending in '…%s')."), \config\ConfAssistant::CONSORTIUM['display_name'], \config\ConfAssistant::SILVERBULLET['realm_suffix']);
164 164
                         }
165 165
                         if (isset($statusInfo['profile_id']) && isset($statusInfo['idp_id'])) {
166
-                            echo "<input type='hidden' name='profile' id='profile_id' value='" . $statusInfo['profile_id'] . "'/>";
167
-                            echo "<input type='hidden' id='inst_id' name='idp' value='" . $statusInfo['idp_id'] . "'/>";
166
+                            echo "<input type='hidden' name='profile' id='profile_id' value='".$statusInfo['profile_id']."'/>";
167
+                            echo "<input type='hidden' id='inst_id' name='idp' value='".$statusInfo['idp_id']."'/>";
168 168
                         }
169 169
                         ?>
170 170
                     </div>
@@ -184,18 +184,18 @@  discard block
 block discarded – undo
184 184
     $attributes = $statusInfo['attributes'];
185 185
     $supportInfo = '';
186 186
     if (!empty($attributes['local_url'])) {
187
-        $supportInfo .= '<tr><td>' . ("WWW:") . '</td><td><a href="' . $attributes['local_url'] . '" target="_blank">' . $attributes['local_url'] . '</a></td></tr>';
187
+        $supportInfo .= '<tr><td>'.("WWW:").'</td><td><a href="'.$attributes['local_url'].'" target="_blank">'.$attributes['local_url'].'</a></td></tr>';
188 188
     }
189 189
     if (!empty($attributes['local_email'])) {
190
-        $supportInfo .= '<tr><td>' . ("email:") . '</td><td><a href="' . $attributes['local_email'] . '" target="_blank">' . $attributes['local_email'] . '</a></td></tr>';
190
+        $supportInfo .= '<tr><td>'.("email:").'</td><td><a href="'.$attributes['local_email'].'" target="_blank">'.$attributes['local_email'].'</a></td></tr>';
191 191
     }
192 192
     if (!empty($attributes['local_phone'])) {
193
-        $supportInfo .= '<tr><td>' . ("tel:") . '</td><td><a href="' . $attributes['local_phone'] . '" target="_blank">' . $attributes['local_phone'] . '</a></td></tr>';
193
+        $supportInfo .= '<tr><td>'.("tel:").'</td><td><a href="'.$attributes['local_phone'].'" target="_blank">'.$attributes['local_phone'].'</a></td></tr>';
194 194
     }
195 195
     if ($supportInfo != '') {
196
-        $supportInfo = "<table><tr><th colspan='2'>" . _("If you encounter problems, then you can obtain direct assistance from your organisation at:") . "</th></tr>$supportInfo</table>";
196
+        $supportInfo = "<table><tr><th colspan='2'>"._("If you encounter problems, then you can obtain direct assistance from your organisation at:")."</th></tr>$supportInfo</table>";
197 197
     } else {
198
-        $supportInfo = "<table><tr><th colspan='2'>" . _("If you encounter problems you should ask those who gave you your account for help.") . "</th></tr></table>";
198
+        $supportInfo = "<table><tr><th colspan='2'>"._("If you encounter problems you should ask those who gave you your account for help.")."</th></tr></table>";
199 199
     }
200 200
     ?>
201 201
     <script>
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
             var logo = <?php echo $statusInfo['idp_logo']; ?>;
205 205
             var idpId = <?php echo $statusInfo['idp_id']; ?>;
206 206
             <?php
207
-                if($message != '') {
207
+                if ($message != '') {
208 208
                     echo "message = \"$message\";\n";
209 209
                 }
210 210
             ?>
Please login to merge, or discard this patch.
web/admin/overview_sp.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -150,8 +150,8 @@  discard block
 block discarded – undo
150 150
                         <td>
151 151
                             <?php
152 152
                                 echo "<img src='" . $radiusMessages[$deploymentObject->radius_status_1]['icon'] . 
153
-                                     "' alt='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] . 
154
-                                     "' title='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] . "'>";
153
+                                        "' alt='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] . 
154
+                                        "' title='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] . "'>";
155 155
                             ?>
156 156
                         </td>
157 157
                     </tr>
@@ -173,8 +173,8 @@  discard block
 block discarded – undo
173 173
                         <td>
174 174
                             <?php
175 175
                                 echo "<img src='" . $radiusMessages[$deploymentObject->radius_status_2]['icon'] .
176
-                                     "' alt='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] . 
177
-                                     "' title='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] . "'>";
176
+                                        "' alt='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] . 
177
+                                        "' title='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] . "'>";
178 178
                             ?>
179 179
                         </td>
180 180
                     </tr>
Please login to merge, or discard this patch.
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
  */
27 27
 ?>
28 28
 <?php
29
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
29
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
30 30
 
31 31
 $deco = new \web\lib\admin\PageDecoration();
32 32
 $validator = new \web\lib\common\InputValidation();
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 } else {
39 39
     $link = 'http://';
40 40
 }
41
-$link .= $_SERVER['SERVER_NAME'] . $_SERVER['SCRIPT_NAME'];
41
+$link .= $_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME'];
42 42
 $link = htmlspecialchars($link);
43 43
 
44 44
 echo $deco->defaultPagePrelude(sprintf(_("%s: %s Dashboard"), \config\Master::APPEARANCE['productname'], $uiElements->nomenclatureHotspot));
@@ -93,21 +93,21 @@  discard block
 block discarded – undo
93 93
         <?php
94 94
         if (\config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS'] !== NULL) {
95 95
             echo "<tr>
96
-                        <td>" . _("Check another realm's reachability") . "</td>
96
+                        <td>" . _("Check another realm's reachability")."</td>
97 97
                         <td><form method='post' action='../diag/action_realmcheck.php?inst_id=$my_inst->identifier' accept-charset='UTF-8'>
98 98
                               <input type='text' name='realm' id='realm'>
99 99
                               <input type='hidden' name='comefrom' id='comefrom' value='$link'/>
100
-                              <button type='submit'>" . _("Go!") . "</button>
100
+                              <button type='submit'>"._("Go!")."</button>
101 101
                             </form>
102 102
                         </td>
103 103
                     </tr>";
104 104
         }
105 105
         if (\config\ConfAssistant::CONSORTIUM['name'] == "eduroam") { // SW: APPROVED
106 106
             echo "<tr>
107
-                        <td>" . sprintf(_("Check %s server status"), $uiElements->nomenclatureFed) . "</td>
107
+                        <td>" . sprintf(_("Check %s server status"), $uiElements->nomenclatureFed)."</td>
108 108
                         <td>
109 109
                            <form action='https://monitor.eduroam.org/mon_direct.php' accept-charset='UTF-8'>
110
-                              <button type='submit'>" . _("Go!") . "</button>
110
+                              <button type='submit'>" . _("Go!")."</button>
111 111
                            </form>
112 112
                         </td>
113 113
                     </tr>";
@@ -118,10 +118,10 @@  discard block
 block discarded – undo
118 118
     <?php
119 119
     $hotspotProfiles = $my_inst->listDeployments();
120 120
     if (count($hotspotProfiles) == 0) { // no profiles yet.
121
-        echo "<h2>" . sprintf(_("There are not yet any known deployments for your %s."), $uiElements->nomenclatureHotspot) . "</h2>";
121
+        echo "<h2>".sprintf(_("There are not yet any known deployments for your %s."), $uiElements->nomenclatureHotspot)."</h2>";
122 122
     }
123 123
     if (count($hotspotProfiles) > 0) { // no profiles yet.
124
-        echo "<h2>" . sprintf(_("Deployments for this %s"), $uiElements->nomenclatureHotspot) . "</h2>";
124
+        echo "<h2>".sprintf(_("Deployments for this %s"), $uiElements->nomenclatureHotspot)."</h2>";
125 125
         // display an info box with the connection data
126 126
     }
127 127
    
@@ -141,19 +141,19 @@  discard block
 block discarded – undo
141 141
         ?>
142 142
         <div style='display: table-row; margin-bottom: 20px;'>
143 143
             <div class='profilebox' style='display: table-cell;'>
144
-                <h2><?php echo core\DeploymentManaged::PRODUCTNAME . " (<span style='color:" . ( $deploymentObject->status == \core\AbstractDeployment::INACTIVE ? "red;'>" . _("inactive") : "green;'>" . _("active") ) . "</span>)"; ?></h2>
144
+                <h2><?php echo core\DeploymentManaged::PRODUCTNAME." (<span style='color:".($deploymentObject->status == \core\AbstractDeployment::INACTIVE ? "red;'>"._("inactive") : "green;'>"._("active"))."</span>)"; ?></h2>
145 145
                 <table>
146 146
                     <tr>
147 147
                         <td><strong><?php echo _("Your primary RADIUS server") ?></strong><br/>
148 148
                         <?php
149 149
                             if ($deploymentObject->host1_v4 !== NULL) {
150
-                                echo _("IPv4") . ": " . $deploymentObject->host1_v4;
150
+                                echo _("IPv4").": ".$deploymentObject->host1_v4;
151 151
                             }
152 152
                             if ($deploymentObject->host1_v4 !== NULL && $deploymentObject->host1_v6 !== NULL) {
153 153
                                 echo "<br/>";
154 154
                             }
155 155
                             if ($deploymentObject->host1_v6 !== NULL) {
156
-                                echo _("IPv6") . ": " . $deploymentObject->host1_v6;
156
+                                echo _("IPv6").": ".$deploymentObject->host1_v6;
157 157
                             }
158 158
                             ?>
159 159
                         </td>
@@ -161,9 +161,9 @@  discard block
 block discarded – undo
161 161
                         <td><?php echo $deploymentObject->port1; ?></td>
162 162
                         <td>
163 163
                             <?php
164
-                                echo "<img src='" . $radiusMessages[$deploymentObject->radius_status_1]['icon'] . 
165
-                                     "' alt='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] . 
166
-                                     "' title='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] . "'>";
164
+                                echo "<img src='".$radiusMessages[$deploymentObject->radius_status_1]['icon']. 
165
+                                     "' alt='".$radiusMessages[$deploymentObject->radius_status_1]['text']. 
166
+                                     "' title='".$radiusMessages[$deploymentObject->radius_status_1]['text']."'>";
167 167
                             ?>
168 168
                         </td>
169 169
                     </tr>
@@ -171,22 +171,22 @@  discard block
 block discarded – undo
171 171
                         <td><strong><?php echo _("Your backup RADIUS server") ?><br/></strong>
172 172
                             <?php
173 173
                             if ($deploymentObject->host2_v4 !== NULL) {
174
-                                echo _("IPv4") . ": " . $deploymentObject->host2_v4;
174
+                                echo _("IPv4").": ".$deploymentObject->host2_v4;
175 175
                             }
176 176
                             if ($deploymentObject->host2_v4 !== NULL && $deploymentObject->host2_v6 !== NULL) {
177 177
                                 echo "<br/>";
178 178
                             }
179 179
                             if ($deploymentObject->host2_v6 !== NULL) {
180
-                                echo _("IPv6") . ": " . $deploymentObject->host2_v6;
180
+                                echo _("IPv6").": ".$deploymentObject->host2_v6;
181 181
                             }
182 182
                             ?></td>
183 183
                         <td><?php echo _("RADIUS port number: ") ?></td>
184 184
                         <td><?php echo $deploymentObject->port2; ?></td>
185 185
                         <td>
186 186
                             <?php
187
-                                echo "<img src='" . $radiusMessages[$deploymentObject->radius_status_2]['icon'] .
188
-                                     "' alt='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] . 
189
-                                     "' title='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] . "'>";
187
+                                echo "<img src='".$radiusMessages[$deploymentObject->radius_status_2]['icon'].
188
+                                     "' alt='".$radiusMessages[$deploymentObject->radius_status_2]['text']. 
189
+                                     "' title='".$radiusMessages[$deploymentObject->radius_status_2]['text']."'>";
190 190
                             ?>
191 191
                         </td>
192 192
                     </tr>
@@ -237,12 +237,12 @@  discard block
 block discarded – undo
237 237
                                     if (isset($res['FAILURE']) && $res['FAILURE'] > 0) {
238 238
                                         echo '<br>';
239 239
                                         if ($res['FAILURE'] == 2) {
240
-                                            echo ' <span style="color: red;">' . _("Activation failure.") . '</span>';
240
+                                            echo ' <span style="color: red;">'._("Activation failure.").'</span>';
241 241
                                         } else {
242 242
                                             if (isset($_GET['res'][1]) && $_GET['res']['1'] == 'FAILURE') {
243
-                                                echo ' <span style="color: red;">' . _("Activation failure for your primary RADIUS server.") . '</span>';
243
+                                                echo ' <span style="color: red;">'._("Activation failure for your primary RADIUS server.").'</span>';
244 244
                                             } else {
245
-                                                echo ' <span style="color: red;">' . _("Activation failure for your backup RADIUS server.") . '</span>';
245
+                                                echo ' <span style="color: red;">'._("Activation failure for your backup RADIUS server.").'</span>';
246 246
                                             }
247 247
                                         }
248 248
                                     }
@@ -262,12 +262,12 @@  discard block
 block discarded – undo
262 262
                                     if ($res['FAILURE'] > 0) {
263 263
                                         echo '<br>';
264 264
                                         if ($res['FAILURE'] == 2) {
265
-                                            echo ' <span style="color: red;">' . _("Failure during deactivation, your request is queued for handling") . '</span>';
265
+                                            echo ' <span style="color: red;">'._("Failure during deactivation, your request is queued for handling").'</span>';
266 266
                                         } else {
267 267
                                             if (isset($_GET['res'][1]) && $_GET['res']['1'] == 'FAILURE') {
268
-                                                echo ' <span style="color: red;">' . _("Deactivation failure for your primary RADIUS server, your request is queued.") . '</span>';
268
+                                                echo ' <span style="color: red;">'._("Deactivation failure for your primary RADIUS server, your request is queued.").'</span>';
269 269
                                             } else {
270
-                                                echo ' <span style="color: red;">' . _("Deactivation failure for your backup RADIUS server, your request is queued.") . '</span>';
270
+                                                echo ' <span style="color: red;">'._("Deactivation failure for your backup RADIUS server, your request is queued.").'</span>';
271 271
                                             }
272 272
                                         }
273 273
                                     }
Please login to merge, or discard this patch.
utils/SP_consistency_check.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 require_once dirname(dirname(__FILE__)) . "/config/_config.php";
3 3
 /**
4
-    * check if URL responds with 200
5
-    *
6
-    * @param string $srv server name
7
-    * @return integer or NULL
4
+ * check if URL responds with 200
5
+ *
6
+ * @param string $srv server name
7
+ * @return integer or NULL
8 8
 */
9 9
 function checkConfigRADIUSDaemon ($srv) {
10 10
     $ch = curl_init();
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,22 +1,22 @@  discard block
 block discarded – undo
1 1
 <?php
2
-require_once dirname(dirname(__FILE__)) . "/config/_config.php";
2
+require_once dirname(dirname(__FILE__))."/config/_config.php";
3 3
 /**
4 4
     * check if URL responds with 200
5 5
     *
6 6
     * @param string $srv server name
7 7
     * @return integer or NULL
8 8
 */
9
-function checkConfigRADIUSDaemon ($srv) {
9
+function checkConfigRADIUSDaemon($srv) {
10 10
     $ch = curl_init();
11 11
     if ($ch === FALSE) {
12 12
         return NULL;
13 13
     }
14 14
     $timeout = 10;
15
-    curl_setopt ( $ch, CURLOPT_URL, $srv );
16
-    curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );
17
-    curl_setopt ( $ch, CURLOPT_TIMEOUT, $timeout );
15
+    curl_setopt($ch, CURLOPT_URL, $srv);
16
+    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
17
+    curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
18 18
     curl_exec($ch);
19
-    $http_code = curl_getinfo( $ch, CURLINFO_HTTP_CODE );
19
+    $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
20 20
     if ($http_code == 200) {
21 21
         return 1;
22 22
     }
@@ -52,8 +52,8 @@  discard block
 block discarded – undo
52 52
 }
53 53
 $siteStatus = array();
54 54
 foreach (array_keys($brokenDeployments) as $server_id) {
55
-    print "check $server_id " . $radiusSite[$server_id] . "\n";
56
-    $siteStatus[$server_id]  = checkConfigRADIUSDaemon('http://' . $radiusSite[$server_id]);
55
+    print "check $server_id ".$radiusSite[$server_id]."\n";
56
+    $siteStatus[$server_id] = checkConfigRADIUSDaemon('http://'.$radiusSite[$server_id]);
57 57
     if ($siteStatus[$server_id]) {
58 58
         echo "\ncheck radius\n";
59 59
         echo \config\Diagnostics::RADIUSSPTEST['port']."\n";
Please login to merge, or discard this patch.