Passed
Push — master ( 4a7490...26f0ec )
by Tomasz
07:21 queued 15s
created
core/EntityWithDBProperties.php 1 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/skins/modern/diag/diag.php 1 patch
Spacing   +81 added lines, -81 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
 
55 55
 </script>
@@ -78,12 +78,12 @@  discard block
 block discarded – undo
78 78
     </div>
79 79
     <div id="main_body">
80 80
         <div id="user_page">
81
-            <?php echo $divs->divPagetitle(_("Diagnostics site") . " (<span style='color:red'>beta</span>)", ""); ?>
81
+            <?php echo $divs->divPagetitle(_("Diagnostics site")." (<span style='color:red'>beta</span>)", ""); ?>
82 82
             <div id="user_info" style='padding-top: 10px;'>
83 83
             <div id='diagnostic_choice'>
84
-                <?php echo _("The diagnostics system will do its best to identify and resolve your problems!") . ' ' . _("Please help the system by answering the questions as precisely as possible.") . "<br/>" . _("Are you a") . ' '; ?>
85
-                <input type='radio' name='diagnostic_usertype' value='0'><?php echo _("end-user") . ' ' . _("or"); ?>   
86
-                <input type='radio' name='diagnostic_usertype' value='1' <?php if ($admin == 1) { echo " checked"; } ?> > <?php echo _("eduroam administrator") .'?'; ?>
84
+                <?php echo _("The diagnostics system will do its best to identify and resolve your problems!").' '._("Please help the system by answering the questions as precisely as possible.")."<br/>"._("Are you a").' '; ?>
85
+                <input type='radio' name='diagnostic_usertype' value='0'><?php echo _("end-user").' '._("or"); ?>   
86
+                <input type='radio' name='diagnostic_usertype' value='1' <?php if ($admin == 1) { echo " checked"; } ?> > <?php echo _("eduroam administrator").'?'; ?>
87 87
             </div>
88 88
             <div id='diagnostic_enduser' style='display: none;'>
89 89
                 <h2><?php echo _("Tools for End Users"); ?></h2>
@@ -93,24 +93,24 @@  discard block
 block discarded – undo
93 93
                 ?>
94 94
                 </p>
95 95
                 <?php
96
-                    echo '<div id="before_stage_1"><h3>' . _("The system needs some information on your home institution - issuer of your account") . '</h3>';
96
+                    echo '<div id="before_stage_1"><h3>'._("The system needs some information on your home institution - issuer of your account").'</h3>';
97 97
                     echo _("What is the realm part of your user account (the part behind the @ of 'your.username@<b>realm.tld</b>):");
98 98
                 ?>
99 99
                 <input type='text' name='user_realm' id='user_realm' value=''>
100 100
                 <?php
101
-                    echo '<div id="realm_by_select"><br/>' . _("alternatively") . '<br/>';
102
-                    echo _("You can select your home institution from the following list") . '<br/>';
101
+                    echo '<div id="realm_by_select"><br/>'._("alternatively").'<br/>';
102
+                    echo _("You can select your home institution from the following list").'<br/>';
103 103
                     echo '<div id="select_idp_country"><a href="" id="idp_countries_list">';    
104
-                    echo '<span id="realmselect">' . _("Click to select your country/region and organisation") . '</span></a></div>';
104
+                    echo '<span id="realmselect">'._("Click to select your country/region and organisation").'</span></a></div>';
105 105
                 ?>
106 106
                 <div id="select_idp_area" style="display:none;">
107 107
                 </div>
108 108
                 </div>
109 109
                 <div id="position_info">
110 110
                     <?php
111
-                        echo '<h3>' . _("Optionally, to improve tests, you can provide information on your current location") . '</h3>';
111
+                        echo '<h3>'._("Optionally, to improve tests, you can provide information on your current location").'</h3>';
112 112
                         echo '<div id="select_sp_country"><a href="" id="sp_countries_list">';    
113
-                        echo '<span id="spselect">' . _("Click to select a location in which you have an eduroam problem") . '</span></a></div>';
113
+                        echo '<span id="spselect">'._("Click to select a location in which you have an eduroam problem").'</span></a></div>';
114 114
                     ?>
115 115
                     <div id="select_sp_area" style="display:none;">
116 116
                     </div>
@@ -143,9 +143,9 @@  discard block
 block discarded – undo
143 143
                             echo 'none';
144 144
                         }
145 145
                         echo ";'>";
146
-                        echo '<h3>' . _("Which problem are you reporting?") . '</h3>';
146
+                        echo '<h3>'._("Which problem are you reporting?").'</h3>';
147 147
                         echo '<input type="radio" name="problem_type" value="1">';
148
-                        echo _("SP contacting IdP due to technical problems or abuse") . '<br>';
148
+                        echo _("SP contacting IdP due to technical problems or abuse").'<br>';
149 149
                         echo '<input type="radio" name="problem_type" value="2">';
150 150
                         echo _("IdP contacting SP due to technical problems");
151 151
                         echo "<div id='idp_contact_area'></div>";
@@ -154,9 +154,9 @@  discard block
 block discarded – undo
154 154
                         echo "</div>"; 
155 155
                     } else {
156 156
                         echo "0\">";
157
-                        echo _("This service is for authenticated admins only.") . '<br>';
158
-                        echo "<a href=\"diag.php?admin=1\">" .
159
-                             _("eduroam® admin access is needed") . "</a>";
157
+                        echo _("This service is for authenticated admins only.").'<br>';
158
+                        echo "<a href=\"diag.php?admin=1\">".
159
+                             _("eduroam® admin access is needed")."</a>";
160 160
                     }
161 161
                 ?>
162 162
             </div> 
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
         if (type === 'idp' || type === 'sp') {
181 181
             shtml = '<table><tbody><tr id="row_'+type+'_country"></tr>';
182 182
             shtml = shtml + '<tr id="row_'+type+'_institution" style="visibility: collapse;">';
183
-            shtml = shtml + '<td>' + <?php echo '"' . _("Select institiution:") . '"'; ?> + '</td><td></td></tr>';
183
+            shtml = shtml + '<td>' + <?php echo '"'._("Select institiution:").'"'; ?> + '</td><td></td></tr>';
184 184
             if (type === 'idp') {
185 185
                 shtml = shtml + '<tr id="row_idp_realm"></tr>';
186 186
             }
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
         var options = '';
207 207
         var selecthead = '';
208 208
         if (type1 === 'sp' || type1 === 'idp') {
209
-            selecthead = <?php echo '"<td>' . _("Select country or region:") . ' </td>"'; ?>;
209
+            selecthead = <?php echo '"<td>'._("Select country or region:").' </td>"'; ?>;
210 210
             selecthead = selecthead + '<td>\n';
211 211
         }
212 212
         var select = '<select id="' + type1 + '_country" name="' + type1 + '_country" style="margin-left:0px; width:400px;">';
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
             options = ($('#'+type2+'_country').html());
215 215
             countryAddSelect(selecthead, select + options + '</select>', type1);
216 216
         } else {
217
-            var comment = <?php echo '"<br><br>' . _("Fetching country/region list") . '..."'; ?>;
217
+            var comment = <?php echo '"<br><br>'._("Fetching country/region list").'..."'; ?>;
218 218
             inProgress(1, comment);
219 219
             $.ajax({
220 220
                 url: "findRealm.php",
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
         return false;
252 252
     }
253 253
     function testSociopath(realm, answer) {
254
-        var comment = <?php echo '"' . _("Testing realm") . '..."'; ?>; 
254
+        var comment = <?php echo '"'._("Testing realm").'..."'; ?>; 
255 255
         inProgress(1, comment);
256 256
         if ($('#tested_realm').length == 0) {
257 257
             $('<input>').attr({
@@ -275,9 +275,9 @@  discard block
 block discarded – undo
275 275
                                 query = '<input type="hidden" id="tested_realm" value="' + realm + '">';
276 276
                             }    
277 277
                             query = query + '<div id="current_query">'+data['TEXT']+'</div>';
278
-                            query = query + '<div><button id="answer_yes">' + <?php echo '"' . _("Yes") . '"'; ?> + '</button>';
279
-                            query = query + '<button style="margin-left:20px;" id="answer_no">' + <?php echo '"' . _("No") . '"'; ?> + '</button>';
280
-                            query = query + '<button style="margin-left:20px;" id="answer_noidea">' + <?php echo '"' . _("I don't know") . '"'; ?> + '</button></div>';
278
+                            query = query + '<div><button id="answer_yes">' + <?php echo '"'._("Yes").'"'; ?> + '</button>';
279
+                            query = query + '<button style="margin-left:20px;" id="answer_no">' + <?php echo '"'._("No").'"'; ?> + '</button>';
280
+                            query = query + '<button style="margin-left:20px;" id="answer_noidea">' + <?php echo '"'._("I don't know").'"'; ?> + '</button></div>';
281 281
                             $('#sociopath_queries').html(query);
282 282
                             $('#sociopath_query_area').show();
283 283
                         }
@@ -308,55 +308,55 @@  discard block
 block discarded – undo
308 308
        }); 
309 309
     }
310 310
     function finalVerdict(realm, verdict) {
311
-        var title = <?php echo '"' . _("Diagnostic tests results for selected realm") . '"'; ?>;
311
+        var title = <?php echo '"'._("Diagnostic tests results for selected realm").'"'; ?>;
312 312
         result = '<div class="padding">';
313 313
         result = result + '<div><h3>';
314
-        result = result + <?php echo '"' . _("The result for tested realm:") . ' "'; ?> + realm;
314
+        result = result + <?php echo '"'._("The result for tested realm:").' "'; ?> + realm;
315 315
         result = result + '</h3></p><div style="padding: 5px;"><div style="padding: 0px;">';
316
-        result = result + <?php echo '"' . _("The system identified") . '" '; ?>  + ' ';
316
+        result = result + <?php echo '"'._("The system identified").'" '; ?>  + ' ';
317 317
         result = result + Object.keys(verdict).length + ' ';
318
-        result = result + <?php echo '"' . _("suspected areas which potentially can cause a problem.") . '"'; ?> + '<br>';
319
-        result = result + <?php echo '"' . _("Next to the problem description we show a speculated probability of this event.") . '"'; ?>;
318
+        result = result + <?php echo '"'._("suspected areas which potentially can cause a problem.").'"'; ?> + '<br>';
319
+        result = result + <?php echo '"'._("Next to the problem description we show a speculated probability of this event.").'"'; ?>;
320 320
         result = result + '</div><div style="padding: 5px;"><table>';
321 321
         k = 1;
322 322
         for (key in verdict) {
323 323
             result = result + '<tr><td>' + k + '.</td>';
324 324
             k = k + 1;
325 325
             if (key === 'INFRA_DEVICE') {
326
-                result = result + '<td>' + <?php echo '"' . _("Your device configuration is broken") . '"'; ?> + '</td>';
326
+                result = result + '<td>' + <?php echo '"'._("Your device configuration is broken").'"'; ?> + '</td>';
327 327
             }
328 328
             if (key === 'INFRA_SP_80211') {
329
-                result = result + '<td>' + <?php echo '"' . _("The Wi-Fi network in your vicinity has quality issues") . '"'; ?> + '</td>';
329
+                result = result + '<td>' + <?php echo '"'._("The Wi-Fi network in your vicinity has quality issues").'"'; ?> + '</td>';
330 330
             }
331 331
             if (key === 'INFRA_SP_LAN') {
332
-                result = result + '<td>' + <?php echo '"' . _("The network environment around you is broken") . '"'; ?> + '</td>';
332
+                result = result + '<td>' + <?php echo '"'._("The network environment around you is broken").'"'; ?> + '</td>';
333 333
             }
334 334
             if (key === 'INFRA_SP_RADIUS') {
335
-                result = result + '<td>' + <?php echo '"' . _("The RADIUS server of your service provider is the source of the problem") . '"'; ?> + '</td>';
335
+                result = result + '<td>' + <?php echo '"'._("The RADIUS server of your service provider is the source of the problem").'"'; ?> + '</td>';
336 336
             }
337 337
             if (key === 'INFRA_IDP_AUTHBACKEND') {
338
-                result = result + '<td>' + <?php echo '"' . _("The RADIUS server in your home institution is currently unable to authenticate you") . '"'; ?> + '</td>';
338
+                result = result + '<td>' + <?php echo '"'._("The RADIUS server in your home institution is currently unable to authenticate you").'"'; ?> + '</td>';
339 339
             }
340 340
             if (key === 'INFRA_NRO_SP') {
341
-                result = result + '<td>' + <?php echo '"' . _("The national server in the country/region you are visiting is not functioning correctly") . '"'; ?> + '</td>';
341
+                result = result + '<td>' + <?php echo '"'._("The national server in the country/region you are visiting is not functioning correctly").'"'; ?> + '</td>';
342 342
             }
343 343
             if (key === 'INFRA_LINK_ETLR_NRO_SP') {
344
-                result = result + '<td>' + <?php echo '"' . _("The link between the national server of the country/region you are visiting and the top-level server is broken") . '"'; ?> + '</td>';
344
+                result = result + '<td>' + <?php echo '"'._("The link between the national server of the country/region you are visiting and the top-level server is broken").'"'; ?> + '</td>';
345 345
             }
346 346
             if (key === 'INFRA_LINK_ETLR_NRO_IdP') {
347
-                result = result + '<td>' + <?php echo '"' . _("The link between the national server of your home country/region and the top-level server is broken") . '"'; ?> + '</td>';
347
+                result = result + '<td>' + <?php echo '"'._("The link between the national server of your home country/region and the top-level server is broken").'"'; ?> + '</td>';
348 348
             }
349 349
             if (key === 'INFRA_ETLR') {
350
-                result = result + '<td>' + <?php echo '"' . _("The communication to the top-level server is down") . '"'; ?> + '</td>';
350
+                result = result + '<td>' + <?php echo '"'._("The communication to the top-level server is down").'"'; ?> + '</td>';
351 351
             }
352 352
             if (key === 'INFRA_NRO_IdP') {
353
-                result = result + '<td>' + <?php echo '"' . _("The national server in your home country/region is not functioning properly.") . '"'; ?> + '</td>';
353
+                result = result + '<td>' + <?php echo '"'._("The national server in your home country/region is not functioning properly.").'"'; ?> + '</td>';
354 354
             }
355 355
             if (key === 'INFRA_IdP_RADIUS') {
356
-                result = result + '<td>' + <?php echo '"' . _("The RADIUS server of your home institution is the source of the problem") . '"'; ?> + '</td>';
356
+                result = result + '<td>' + <?php echo '"'._("The RADIUS server of your home institution is the source of the problem").'"'; ?> + '</td>';
357 357
             }
358 358
             if (key === 'INFRA_NONEXISTENTREALM') {
359
-                result = result + '<td>' + <?php echo '"' . _("This realm does not exist") . '"'; ?> + '</td>';
359
+                result = result + '<td>' + <?php echo '"'._("This realm does not exist").'"'; ?> + '</td>';
360 360
             }
361 361
             result = result + '<td style="padding-left: 5px;">' + (verdict[key] * 100).toFixed(2) + "%</td></tr>";
362 362
         }
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
         return false;
469 469
     });
470 470
     $(document).on('change', '#idp_country' , function() {
471
-        var comment = <?php echo '"' . _("Fetching institutions list") . '..."'; ?>;  
471
+        var comment = <?php echo '"'._("Fetching institutions list").'..."'; ?>;  
472 472
         var id = $(this).attr('id');
473 473
         var k = id.indexOf('_');
474 474
         var type = id.substr(0,k);
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
                         var shtml = '';
487 487
                         var select = '';
488 488
                         if (type !== 'asp') {
489
-                            shtml = <?php echo '"<td>' . _("Select institution:") . '</td><td>"'; ?>;
489
+                            shtml = <?php echo '"<td>'._("Select institution:").'</td><td>"'; ?>;
490 490
                         }
491 491
                         select = '<select id="' + type + '_inst" name="' + type + '_inst" style="margin-left:0px; width:400px;"><option value=""></option>';
492 492
                         for (var i in institutions) {
@@ -507,7 +507,7 @@  discard block
 block discarded – undo
507 507
                     } else {
508 508
                         if (data.status === 0) {
509 509
                             inProgress(0);
510
-                            var msg = <?php echo '"' . _("The database does not contain the information needed to help you in realm selection for this country. You have to provide realm you are interested in.") . '"'; ?>;
510
+                            var msg = <?php echo '"'._("The database does not contain the information needed to help you in realm selection for this country. You have to provide realm you are interested in.").'"'; ?>;
511 511
                             alert(msg);
512 512
                             $('#select_idp_country').show();
513 513
                             $('#select_idp_area').hide();
@@ -516,7 +516,7 @@  discard block
 block discarded – undo
516 516
                 },
517 517
                 error:function() {
518 518
                     inProgress(0);
519
-                    var msg = <?php echo '"' . _("Can not search database. You have to provide realm you are interested in.") . '"'; ?>;
519
+                    var msg = <?php echo '"'._("Can not search database. You have to provide realm you are interested in.").'"'; ?>;
520 520
                     alert(msg);
521 521
                     $('#select_idp_country').show();
522 522
                     $('#select_idp_area').hide();
@@ -531,7 +531,7 @@  discard block
 block discarded – undo
531 531
         return false;
532 532
     });
533 533
     $(document).on('change', '#sp_country, #asp_country' , function() {
534
-        var comment = <?php echo '"' . _("Fetching institutions list") . '..."'; ?>;  
534
+        var comment = <?php echo '"'._("Fetching institutions list").'..."'; ?>;  
535 535
         var id = $(this).attr('id');
536 536
         var k = id.indexOf('_');
537 537
         var type = id.substr(0,k);
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
                         var shtml = '';
550 550
                         var select = '';
551 551
                         if (type !== 'asp') {
552
-                            shtml = <?php echo '"<td>' . _("Select institution:") . '</td><td>"'; ?>;
552
+                            shtml = <?php echo '"<td>'._("Select institution:").'</td><td>"'; ?>;
553 553
                         }
554 554
                         select = '<select id="' + type + '_inst" name="' + type + '_inst" style="margin-left:0px; width:400px;"><option value=""></option>';
555 555
                         for (var i in hotspots) {
@@ -572,7 +572,7 @@  discard block
 block discarded – undo
572 572
                             inProgress(0);
573 573
                             var select = '<select id="' + type + '_inst" name="' + type + '_inst" style="margin-left:0px; width:400px;"><option value="">';
574 574
                             var shtml = '<td></td><td>';
575
-                            select = select + <?php echo '"' . _("Other location") . '"'; ?> + '</option></select></td>';
575
+                            select = select + <?php echo '"'._("Other location").'"'; ?> + '</option></select></td>';
576 576
                             if (type !== 'asp') {
577 577
                                 $('#row_' + type + '_institution').html('');
578 578
                                 $('#row_' + type + '_institution').append(shtml + select);
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
             $('#start_test_area').hide();
607 607
             return false;
608 608
         }
609
-        var comment = <?php echo '"' . _("Fetching realms list") . '..."'; ?>;
609
+        var comment = <?php echo '"'._("Fetching realms list").'..."'; ?>;
610 610
         inProgress(1, comment);
611 611
         $.ajax({
612 612
             url: "findRealm.php",
@@ -618,7 +618,7 @@  discard block
 block discarded – undo
618 618
                     var realms = data.realms;
619 619
                     var realmselect = '';
620 620
                     if (realms.length > 1) {
621
-                        realmselect = <?php echo '"<td>' . _("Check realm(s):") . '</td>"'; ?>;
621
+                        realmselect = <?php echo '"<td>'._("Check realm(s):").'</td>"'; ?>;
622 622
                         realmselect = realmselect + '<td>' + "<span style='margin-left: 10px'>";
623 623
                         for (var i in realms) {
624 624
                             realmselect = realmselect + '<input type="radio" name="realm" ';
@@ -630,7 +630,7 @@  discard block
 block discarded – undo
630 630
                         }
631 631
                         realmselect = realmselect + '</span></td>';
632 632
                     } else {
633
-                        realmselect = <?php echo '"<td>' . _("Realm:") . '</td>"'; ?>;
633
+                        realmselect = <?php echo '"<td>'._("Realm:").'</td>"'; ?>;
634 634
                         realmselect = realmselect + '<td>' + "<span style='margin-left: 10px'>";
635 635
                         realmselect = realmselect + realms[0] + '</span>';
636 636
                         realmselect = realmselect + '<input type="hidden" name="realm" value="' + realms[0] + '">';
@@ -685,7 +685,7 @@  discard block
 block discarded – undo
685 685
             });
686 686
             t = 1;
687 687
         }
688
-        var comment = <?php echo '"' . _("Running realm tests") . '..."'; ?>;
688
+        var comment = <?php echo '"'._("Running realm tests").'..."'; ?>;
689 689
         inProgress(1, comment);
690 690
         /*waiting(comment);*/
691 691
         $.ajax({
@@ -729,7 +729,7 @@  discard block
 block discarded – undo
729 729
                             }
730 730
                         });
731 731
                         $('#sp_questions > tbody').append('<tr class="error_row"><td>' +
732
-                                <?php echo '"' . _("Realm is not registered with the eduroam database:") . '"'; ?> +
732
+                                <?php echo '"'._("Realm is not registered with the eduroam database:").'"'; ?> +
733 733
                                 '</td><td>' + realm + '</td></tr>');
734 734
                         $('#admin_realm').val('');
735 735
                     }    
@@ -753,7 +753,7 @@  discard block
 block discarded – undo
753 753
         testSociopath('', answer);
754 754
     });
755 755
     $('#realmtest').click(function(event){
756
-        var comment = <?php echo '"<br><br>' . _("Running realm tests") . '..."'; ?>;
756
+        var comment = <?php echo '"<br><br>'._("Running realm tests").'..."'; ?>;
757 757
         inProgress(1, comment);
758 758
         $('#start_test_area').hide();
759 759
         if ($('#select_sp_area').is(':hidden')) {
@@ -801,13 +801,13 @@  discard block
 block discarded – undo
801 801
                         reset_footer();
802 802
                         testSociopath(realm, 0);
803 803
                     } else {
804
-                        var title = <?php echo '"' . _("Diagnostics results for selected realms") . '"'; ?>;
805
-                        result = '<div class="padding"><h3>' + <?php echo '"' . _("An unknown problem occured") . '"'; ?>;
804
+                        var title = <?php echo '"'._("Diagnostics results for selected realms").'"'; ?>;
805
+                        result = '<div class="padding"><h3>' + <?php echo '"'._("An unknown problem occured").'"'; ?>;
806 806
                         result = result + '</h3>'
807 807
                         if (r.length == 1) {
808
-                            result = result + <?php echo '"' . _("This test includes checking of the following realm") . '"'; ?>;
808
+                            result = result + <?php echo '"'._("This test includes checking of the following realm").'"'; ?>;
809 809
                         } else {    
810
-                            result = result + <?php echo '"' . _("This test includes checking of the following realms") . '"'; ?>;
810
+                            result = result + <?php echo '"'._("This test includes checking of the following realms").'"'; ?>;
811 811
                         }
812 812
                         result = result + ': '
813 813
                         for (var i=0; i < r.length; i++) {
@@ -817,7 +817,7 @@  discard block
 block discarded – undo
817 817
                             result = result + r[i];
818 818
                         }
819 819
                         result = result + '.<br>';
820
-                        result = result + <?php echo '"' . _("You should report this to") . '"'; ?> + ' <a href="mailto:[email protected]">[email protected]</a>';
820
+                        result = result + <?php echo '"'._("You should report this to").'"'; ?> + ' <a href="mailto:[email protected]">[email protected]</a>';
821 821
                         result = result + '</div>';
822 822
                         $('#after_stage_1').hide();
823 823
                         $('#before_stage_1').show();
@@ -877,7 +877,7 @@  discard block
 block discarded – undo
877 877
                 });
878 878
             });
879 879
         });
880
-        var comment = <?php echo '"' . _("Running realm tests") . '..."'; ?>;
880
+        var comment = <?php echo '"'._("Running realm tests").'..."'; ?>;
881 881
         inProgress(1, comment);
882 882
         $.ajax({
883 883
             url: "findRealm.php",
@@ -948,29 +948,29 @@  discard block
 block discarded – undo
948 948
             success:function(data) {
949 949
                 if (data.status === 1) {
950 950
                     var result = '';
951
-                    var title = <?php echo '"' . _("eduroam admin report submission") . '"'; ?>;
951
+                    var title = <?php echo '"'._("eduroam admin report submission").'"'; ?>;
952 952
                     result = '<div class="padding">';
953 953
                     if (type == 'idp_send') {
954
-                        result = result + '<h3>'+ <?php echo '"' . _("SP contacting IdP due to technical problems or abuse") . '"'; ?> + '</h3>';
954
+                        result = result + '<h3>'+ <?php echo '"'._("SP contacting IdP due to technical problems or abuse").'"'; ?> + '</h3>';
955 955
                         result = result + '<table>';
956
-                        result = result + '<tr><td>' + <?php echo '"' . _("Reason") . '"'; ?> + '</td><td>' + data.reason + '</td></tr>';
957
-                        result = result + '<tr><td>' + <?php echo '"' . _("SP email") . '"'; ?> + '</td><td>' + data.email + '</td></tr>';
958
-                        result = result + '<tr><td>' + <?php echo '"' . _("IdP email(s)") . '"'; ?> + '</td><td>' + data.idpcontact + '</td></tr>';
959
-                        result = result + '<tr><td>' + <?php echo '"' . _("Event's timestamp") . '"'; ?> + '</td><td>' + data.timestamp + '</td></tr>';
960
-                        result = result + '<tr><td>' + <?php echo '"' . _("Calling-Station-Id") . '"'; ?> + '</td><td>' + data.mac + '</td></tr>';
961
-                        result = result + '<tr><td>' + <?php echo '"' . _("Additional description") . '"'; ?> +'</td><td>' + data.freetext + '</td></tr>';
956
+                        result = result + '<tr><td>' + <?php echo '"'._("Reason").'"'; ?> + '</td><td>' + data.reason + '</td></tr>';
957
+                        result = result + '<tr><td>' + <?php echo '"'._("SP email").'"'; ?> + '</td><td>' + data.email + '</td></tr>';
958
+                        result = result + '<tr><td>' + <?php echo '"'._("IdP email(s)").'"'; ?> + '</td><td>' + data.idpcontact + '</td></tr>';
959
+                        result = result + '<tr><td>' + <?php echo '"'._("Event's timestamp").'"'; ?> + '</td><td>' + data.timestamp + '</td></tr>';
960
+                        result = result + '<tr><td>' + <?php echo '"'._("Calling-Station-Id").'"'; ?> + '</td><td>' + data.mac + '</td></tr>';
961
+                        result = result + '<tr><td>' + <?php echo '"'._("Additional description").'"'; ?> +'</td><td>' + data.freetext + '</td></tr>';
962 962
                     }
963 963
                     if (type == 'sp_send') {
964
-                        result = result + '<h3>'+ <?php echo '"' . _("IdP contacting SP due to technical problems or abuse") . '"'; ?> + '</h3>';
964
+                        result = result + '<h3>'+ <?php echo '"'._("IdP contacting SP due to technical problems or abuse").'"'; ?> + '</h3>';
965 965
                         result = result + '<table>';
966
-                        result = result + '<tr><td>' + <?php echo '"' . _("Reason") . '"'; ?> + '</td><td>' + data.reason + '</td></tr>';
967
-                        result = result + '<tr><td>' + <?php echo '"' . _("SP's Operator-Name") . '"'; ?> + '</td><td>' + data.opname + '</td></tr>';
968
-                        result = result + '<tr><td>' + <?php echo '"' . _("User's outer ID") . '"'; ?> + '</td><td>' + data.outerid + '</td></tr>';
969
-                        result = result + '<tr><td>' + <?php echo '"' . _("IdP email") . '"'; ?> + '</td><td>' + data.email + '</td></tr>';
970
-                        result = result + '<tr><td>' + <?php echo '"' . _("Event's timestamp") . '"'; ?> + '</td><td>' + data.timestamp + '</td></tr>';
971
-                        result = result + '<tr><td>' + <?php echo '"' . _("Calling-Station-Id") . '"'; ?> + '</td><td>' + data.mac + '</td></tr>';
972
-                        result = result + '<tr><td>' + <?php echo '"' . _("Additional description") . '"'; ?> +'</td><td>' + data.freetext + '</td></tr>';
973
-                        result = result + '<tr><td>' + <?php echo '"' . _("How to contact the user") . '"'; ?> +'</td><td>' + data.cdetails + '</td></tr>';
966
+                        result = result + '<tr><td>' + <?php echo '"'._("Reason").'"'; ?> + '</td><td>' + data.reason + '</td></tr>';
967
+                        result = result + '<tr><td>' + <?php echo '"'._("SP's Operator-Name").'"'; ?> + '</td><td>' + data.opname + '</td></tr>';
968
+                        result = result + '<tr><td>' + <?php echo '"'._("User's outer ID").'"'; ?> + '</td><td>' + data.outerid + '</td></tr>';
969
+                        result = result + '<tr><td>' + <?php echo '"'._("IdP email").'"'; ?> + '</td><td>' + data.email + '</td></tr>';
970
+                        result = result + '<tr><td>' + <?php echo '"'._("Event's timestamp").'"'; ?> + '</td><td>' + data.timestamp + '</td></tr>';
971
+                        result = result + '<tr><td>' + <?php echo '"'._("Calling-Station-Id").'"'; ?> + '</td><td>' + data.mac + '</td></tr>';
972
+                        result = result + '<tr><td>' + <?php echo '"'._("Additional description").'"'; ?> +'</td><td>' + data.freetext + '</td></tr>';
973
+                        result = result + '<tr><td>' + <?php echo '"'._("How to contact the user").'"'; ?> +'</td><td>' + data.cdetails + '</td></tr>';
974 974
                     }
975 975
                     result = result + '</div>';
976 976
                     showInfo(result, title);
@@ -987,7 +987,7 @@  discard block
 block discarded – undo
987 987
         if ($('#mac').val().length > 0) {
988 988
             if ($('#mac').val().length != 17) {
989 989
                 $('#mac').addClass('error_input');
990
-                $('#mac').attr('title', <?php echo '"' . _("MAC address is incomplete") . '"'; ?>);
990
+                $('#mac').attr('title', <?php echo '"'._("MAC address is incomplete").'"'; ?>);
991 991
             } else {
992 992
                 $('#mac').removeClass('error_input'); 
993 993
                 $('#mac').attr('title', '');
@@ -996,7 +996,7 @@  discard block
 block discarded – undo
996 996
         if ($(this).attr('id') == 'email' &&  $(this).val().length > 0) {
997 997
             if (!isEmail($(this).val())) {
998 998
                 $('#email').addClass('error_input');
999
-                $('#email').attr('title', <?php echo '"' . _("Wrong format of email") . '"'; ?>);
999
+                $('#email').attr('title', <?php echo '"'._("Wrong format of email").'"'; ?>);
1000 1000
             } else {
1001 1001
                 $('#email').removeClass('error_input');
1002 1002
                 $('#email').attr('title', '');
@@ -1005,7 +1005,7 @@  discard block
 block discarded – undo
1005 1005
         if ($(this).attr('id') == 'outer_id' &&  $(this).val().length > 0) {
1006 1006
             if (!isEmail($(this).val(), true)) {
1007 1007
                 $('#outer_id').addClass('error_input');
1008
-                $('#outer_id').attr('title', <?php echo '"' . _("Wrong format of outer ID") . '"'; ?>);
1008
+                $('#outer_id').attr('title', <?php echo '"'._("Wrong format of outer ID").'"'; ?>);
1009 1009
             } else {
1010 1010
                 $('#outer_id').removeClass('error_input');
1011 1011
                 $('#outer_id').attr('title', '');
@@ -1014,7 +1014,7 @@  discard block
 block discarded – undo
1014 1014
         if ($(this).attr('id') == 'opname' && $('#opname').val().length > 0) {
1015 1015
             if (!isOperatorName($(this).val())) {
1016 1016
                 $('#opname').addClass('error_input');
1017
-                $('#opname').attr('title', <?php echo '"' . _("Wrong string given as OperatorName") . '"'; ?>);
1017
+                $('#opname').attr('title', <?php echo '"'._("Wrong string given as OperatorName").'"'; ?>);
1018 1018
                 $('#spmanually').show();
1019 1019
             } else {
1020 1020
                 $('#opname').removeClass('error_input');
Please login to merge, or discard this patch.
core/DeploymentManaged.php 1 patch
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
                 $serverCandidates[IdPlist::geoDistance($adminLocation, ['lat' => $iterator->location_lat, 'lon' => $iterator->location_lon])] = $iterator->server_id;
251 251
             }
252 252
             if ($clients > $maxSupportedClients * 0.9) {
253
-                $this->loggerInstance->debug(1, "A RADIUS server for Managed SP (" . $iterator->server_id . ") is serving at more than 90% capacity!");
253
+                $this->loggerInstance->debug(1, "A RADIUS server for Managed SP (".$iterator->server_id.") is serving at more than 90% capacity!");
254 254
             }
255 255
         }
256 256
         if (count($serverCandidates) == 0 && $federation != "DEFAULT") {
@@ -281,28 +281,28 @@  discard block
 block discarded – undo
281 281
             $ourLocation = ['lon' => $geoip['geo']['lon'], 'lat' => $geoip['geo']['lat']];
282 282
         }
283 283
         $inst = new IdP($this->institution);
284
-        $ourserver = $this->findGoodServerLocation($ourLocation, $inst->federation , []);
284
+        $ourserver = $this->findGoodServerLocation($ourLocation, $inst->federation, []);
285 285
         // now, find an unused port in the preferred server
286 286
         $foundFreePort1 = 0;
287 287
         while ($foundFreePort1 == 0) {
288 288
             $portCandidate = random_int(1200, 65535);
289
-            $check = $this->databaseHandle->exec("SELECT port_instance_1 FROM deployment WHERE radius_instance_1 = '" . $ourserver . "' AND port_instance_1 = $portCandidate");
289
+            $check = $this->databaseHandle->exec("SELECT port_instance_1 FROM deployment WHERE radius_instance_1 = '".$ourserver."' AND port_instance_1 = $portCandidate");
290 290
             if (mysqli_num_rows(/** @scrutinizer ignore-type */ $check) == 0) {
291 291
                 $foundFreePort1 = $portCandidate;
292 292
             }
293 293
         }
294
-        $ourSecondServer = $this->findGoodServerLocation($ourLocation, $inst->federation , [$ourserver]);
294
+        $ourSecondServer = $this->findGoodServerLocation($ourLocation, $inst->federation, [$ourserver]);
295 295
         $foundFreePort2 = 0;
296 296
         while ($foundFreePort2 == 0) {
297 297
             $portCandidate = random_int(1200, 65535);
298
-            $check = $this->databaseHandle->exec("SELECT port_instance_2 FROM deployment WHERE radius_instance_2 = '" . $ourSecondServer . "' AND port_instance_2 = $portCandidate");
298
+            $check = $this->databaseHandle->exec("SELECT port_instance_2 FROM deployment WHERE radius_instance_2 = '".$ourSecondServer."' AND port_instance_2 = $portCandidate");
299 299
             if (mysqli_num_rows(/** @scrutinizer ignore-type */ $check) == 0) {
300 300
                 $foundFreePort2 = $portCandidate;
301 301
             }
302 302
         }
303 303
         // and make up a shared secret that is halfways readable
304 304
         $futureSecret = $this->randomString(16, "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
305
-        $this->databaseHandle->exec("UPDATE deployment SET radius_instance_1 = '" . $ourserver . "', radius_instance_2 = '" . $ourSecondServer . "', port_instance_1 = $foundFreePort1, port_instance_2 = $foundFreePort2, secret = '$futureSecret' WHERE deployment_id = $this->identifier");
305
+        $this->databaseHandle->exec("UPDATE deployment SET radius_instance_1 = '".$ourserver."', radius_instance_2 = '".$ourSecondServer."', port_instance_1 = $foundFreePort1, port_instance_2 = $foundFreePort2, secret = '$futureSecret' WHERE deployment_id = $this->identifier");
306 306
         return ["port_instance_1" => $foundFreePort1, "port_instance_2" => $foundFreePort2, "secret" => $futureSecret, "radius_instance_1" => $ourserver, "radius_instance_2" => $ourserver];
307 307
     }
308 308
 
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
      * @return void
346 346
      */
347 347
     public function deactivate() {
348
-        $this->databaseHandle->exec("UPDATE deployment SET status = " . DeploymentManaged::INACTIVE . " WHERE deployment_id = $this->identifier");
348
+        $this->databaseHandle->exec("UPDATE deployment SET status = ".DeploymentManaged::INACTIVE." WHERE deployment_id = $this->identifier");
349 349
     }
350 350
 
351 351
     /**
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
      * @return void
356 356
      */
357 357
     public function activate() {
358
-        $this->databaseHandle->exec("UPDATE deployment SET status = " . DeploymentManaged::ACTIVE . " WHERE deployment_id = $this->identifier");
358
+        $this->databaseHandle->exec("UPDATE deployment SET status = ".DeploymentManaged::ACTIVE." WHERE deployment_id = $this->identifier");
359 359
     }
360 360
 
361 361
     /**
@@ -381,17 +381,17 @@  discard block
 block discarded – undo
381 381
     private function sendToRADIUS($idx, $post) {
382 382
             
383 383
         $hostname = "radius_hostname_$idx";
384
-        $ch = curl_init( "http://" . $this->$hostname );
384
+        $ch = curl_init("http://".$this->$hostname);
385 385
         if ($ch === FALSE) {
386 386
             $res = 'FAILURE';
387 387
         } else {
388
-            curl_setopt( $ch, CURLOPT_POST, 1);
389
-            curl_setopt( $ch, CURLOPT_POSTFIELDS, $post);
390
-            $this->loggerInstance->debug(1, "Posting to http://" . $this->$hostname . ": $post\n");
391
-            curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);
392
-            curl_setopt( $ch, CURLOPT_HEADER, 0);
393
-            curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
394
-            $exec = curl_exec( $ch );
388
+            curl_setopt($ch, CURLOPT_POST, 1);
389
+            curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
390
+            $this->loggerInstance->debug(1, "Posting to http://".$this->$hostname.": $post\n");
391
+            curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
392
+            curl_setopt($ch, CURLOPT_HEADER, 0);
393
+            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
394
+            $exec = curl_exec($ch);
395 395
             if ($exec === FALSE) {
396 396
                 $this->loggerInstance->debug(1, "curl_exec failure");
397 397
                 $res = 'FAILURE';
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
             $this->loggerInstance->debug(1, $this);           
403 403
         }
404 404
         $this->loggerInstance->debug(1, "Database update");
405
-        $this->databaseHandle->exec("UPDATE deployment SET radius_status_$idx = " . ($res == 'OK'? \core\AbstractDeployment::RADIUS_OK : \core\AbstractDeployment::RADIUS_FAILURE) . " WHERE deployment_id = $this->identifier");
405
+        $this->databaseHandle->exec("UPDATE deployment SET radius_status_$idx = ".($res == 'OK' ? \core\AbstractDeployment::RADIUS_OK : \core\AbstractDeployment::RADIUS_FAILURE)." WHERE deployment_id = $this->identifier");
406 406
         return $res;
407 407
     }
408 408
     /**
@@ -417,23 +417,23 @@  discard block
 block discarded – undo
417 417
     private function sendMailtoAdmin($remove, $response, $status) {
418 418
         $txt = '';
419 419
         if ($status == 'OK') {
420
-            $txt = $remove? _('Profile dectivation succeeded') : _('Profile activation/modification succeeded');
420
+            $txt = $remove ? _('Profile dectivation succeeded') : _('Profile activation/modification succeeded');
421 421
         } else {
422
-            $txt = $remove? _('Profile dectivation failed') : _('Profile activation/modification failed');
422
+            $txt = $remove ? _('Profile dectivation failed') : _('Profile activation/modification failed');
423 423
         }
424
-        $txt = $txt . ' ';
424
+        $txt = $txt.' ';
425 425
         if (array_count_values($response)[$status] == 2) {
426
-            $txt = $txt . _('on both RADIUS servers: primary and backup') . '.';
426
+            $txt = $txt._('on both RADIUS servers: primary and backup').'.';
427 427
         } else {
428 428
             if ($response['res[1]'] == $status) {
429
-                $txt = $txt . _('on primary RADIUS server') . '.';
429
+                $txt = $txt._('on primary RADIUS server').'.';
430 430
             } else {
431
-                $txt = $txt . _('on backup RADIUS server') . '.';
431
+                $txt = $txt._('on backup RADIUS server').'.';
432 432
             }
433 433
         }
434 434
         $mail = \core\common\OutsideComm::mailHandle();
435 435
         $email = $this->getAttributes("support:email")[0]['value'];
436
-        $mail->FromName = \config\Master::APPEARANCE['productname'] . " Notification System";
436
+        $mail->FromName = \config\Master::APPEARANCE['productname']." Notification System";
437 437
         $mail->addAddress($email);     
438 438
         if ($status == 'OK') {
439 439
             $mail->Subject = _('RADIUS profile update problem fixed');
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
         }
443 443
         $mail->Body = $txt;
444 444
         $sent = $mail->send();
445
-        if ( $sent === FALSE) {
445
+        if ($sent === FALSE) {
446 446
             $this->loggerInstance->debug(1, 'Mailing on RADIUS problem failed');
447 447
         }
448 448
     }
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
      * @param integer $idx server index 1 (primary) or 2 (backup)
453 453
      * @return integer or NULL
454 454
      */
455
-    private function checkURL ($idx) {
455
+    private function checkURL($idx) {
456 456
         $ch = curl_init();
457 457
         if ($ch === FALSE) {
458 458
             return NULL;
@@ -465,11 +465,11 @@  discard block
 block discarded – undo
465 465
             return NULL;
466 466
         }
467 467
         $timeout = 10;
468
-        curl_setopt ( $ch, CURLOPT_URL, 'http://'.$host );
469
-        curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );
470
-        curl_setopt ( $ch, CURLOPT_TIMEOUT, $timeout );
468
+        curl_setopt($ch, CURLOPT_URL, 'http://'.$host);
469
+        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
470
+        curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
471 471
         curl_exec($ch);
472
-        $http_code = curl_getinfo( $ch, CURLINFO_HTTP_CODE );
472
+        $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
473 473
         if ($http_code == 200) {
474 474
             return 1;
475 475
         }
@@ -546,37 +546,37 @@  discard block
 block discarded – undo
546 546
      * @return array index res[1] indicate primary RADIUS status, index res[2] backup RADIUS status
547 547
      */
548 548
     public function setRADIUSconfig($onlyone = 0, $notify = 0) {
549
-        $remove = ($this->status == \core\AbstractDeployment::INACTIVE)? 1 : 0;
549
+        $remove = ($this->status == \core\AbstractDeployment::INACTIVE) ? 1 : 0;
550 550
         $toPost = ($onlyone ? array($onlyone => '') : array(1 => '', 2 => ''));
551
-        $toPostTemplate = 'instid=' . $this->institution . '&deploymentid=' . $this->identifier . '&secret=' . $this->secret . '&country=' . $this->getAttributes("internal:country")[0]['value'] . '&';
551
+        $toPostTemplate = 'instid='.$this->institution.'&deploymentid='.$this->identifier.'&secret='.$this->secret.'&country='.$this->getAttributes("internal:country")[0]['value'].'&';
552 552
         if ($remove) {
553
-            $toPostTemplate = $toPostTemplate . 'remove=1&';
553
+            $toPostTemplate = $toPostTemplate.'remove=1&';
554 554
         } else {
555 555
             if ($this->getAttributes("managedsp:operatorname")[0]['value'] ?? NULL) {
556
-                $toPostTemplate = $toPostTemplate . 'operatorname=' . $this->getAttributes("managedsp:operatorname")[0]['value'] . '&';
556
+                $toPostTemplate = $toPostTemplate.'operatorname='.$this->getAttributes("managedsp:operatorname")[0]['value'].'&';
557 557
             }
558 558
             if ($this->getAttributes("managedsp:vlan")[0]['value'] ?? NULL) {
559 559
                 $allRealms = $this->getAllRealms();
560 560
                 if (!empty($allRealms)) {
561
-                    $toPostTemplate = $toPostTemplate . 'vlan=' . $this->getAttributes("managedsp:vlan")[0]['value'] . '&';
562
-                    $toPostTemplate = $toPostTemplate . 'realmforvlan[]=' . implode('&realmforvlan[]=', $allRealms) . '&';
561
+                    $toPostTemplate = $toPostTemplate.'vlan='.$this->getAttributes("managedsp:vlan")[0]['value'].'&';
562
+                    $toPostTemplate = $toPostTemplate.'realmforvlan[]='.implode('&realmforvlan[]=', $allRealms).'&';
563 563
                 }
564 564
             }
565 565
         }
566 566
         foreach (array_keys($toPost) as $key) {
567
-            $elem = 'port' . $key;
568
-            $toPost[$key] = $toPostTemplate . 'port=' . $this->$elem;     
567
+            $elem = 'port'.$key;
568
+            $toPost[$key] = $toPostTemplate.'port='.$this->$elem;     
569 569
         }
570 570
         $response = array();
571 571
         foreach ($toPost as $key => $value) {
572
-            $this->loggerInstance->debug(1, 'toPost ' . $toPost[$key] ."\n");
572
+            $this->loggerInstance->debug(1, 'toPost '.$toPost[$key]."\n");
573 573
             $response['res['.$key.']'] = $this->sendToRADIUS($key, $toPost[$key]);
574 574
         }
575 575
         if ($onlyone) {
576
-            $response['res['.($onlyone==1)? 2 : 1 . ']'] = \core\AbstractDeployment::RADIUS_OK;
576
+            $response['res['.($onlyone == 1) ? 2 : 1.']'] = \core\AbstractDeployment::RADIUS_OK;
577 577
         }
578 578
         foreach (array('OK', 'FAILURE') as $status) { 
579
-            if ( (($status == 'OK' && $notify) || ($status == 'FAILURE')) &&  in_array($status, $response) ) {
579
+            if ((($status == 'OK' && $notify) || ($status == 'FAILURE')) && in_array($status, $response)) {
580 580
                 $this->sendMailtoAdmin($remove, $response, $status);
581 581
             }
582 582
         }
Please login to merge, or discard this patch.
web/admin/edit_hotspot.php 1 patch
Spacing   +10 added lines, -10 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();
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 
37 37
 if (!isset($_GET['deployment_id'])) {
38 38
     $my_inst->newDeployment(\core\AbstractDeployment::DEPLOYMENTTYPE_MANAGED);
39
-    header("Location: overview_sp.php?inst_id=" . $my_inst->identifier);
39
+    header("Location: overview_sp.php?inst_id=".$my_inst->identifier);
40 40
     exit(0);
41 41
 }
42 42
 
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
         if (in_array('OK', $response)) {
51 51
             $deployment->deactivate();
52 52
         }
53
-        header("Location: overview_sp.php?inst_id=" . $my_inst->identifier . '&' . urldecode(http_build_query($response)));
53
+        header("Location: overview_sp.php?inst_id=".$my_inst->identifier.'&'.urldecode(http_build_query($response)));
54 54
         exit(0);
55 55
     }
56 56
 
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         if (in_array('OK', $response)) {
60 60
             $deployment->activate();
61 61
         }
62
-        header("Location: overview_sp.php?inst_id=" . $my_inst->identifier . '&' . urldecode(http_build_query($response)));
62
+        header("Location: overview_sp.php?inst_id=".$my_inst->identifier.'&'.urldecode(http_build_query($response)));
63 63
         exit(0);
64 64
     }
65 65
     
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
         if ($deployment->status == core\DeploymentManaged::ACTIVE) {
80 80
             $response = $deployment->setRADIUSconfig();
81 81
         }
82
-        header("Location: overview_sp.php?inst_id=" . $my_inst->identifier . '&' . urldecode(http_build_query($response)));
82
+        header("Location: overview_sp.php?inst_id=".$my_inst->identifier.'&'.urldecode(http_build_query($response)));
83 83
         exit(0);
84 84
     }
85 85
 }
@@ -107,12 +107,12 @@  discard block
 block discarded – undo
107 107
     echo $uiElements->instLevelInfoBoxes($my_inst);
108 108
     $deploymentOptions = $deployment->getAttributes();
109 109
     echo "<form enctype='multipart/form-data' action='edit_hotspot.php?inst_id=$my_inst->identifier&amp;deployment_id=$deployment->identifier' method='post' accept-charset='UTF-8'>
110
-                <input type='hidden' name='MAX_FILE_SIZE' value='" . \config\Master::MAX_UPLOAD_SIZE . "'>";
110
+                <input type='hidden' name='MAX_FILE_SIZE' value='".\config\Master::MAX_UPLOAD_SIZE."'>";
111 111
     $optionDisplay = new \web\lib\admin\OptionDisplay($deploymentOptions, "Profile");
112 112
     ?>
113 113
     <?php
114 114
     echo "<fieldset class='option_container' id='managedsp_override'>
115
-    <legend><strong>" . _("Options for this deployment") . "</strong></legend>";
115
+    <legend><strong>" . _("Options for this deployment")."</strong></legend>";
116 116
     ?>
117 117
     <table>
118 118
         <tr>
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
             <!-- input for VLAN identifier for home users-->
131 131
             <td>
132 132
                 <span id='vlan_label'>
133
-                    <?php echo sprintf(_("VLAN tag for own users%s:"), ($vlan === NULL ? "" : " " . _("(unset with '0')"))); ?>
133
+                    <?php echo sprintf(_("VLAN tag for own users%s:"), ($vlan === NULL ? "" : " "._("(unset with '0')"))); ?>
134 134
                 </span>
135 135
             </td>
136 136
             <td>
@@ -145,10 +145,10 @@  discard block
 block discarded – undo
145 145
     </table>
146 146
     <?php
147 147
     echo $optionDisplay->prefilledOptionTable("managedsp");
148
-    echo "<button type='button' class='newoption' onclick='getXML(\"managedsp\")'>" . _("Add new option") . "</button>";
148
+    echo "<button type='button' class='newoption' onclick='getXML(\"managedsp\")'>"._("Add new option")."</button>";
149 149
     echo "</fieldset>";
150 150
 
151 151
 
152
-    echo "<p><button type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_SAVE . "'>" . _("Save data") . "</button><button type='button' class='delete' name='abortbutton' value='abort' onclick='javascript:window.location = \"overview_sp.php?inst_id=$my_inst->identifier\"'>" . _("Discard changes") . "</button></p></form>";
152
+    echo "<p><button type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_SAVE."'>"._("Save data")."</button><button type='button' class='delete' name='abortbutton' value='abort' onclick='javascript:window.location = \"overview_sp.php?inst_id=$my_inst->identifier\"'>"._("Discard changes")."</button></p></form>";
153 153
     echo $deco->footer();
154 154
     
Please login to merge, or discard this patch.