Passed
Push — release_2_0 ( aff697...948471 )
by Stefan
08:18
created
devices/xml/Device_XML.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
  */
32 32
 namespace devices\xml;
33 33
 use Exception;
34
-require_once dirname(__FILE__) . '/XML.inc.php';
34
+require_once dirname(__FILE__).'/XML.inc.php';
35 35
 
36 36
 /**
37 37
  * This class implements full functionality of the generic XML device
@@ -132,11 +132,11 @@  discard block
 block discarded – undo
132 132
         marshalObject($root, $eapIdp);
133 133
         $dom = dom_import_simplexml($root)->ownerDocument;
134 134
         //TODO schema validation makes sense so probably should be used
135
-        if ($dom->schemaValidate(ROOT . '/devices/xml/eap-metadata.xsd') === FALSE) {
135
+        if ($dom->schemaValidate(ROOT.'/devices/xml/eap-metadata.xsd') === FALSE) {
136 136
             throw new Exception("Schema validation failed for eap-metadata");
137 137
         }
138
-        file_put_contents($this->installerBasename . '.eap-config', $dom->saveXML());
139
-        return($this->installerBasename . '.eap-config');
138
+        file_put_contents($this->installerBasename.'.eap-config', $dom->saveXML());
139
+        return($this->installerBasename.'.eap-config');
140 140
     }
141 141
 
142 142
     private $AttributeNames = [
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
             $this->loggerInstance->debug(4, "Missing class definition for $attrName\n");
163 163
             return([]);
164 164
         }
165
-        $className = "\devices\xml\\" . $this->AttributeNames[$attrName];
165
+        $className = "\devices\xml\\".$this->AttributeNames[$attrName];
166 166
         $objs = [];
167 167
         if ($this->langScope === 'global') {
168 168
             foreach ($attributeList['langs'] as $language => $value) {
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
                 $displayname = new DisplayName();
201 201
                 if (isset($profileNameLangs)) {
202 202
                     $langOrC = isset($profileNameLangs[$language]) ? $profileNameLangs[$language] : $profileNameLangs['C'];
203
-                    $value .= ' - ' . $langOrC;
203
+                    $value .= ' - '.$langOrC;
204 204
                 }
205 205
                 $displayname->setValue($value);
206 206
                 $displayname->setAttributes(['lang' => $language]);
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
             $displayname = new DisplayName();
211 211
             $value = $attr['general:instname'][0];
212 212
             if ($attr['internal:profile_count'][0] > 1) {
213
-                $value .= ' - ' . $attr['profile:name'][0];
213
+                $value .= ' - '.$attr['profile:name'][0];
214 214
             }
215 215
             $displayname->setValue($value);
216 216
             $objs[] = $displayname;
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
         $attr = $this->attributes;
228 228
         if (isset($attr['general:logo_file'][0])) {
229 229
             $logoString = base64_encode($attr['general:logo_file'][0]);
230
-            $logoMime = 'image/' . $attr['internal:logo_file'][0]['mime'];
230
+            $logoMime = 'image/'.$attr['internal:logo_file'][0]['mime'];
231 231
             $providerlogo = new ProviderLogo();
232 232
             $providerlogo->setAttributes(['mime' => $logoMime, 'encoding' => 'base64']);
233 233
             $providerlogo->setValue($logoString);
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 
328 328
         if (isset($inner["METHOD"]) && $inner["METHOD"]) {
329 329
             $innerauthmethod = new InnerAuthenticationMethod();
330
-            $typeOfInner = "\devices\xml\\" . ($inner["EAP"] ? 'EAPMethod' : 'NonEAPAuthMethod');
330
+            $typeOfInner = "\devices\xml\\".($inner["EAP"] ? 'EAPMethod' : 'NonEAPAuthMethod');
331 331
             $eapmethod = new $typeOfInner();
332 332
             $eaptype = new Type();
333 333
             $eaptype->setValue($inner['METHOD']);
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
         return($serversidecredential);
365 365
     }
366 366
     
367
-    private function setClientSideRealm ($clientsidecredential) {
367
+    private function setClientSideRealm($clientsidecredential) {
368 368
         $attr = $this->attributes;
369 369
         $realm = \core\common\Entity::getAttributeValue($attr, 'internal:realm', 0);
370 370
         if ($realm === NULL) {
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
         return $helpdesk;
267 267
     }
268 268
 
269
-   private function getCredentialApplicability() {
269
+    private function getCredentialApplicability() {
270 270
         $setWired = isset($this->attributes['media:wired'][0]) && 
271 271
             $this->attributes['media:wired'][0] == 'on' ? 1 : 0;  
272 272
         $ssids = $this->attributes['internal:SSID'];
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
     }
394 394
     
395 395
     private function getAuthMethod($eap) {
396
- //       $attr = $this->attributes;
396
+    //       $attr = $this->attributes;
397 397
         $authmethod = new AuthenticationMethod();
398 398
         $eapParams = $this->getAuthenticationMethodParams($eap);
399 399
         $eaptype = new Type();
Please login to merge, or discard this patch.
devices/redirect_dev/Device_RedirectDev.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -22,15 +22,15 @@
 block discarded – undo
22 22
 namespace devices\redirect_dev;
23 23
 
24 24
 class Device_RedirectDev extends \core\DeviceConfig {
25
-   /**
26
-    * Constructs a Device object.
27
-    *
28
-    * @final not to be redefined
29
-    */
25
+    /**
26
+     * Constructs a Device object.
27
+     *
28
+     * @final not to be redefined
29
+     */
30 30
     final public function __construct() {
31 31
         parent::__construct();
32
-      $this->setSupportedEapMethods([\core\common\EAP::EAPTYPE_NONE]);
33
-      $this->loggerInstance->debug(4,"RedirectEx called");
32
+        $this->setSupportedEapMethods([\core\common\EAP::EAPTYPE_NONE]);
33
+        $this->loggerInstance->debug(4,"RedirectEx called");
34 34
     }
35 35
     
36 36
     /**
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
     final public function __construct() {
31 31
         parent::__construct();
32 32
       $this->setSupportedEapMethods([\core\common\EAP::EAPTYPE_NONE]);
33
-      $this->loggerInstance->debug(4,"RedirectEx called");
33
+      $this->loggerInstance->debug(4, "RedirectEx called");
34 34
     }
35 35
     
36 36
     /**
Please login to merge, or discard this patch.
devices/test_module/Device_TestModule.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -138,8 +138,8 @@
 block discarded – undo
138 138
      */
139 139
     private function zipInstaller() {
140 140
         // one can always access $this->attributes to check things
141
-        $fileName = $this->installerBasename . '.zip';
142
-        $output = system('zip -q ' . $fileName . ' *');
141
+        $fileName = $this->installerBasename.'.zip';
142
+        $output = system('zip -q '.$fileName.' *');
143 143
         if ($output === FALSE) {
144 144
             $this->loggerInstance->debug(2, "unable to zip the installer\n");
145 145
         }
Please login to merge, or discard this patch.
devices/linux/Device_Linux.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -211,7 +211,7 @@
 block discarded – undo
211 211
         }
212 212
 
213 213
         if (!empty($this->attributes['internal:realm'][0])) {
214
-           $config['user_realm'] = $this->attributes['internal:realm'][0];
214
+            $config['user_realm'] = $this->attributes['internal:realm'][0];
215 215
         }
216 216
         
217 217
         if(!empty($this->attributes['internal:hint_userinput_suffix'][0]) && $this->attributes['internal:hint_userinput_suffix'][0] == 1) {
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -54,9 +54,9 @@  discard block
 block discarded – undo
54 54
      *
55 55
      */
56 56
     public function writeInstaller() {
57
-        $installerPath = $this->installerBasename . ".py";
57
+        $installerPath = $this->installerBasename.".py";
58 58
         $this->copyFile("main.py", $installerPath);
59
-        $installer = fopen($installerPath,"a");
59
+        $installer = fopen($installerPath, "a");
60 60
         if ($installer === FALSE) {
61 61
             throw new Exception("Unable to open installer file for writing!");
62 62
         }
@@ -83,9 +83,9 @@  discard block
 block discarded – undo
83 83
         $out .= "<p>";
84 84
         if ($ssidCount > 1) {
85 85
             if ($ssidCount > 2) {
86
-                $out .= sprintf(_("In addition to <strong>%s</strong> the installer will also configure access to the following networks:"), implode(', ', CONFIG_CONFASSISTANT['CONSORTIUM']['ssid'])) . " ";
86
+                $out .= sprintf(_("In addition to <strong>%s</strong> the installer will also configure access to the following networks:"), implode(', ', CONFIG_CONFASSISTANT['CONSORTIUM']['ssid']))." ";
87 87
             } else {
88
-                $out .= sprintf(_("In addition to <strong>%s</strong> the installer will also configure access to:"), implode(', ', CONFIG_CONFASSISTANT['CONSORTIUM']['ssid'])) . " ";
88
+                $out .= sprintf(_("In addition to <strong>%s</strong> the installer will also configure access to:"), implode(', ', CONFIG_CONFASSISTANT['CONSORTIUM']['ssid']))." ";
89 89
             }
90 90
             $iterator = 0;
91 91
             foreach ($this->attributes['internal:SSID'] as $ssid => $v) {
@@ -123,8 +123,8 @@  discard block
 block discarded – undo
123 123
      * @return void
124 124
      */
125 125
     private function writeConfigLine($file, $prefix, $name, $text) {
126
-        $out = $prefix . $name . ' = "' . $text;
127
-        fwrite($file, wordwrap($out, 70, " \" \\\n    \"") . "\n");
126
+        $out = $prefix.$name.' = "'.$text;
127
+        fwrite($file, wordwrap($out, 70, " \" \\\n    \"")."\n");
128 128
     }
129 129
     
130 130
     /**
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
         'user_cert_missing' => _("personal certificate file not found"),
164 164
         ];
165 165
         foreach ($messages as $name => $value) {
166
-            $this->writeConfigLine($file, 'Messages.', $name, $value . '"');
166
+            $this->writeConfigLine($file, 'Messages.', $name, $value.'"');
167 167
         }
168 168
         \core\common\Entity::outOfThePotatoes();
169 169
     }
@@ -207,39 +207,39 @@  discard block
 block discarded – undo
207 207
         }
208 208
 
209 209
         if ($outerId !== NULL) {
210
-            $configRaw['anonymous_identity'] = '"' . $outerId . '"';
210
+            $configRaw['anonymous_identity'] = '"'.$outerId.'"';
211 211
         }
212 212
 
213 213
         if (!empty($this->attributes['internal:realm'][0])) {
214 214
            $config['user_realm'] = $this->attributes['internal:realm'][0];
215 215
         }
216 216
         
217
-        if(!empty($this->attributes['internal:hint_userinput_suffix'][0]) && $this->attributes['internal:hint_userinput_suffix'][0] == 1) {
217
+        if (!empty($this->attributes['internal:hint_userinput_suffix'][0]) && $this->attributes['internal:hint_userinput_suffix'][0] == 1) {
218 218
             $configRaw['hint_user_input'] = "True";
219 219
         }
220 220
         
221
-        if(!empty($this->attributes['internal:verify_userinput_suffix'][0]) && $this->attributes['internal:verify_userinput_suffix'][0] == 1) {
221
+        if (!empty($this->attributes['internal:verify_userinput_suffix'][0]) && $this->attributes['internal:verify_userinput_suffix'][0] == 1) {
222 222
             $configRaw['verify_user_realm_input'] = "True";
223 223
         }
224 224
         
225 225
         foreach ($config as $name => $value) {
226
-            $this->writeConfigLine($file, 'Config.', $name, $value . '"');
226
+            $this->writeConfigLine($file, 'Config.', $name, $value.'"');
227 227
         }
228 228
         
229 229
         foreach ($configRaw as $name => $value) {
230
-            fwrite($file, 'Config.' . $name . ' = ' . $value . "\n");
230
+            fwrite($file, 'Config.'.$name.' = '.$value."\n");
231 231
         }
232 232
         
233 233
         if ($tou === '') {
234
-            fwrite($file, 'Config.tou = ""' . "\n");
234
+            fwrite($file, 'Config.tou = ""'."\n");
235 235
         } else {
236
-            fwrite($file, 'Config.tou = """' . $tou . '"""' . "\n");
236
+            fwrite($file, 'Config.tou = """'.$tou.'"""'."\n");
237 237
         }
238 238
         
239
-        fwrite($file, 'Config.CA = """' . $this->mkCAfile() . '"""' . "\n");
239
+        fwrite($file, 'Config.CA = """'.$this->mkCAfile().'"""'."\n");
240 240
         $sbUserFile = $this->mkSbUserFile();
241 241
         if ($sbUserFile !== '') {
242
-            fwrite($file, 'Config.sb_user_file = """' . $sbUserFile . '"""' . "\n");
242
+            fwrite($file, 'Config.sb_user_file = """'.$sbUserFile.'"""'."\n");
243 243
         }
244 244
     }
245 245
 
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
             }
292 292
             $out .= "'DNS:$oneServer'";
293 293
         }
294
-        return "[" . $out. "]";
294
+        return "[".$out."]";
295 295
     }
296 296
 
297 297
     /**
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
         foreach ($ssids as $ssid => $cipher) {
306 306
             $outArray[] = "'$ssid'";
307 307
         }
308
-        return '[' . implode(', ', $outArray) . ']';
308
+        return '['.implode(', ', $outArray).']';
309 309
     }
310 310
     
311 311
     /**
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
                 $outArray[] = "'$ssid'";
322 322
             }
323 323
         }
324
-        return '[' . implode(', ', $outArray) . ']';
324
+        return '['.implode(', ', $outArray).']';
325 325
     }
326 326
     
327 327
     /**
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
      * 
330 330
      * @return string
331 331
      */
332
-    private function mkCAfile(){
332
+    private function mkCAfile() {
333 333
         $out = '';
334 334
         $cAlist = $this->attributes['internal:CAs'][0];
335 335
         foreach ($cAlist as $oneCa) {
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
      */
346 346
     private function mkIntro() {
347 347
         \core\common\Entity::intoThePotatoes();
348
-        $out = _("This installer has been prepared for {0}") . '\n\n' . _("More information and comments:") . '\n\nEMAIL: {1}\nWWW: {2}\n\n' .
348
+        $out = _("This installer has been prepared for {0}").'\n\n'._("More information and comments:").'\n\nEMAIL: {1}\nWWW: {2}\n\n'.
349 349
             _("Installer created with software from the GEANT project.");
350 350
         \core\common\Entity::outOfThePotatoes();
351 351
         return $out;
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -201,8 +201,7 @@
 block discarded – undo
201 201
             
202 202
         if ($this->selectedEap == \core\common\EAP::EAPTYPE_TLS && isset($this->attributes['eap-specific:tls_use_other_id']) && $this->attributes['eap-specific:tls_use_other_id'][0] == 'on') {
203 203
             $configRaw['use_other_tls_id'] = "True";
204
-        }
205
-        else {
204
+        } else {
206 205
             $configRaw['use_other_tls_id'] = "False";
207 206
         }
208 207
 
Please login to merge, or discard this patch.
web/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
  * @author Stefan Winter <[email protected]>
26 26
  * @package Core
27 27
  */
28
-require_once dirname(dirname(__FILE__)) . "/config/_config.php";
28
+require_once dirname(dirname(__FILE__))."/config/_config.php";
29 29
 
30 30
 $Gui = new \web\lib\user\Gui();
31 31
 // ... unless overwritten by direct GET/POST parameter in the request or a SESSION setting
Please login to merge, or discard this patch.
core/UserManagement.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
                 } else {
147 147
                     $this->databaseHandle->exec("INSERT INTO ownership (user_id, institution_id, blesslevel, orig_mail) VALUES(?, ?, ?, ?)", "siss", $owner, $catId, $level, $destMail);
148 148
                 }
149
-                $this->loggerInstance->writeAudit((string) $owner, "OWN", "IdP " . $invitationDetails->cat_institution_id . " - added user as owner");
149
+                $this->loggerInstance->writeAudit((string) $owner, "OWN", "IdP ".$invitationDetails->cat_institution_id." - added user as owner");
150 150
                 common\Entity::outOfThePotatoes();
151 151
                 return new IdP($invitationDetails->cat_institution_id);
152 152
             }
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
                 $idp = new IdP($fed->newIdP($owner, $invitationDetails->invite_issuer_level, $invitationDetails->invite_dest_mail, $bestnameguess));
169 169
             }
170 170
             $idp->addAttribute("general:instname", 'C', $bestnameguess);
171
-            $this->loggerInstance->writeAudit($owner, "NEW", "IdP " . $idp->identifier . " - created from invitation");
171
+            $this->loggerInstance->writeAudit($owner, "NEW", "IdP ".$idp->identifier." - created from invitation");
172 172
 
173 173
             // in case we have more admins in the queue which were invited to 
174 174
             // administer the same inst but haven't redeemed their invitations 
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
                              WHERE invite_created >= TIMESTAMPADD(DAY, -1, NOW()) AND used = 0 AND name = ? AND country = ? AND ( cat_institution_id IS NULL OR external_db_uniquehandle IS NULL ) ", "ss", $invitationDetails->name, $invitationDetails->country);
183 183
             // SELECT -> resource, no boolean
184 184
             while ($pendingDetail = mysqli_fetch_object(/** @scrutinizer ignore-type */ $otherPending)) {
185
-                $this->databaseHandle->exec("UPDATE invitations SET cat_institution_id = " . $idp->identifier . " WHERE id = " . $pendingDetail->id);
185
+                $this->databaseHandle->exec("UPDATE invitations SET cat_institution_id = ".$idp->identifier." WHERE id = ".$pendingDetail->id);
186 186
             }
187 187
             common\Entity::outOfThePotatoes();
188 188
             return $idp;
@@ -276,9 +276,9 @@  discard block
 block discarded – undo
276 276
         $retval = [];
277 277
         $invitations = $this->databaseHandle->exec("SELECT cat_institution_id, country, name, invite_issuer_level, invite_dest_mail, invite_token , TIMESTAMPADD(DAY, 1, invite_created) as expiry
278 278
                                         FROM invitations 
279
-                                        WHERE cat_institution_id " . ( $idpIdentifier != 0 ? "= $idpIdentifier" : "IS NULL") . " AND invite_created >= TIMESTAMPADD(DAY, -1, NOW()) AND used = 0");
279
+                                        WHERE cat_institution_id " . ($idpIdentifier != 0 ? "= $idpIdentifier" : "IS NULL")." AND invite_created >= TIMESTAMPADD(DAY, -1, NOW()) AND used = 0");
280 280
         // SELECT -> resource, not boolean
281
-        $this->loggerInstance->debug(4, "Retrieving pending invitations for " . ($idpIdentifier != 0 ? "IdP $idpIdentifier" : "IdPs awaiting initial creation" ) . ".\n");
281
+        $this->loggerInstance->debug(4, "Retrieving pending invitations for ".($idpIdentifier != 0 ? "IdP $idpIdentifier" : "IdPs awaiting initial creation").".\n");
282 282
         while ($invitationQuery = mysqli_fetch_object(/** @scrutinizer ignore-type */ $invitations)) {
283 283
             $retval[] = ["country" => $invitationQuery->country, "name" => $invitationQuery->name, "mail" => $invitationQuery->invite_dest_mail, "token" => $invitationQuery->invite_token, "expiry" => $invitationQuery->expiry];
284 284
         }
Please login to merge, or discard this patch.
web/user/sb_download.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
  * @author Stefan Winter <[email protected]>
28 28
  * @package UserGUI
29 29
  */
30
-require dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
30
+require dirname(dirname(dirname(__FILE__)))."/config/_config.php";
31 31
 $API = new \core\UserAPI();
32 32
 $loggerInstance = new \core\common\Logging();
33 33
 $validator = new \web\lib\common\InputValidation();
@@ -76,5 +76,5 @@  discard block
 block discarded – undo
76 76
     if ($accountPageUrl === FALSE) {
77 77
         throw new Exception("Unable to find our accountstatus.php page.");
78 78
     }
79
-    header("Location: ../accountstatus/accountstatus.php?token=" . $cleanToken . "&errorcode=GENERATOR_CONSUMED");
79
+    header("Location: ../accountstatus/accountstatus.php?token=".$cleanToken."&errorcode=GENERATOR_CONSUMED");
80 80
 }
81 81
\ No newline at end of file
Please login to merge, or discard this patch.
web/admin/overview_idp.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
  */
27 27
 ?>
28 28
 <?php
29
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
30
-require_once dirname(dirname(dirname(__FILE__))) . "/core/phpqrcode.php";
29
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
30
+require_once dirname(dirname(dirname(__FILE__)))."/core/phpqrcode.php";
31 31
 
32 32
 
33 33
 $deco = new \web\lib\admin\PageDecoration();
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 } else {
41 41
     $link = 'http://';
42 42
 }
43
-$link .= $_SERVER['SERVER_NAME'] . $_SERVER['SCRIPT_NAME'];
43
+$link .= $_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME'];
44 44
 $link = htmlspecialchars($link);
45 45
 
46 46
 const QRCODE_PIXELS_PER_SYMBOL = 12;
@@ -76,15 +76,15 @@  discard block
 block discarded – undo
76 76
         <div class='infobox' style='text-align:center;'>
77 77
             <h2><?php echo sprintf(_("%s download area QR code"), $uiElements->nomenclatureInst); ?></h2>
78 78
             <?php
79
-            $idpLevelUrl = ( isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on" ? 'https://' : 'http://') . $_SERVER['SERVER_NAME'] . dirname(dirname($_SERVER['SCRIPT_NAME'])) . "?idp=" . $my_inst->identifier;
79
+            $idpLevelUrl = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on" ? 'https://' : 'http://').$_SERVER['SERVER_NAME'].dirname(dirname($_SERVER['SCRIPT_NAME']))."?idp=".$my_inst->identifier;
80 80
             // never NULL, because $filename is FALSE; but make Scrutinizer happy
81 81
             $rawQr = QRcode::png($idpLevelUrl, FALSE, QR_ECLEVEL_Q, QRCODE_PIXELS_PER_SYMBOL);
82 82
             if ($rawQr === NULL) {
83 83
                 throw new Exception("Something went seriously wrong during QR code generation!");
84 84
             }
85
-            $uri = "data:image/png;base64," . base64_encode($uiElements->pngInjectConsortiumLogo($rawQr, QRCODE_PIXELS_PER_SYMBOL));
85
+            $uri = "data:image/png;base64,".base64_encode($uiElements->pngInjectConsortiumLogo($rawQr, QRCODE_PIXELS_PER_SYMBOL));
86 86
             $size = getimagesize($uri);
87
-            echo "<img width='" . ($size[0] / 4) . "' height='" . ($size[1] / 4) . "' src='$uri' alt='QR-code'/>";
87
+            echo "<img width='".($size[0] / 4)."' height='".($size[1] / 4)."' src='$uri' alt='QR-code'/>";
88 88
             ?>
89 89
             <br>
90 90
             <?php echo "<a href='$idpLevelUrl'>$idpLevelUrl</a>"; ?>
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
                 </td>
114 114
                 <td>
115 115
                     <form action='edit_idp_result.php?inst_id=<?php echo $my_inst->identifier; ?>' method='post' accept-charset='UTF-8'>
116
-                        <button class='delete' type='submit' name='submitbutton' value='<?php echo web\lib\common\FormElements::BUTTON_DELETE; ?>' onclick="return confirm('<?php echo ( CONFIG_CONFASSISTANT['CONSORTIUM']['selfservice_registration'] === NULL ? sprintf(_("After deleting the %s, you can not recreate it yourself - you need a new invitation token from the %s administrator!"), $uiElements->nomenclatureInst, $uiElements->nomenclatureFed) . " " : "" ) . sprintf(_("Do you really want to delete your %s %s?"), $uiElements->nomenclatureInst, $my_inst->name); ?>')"><?php echo sprintf(_("Delete %s"), $uiElements->nomenclatureInst); ?></button>
116
+                        <button class='delete' type='submit' name='submitbutton' value='<?php echo web\lib\common\FormElements::BUTTON_DELETE; ?>' onclick="return confirm('<?php echo (CONFIG_CONFASSISTANT['CONSORTIUM']['selfservice_registration'] === NULL ? sprintf(_("After deleting the %s, you can not recreate it yourself - you need a new invitation token from the %s administrator!"), $uiElements->nomenclatureInst, $uiElements->nomenclatureFed)." " : "").sprintf(_("Do you really want to delete your %s %s?"), $uiElements->nomenclatureInst, $my_inst->name); ?>')"><?php echo sprintf(_("Delete %s"), $uiElements->nomenclatureInst); ?></button>
117 117
                     </form>
118 118
 
119 119
                 </td>
@@ -134,21 +134,21 @@  discard block
 block discarded – undo
134 134
         <?php
135 135
         if (CONFIG['FUNCTIONALITY_LOCATIONS']['DIAGNOSTICS'] !== NULL) {
136 136
             echo "<tr>
137
-                        <td>" . _("Check another realm's reachability") . "</td>
137
+                        <td>" . _("Check another realm's reachability")."</td>
138 138
                         <td><form method='post' action='../diag/action_realmcheck.php?inst_id=$my_inst->identifier' accept-charset='UTF-8'>
139 139
                               <input type='text' name='realm' id='realm'>
140 140
                               <input type='hidden' name='comefrom' id='comefrom' value='$link'/>
141
-                              <button type='submit'>" . _("Go!") . "</button>
141
+                              <button type='submit'>"._("Go!")."</button>
142 142
                             </form>
143 143
                         </td>
144 144
                     </tr>";
145 145
         }
146 146
         if (CONFIG_CONFASSISTANT['CONSORTIUM']['name'] == "eduroam") { // SW: APPROVED
147 147
             echo "<tr>
148
-                        <td>" . sprintf(_("Check %s server status"), $uiElements->nomenclatureFed) . "</td>
148
+                        <td>" . sprintf(_("Check %s server status"), $uiElements->nomenclatureFed)."</td>
149 149
                         <td>
150 150
                            <form action='https://monitor.eduroam.org/mon_direct.php' accept-charset='UTF-8'>
151
-                              <button type='submit'>" . _("Go!") . "</button>
151
+                              <button type='submit'>" . _("Go!")."</button>
152 152
                            </form>
153 153
                         </td>
154 154
                     </tr>";
@@ -159,10 +159,10 @@  discard block
 block discarded – undo
159 159
     <?php
160 160
     $profiles_for_this_idp = $my_inst->listProfiles();
161 161
     if (count($profiles_for_this_idp) == 0) { // no profiles yet.
162
-        echo "<h2>" . sprintf(_("There are not yet any profiles for your %s."), $uiElements->nomenclatureInst) . "</h2>";
162
+        echo "<h2>".sprintf(_("There are not yet any profiles for your %s."), $uiElements->nomenclatureInst)."</h2>";
163 163
     }
164 164
     if (count($profiles_for_this_idp) > 0) { // no profiles yet.
165
-        echo "<h2>" . sprintf(_("Profiles for this %s"), $uiElements->nomenclatureInst) . "</h2>";
165
+        echo "<h2>".sprintf(_("Profiles for this %s"), $uiElements->nomenclatureInst)."</h2>";
166 166
     }
167 167
 // if there is one profile and it is of type Silver Bullet, display a very
168 168
 // simple widget with just a "Manage" button
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
                             echo _("Information needed!");
189 189
                             echo "<ul style='margin:1px'>";
190 190
                             foreach ($completeness as $missing_attrib) {
191
-                                echo "<li>" . $uiElements->displayName($missing_attrib) . "</li>";
191
+                                echo "<li>".$uiElements->displayName($missing_attrib)."</li>";
192 192
                             }
193 193
                             echo "</ul>";
194 194
                             echo "</div>";
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
                         if ($readonly === FALSE) {
203 203
                             ?>
204 204
                             <form action='edit_silverbullet.php?inst_id=<?php echo $my_inst->identifier; ?>&amp;profile_id=<?php echo $profile_list->identifier; ?>' method='POST'>
205
-                                <button <?php echo ( is_array($completeness) ? "disabled" : "" ); ?> type='submit' name='sb_action' value='sb_edit'><?php echo _("Manage User Base"); ?></button>
205
+                                <button <?php echo (is_array($completeness) ? "disabled" : ""); ?> type='submit' name='sb_action' value='sb_edit'><?php echo _("Manage User Base"); ?></button>
206 206
                             </form>
207 207
                             <?php
208 208
                         }
@@ -234,21 +234,21 @@  discard block
 block discarded – undo
234 234
                         $has_overrides = TRUE;
235 235
                     }
236 236
                 }
237
-                $buffer_eaptypediv = "<div style='margin-bottom:40px; float:left;'>" . _("<strong>EAP Types</strong> (in order of preference):") . "<br/>";
237
+                $buffer_eaptypediv = "<div style='margin-bottom:40px; float:left;'>"._("<strong>EAP Types</strong> (in order of preference):")."<br/>";
238 238
                 $typelist = $profile_list->getEapMethodsinOrderOfPreference();
239 239
                 $allcomplete = TRUE;
240 240
                 foreach ($typelist as $eaptype) {
241 241
                     $buffer_eaptypediv .= $eaptype->getPrintableRep();
242 242
                     $completeness = $profile_list->isEapTypeDefinitionComplete($eaptype);
243 243
                     if ($completeness === true) {
244
-                        $buffer_eaptypediv .= " <div class='acceptable'>" . _("OK") . "</div>";
244
+                        $buffer_eaptypediv .= " <div class='acceptable'>"._("OK")."</div>";
245 245
                     } else {
246 246
                         $buffer_eaptypediv .= " <div class='notacceptable'>";
247 247
                         $buffer_eaptypediv .= _("Information needed!");
248 248
                         if (is_array($completeness)) {
249 249
                             $buffer_eaptypediv .= "<ul style='margin:1px'>";
250 250
                             foreach ($completeness as $missing_attrib) {
251
-                                $buffer_eaptypediv .= "<li>" . $uiElements->displayName($missing_attrib) . "</li>";
251
+                                $buffer_eaptypediv .= "<li>".$uiElements->displayName($missing_attrib)."</li>";
252 252
                             }
253 253
                             $buffer_eaptypediv .= "</ul>";
254 254
                         }
@@ -260,12 +260,12 @@  discard block
 block discarded – undo
260 260
                     foreach ($attribs as $attrib) {
261 261
                         if ($attrib['level'] == "Method" && !preg_match("/^internal:/", $attrib['name']) && !$justOnce) {
262 262
                             $justOnce = TRUE;
263
-                            $buffer_eaptypediv .= "<img src='../resources/images/icons/Letter-E-blue-icon.png' alt='" . _("Options on EAP Method/Device level are in effect.") . "'>";
263
+                            $buffer_eaptypediv .= "<img src='../resources/images/icons/Letter-E-blue-icon.png' alt='"._("Options on EAP Method/Device level are in effect.")."'>";
264 264
                         }
265 265
                     }
266 266
                     $buffer_eaptypediv .= "<br/>";
267 267
                 }
268
-                $buffer_headline = "<div style='padding-bottom:20px;'><h2 style='overflow:auto; display:inline; padding-bottom: 10px;'>" . sprintf(_("Profile: %s"), $profile_name) . "</h2>";
268
+                $buffer_headline = "<div style='padding-bottom:20px;'><h2 style='overflow:auto; display:inline; padding-bottom: 10px;'>".sprintf(_("Profile: %s"), $profile_name)."</h2>";
269 269
 
270 270
                 $buffer_headline .= "<span style='float:right;'>";
271 271
                 $readiness = $profile_list->readinessLevel();
@@ -297,18 +297,18 @@  discard block
 block discarded – undo
297 297
                     if (CONFIG['FUNCTIONALITY_LOCATIONS']['DIAGNOSTICS'] == "LOCAL") {
298 298
                         $diagUrl = "../diag/";
299 299
                     } else {
300
-                        $diagUrl = CONFIG['FUNCTIONALITY_LOCATIONS']['DIAGNOSTICS'] . "/diag/";
300
+                        $diagUrl = CONFIG['FUNCTIONALITY_LOCATIONS']['DIAGNOSTICS']."/diag/";
301 301
                     }
302
-                    echo "<form action='" . $diagUrl . "action_realmcheck.php?inst_id=$my_inst->identifier&amp;profile_id=$profile_list->identifier' method='post' accept-charset='UTF-8'>
302
+                    echo "<form action='".$diagUrl."action_realmcheck.php?inst_id=$my_inst->identifier&amp;profile_id=$profile_list->identifier' method='post' accept-charset='UTF-8'>
303 303
                               <input type='hidden' name='comefrom' id='comefrom-$profilecount' value='$link'/>
304
-                              <button type='submit' name='profile_action' value='check' " . ($has_realm ? "" : "disabled='disabled' title='" . _("The realm can only be checked if you configure the realm!") . "'") . ">
305
-                                  " . _("Check realm reachability") . "
304
+                              <button type='submit' name='profile_action' value='check' ".($has_realm ? "" : "disabled='disabled' title='"._("The realm can only be checked if you configure the realm!")."'").">
305
+                                  " . _("Check realm reachability")."
306 306
                               </button>
307 307
                           </form>";
308 308
                 }
309 309
                 echo "<form action='overview_installers.php?inst_id=$my_inst->identifier&amp;profile_id=$profile_list->identifier' method='post' accept-charset='UTF-8'>
310
-                              <button type='submit' name='profile_action' value='check' " . ($has_eaptypes ? "" : "disabled='disabled'  title='" . _("You have not fully configured any supported EAP types!") . "'") . ">
311
-                                  " . _("Installer Fine-Tuning and Download") . "
310
+                              <button type='submit' name='profile_action' value='check' ".($has_eaptypes ? "" : "disabled='disabled'  title='"._("You have not fully configured any supported EAP types!")."'").">
311
+                                  " . _("Installer Fine-Tuning and Download")."
312 312
                               </button>
313 313
                  </form>
314 314
                    </div>";
@@ -317,11 +317,11 @@  discard block
 block discarded – undo
317 317
                     echo "        <div class='buttongroupprofilebox' style='clear:both;'>
318 318
                           <form action='edit_profile.php?inst_id=$my_inst->identifier&amp;profile_id=$profile_list->identifier' method='post' accept-charset='UTF-8'>
319 319
                                <hr/>
320
-                               <button type='submit' name='profile_action' value='edit'>" . _("Edit") . "</button>
320
+                               <button type='submit' name='profile_action' value='edit'>"._("Edit")."</button>
321 321
                           </form>
322 322
                           <form action='edit_profile_result.php?inst_id=$my_inst->identifier&amp;profile_id=$profile_list->identifier' method='post' accept-charset='UTF-8'>
323
-                               <button class='delete' type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_DELETE . "' onclick=\"return confirm('" . sprintf(_("Do you really want to delete the profile %s?"), $profile_name) . "')\">
324
-                                   " . _("Delete") . "
323
+                               <button class='delete' type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_DELETE."' onclick=\"return confirm('".sprintf(_("Do you really want to delete the profile %s?"), $profile_name)."')\">
324
+                                   " . _("Delete")."
325 325
                                </button>
326 326
                            </form>
327 327
                       </div>";
@@ -330,24 +330,24 @@  discard block
 block discarded – undo
330 330
 // dummy width to keep a little distance
331 331
                 echo "<div style='width:20px;'></div>";
332 332
                 if ($readiness == core\AbstractProfile::READINESS_LEVEL_SHOWTIME) {
333
-                    echo "<div style='display: table-cell; text-align:center;'><p><strong>" . _("User Download Link") . "</strong></p>";
334
-                    $displayurl = $idpLevelUrl . "&amp;profile=" . $profile_list->identifier;
335
-                    $QRurl = $idpLevelUrl . "&profile=" . $profile_list->identifier;
333
+                    echo "<div style='display: table-cell; text-align:center;'><p><strong>"._("User Download Link")."</strong></p>";
334
+                    $displayurl = $idpLevelUrl."&amp;profile=".$profile_list->identifier;
335
+                    $QRurl = $idpLevelUrl."&profile=".$profile_list->identifier;
336 336
                     echo "<a href='$displayurl' style='white-space: nowrap; text-align: center;'>";
337 337
                     $rawQr = QRcode::png($QRurl, FALSE, QR_ECLEVEL_Q, QRCODE_PIXELS_PER_SYMBOL);
338 338
                     if ($rawQr === NULL) {
339 339
                         throw new Exception("Something went seriously wrong during QR code generation!");
340 340
                     }
341
-                    $uri = "data:image/png;base64," . base64_encode($uiElements->pngInjectConsortiumLogo($rawQr, QRCODE_PIXELS_PER_SYMBOL));
341
+                    $uri = "data:image/png;base64,".base64_encode($uiElements->pngInjectConsortiumLogo($rawQr, QRCODE_PIXELS_PER_SYMBOL));
342 342
                     $size = getimagesize($uri);
343
-                    echo "<img width='" . ($size[0] / 4) . "' height='" . ($size[1] / 4) . "' src='$uri' alt='QR-code'/>";
343
+                    echo "<img width='".($size[0] / 4)."' height='".($size[1] / 4)."' src='$uri' alt='QR-code'/>";
344 344
 
345 345
                     //echo "<nobr>$displayurl</nobr></a>";
346 346
                     echo "<p>$displayurl</p></a>";
347 347
                     echo "</div>";
348 348
                     // dummy width to keep a little distance
349 349
                     echo "<div style='width:20px;'></div>";
350
-                    echo "<div style='display: table-cell; min-width:200px;'><p><strong>" . _("User Downloads") . "</strong></p><table>";
350
+                    echo "<div style='display: table-cell; min-width:200px;'><p><strong>"._("User Downloads")."</strong></p><table>";
351 351
                     $stats = $profile_list->getUserDownloadStats();
352 352
                     foreach ($stats as $dev => $count) {
353 353
                         echo "<tr><td><strong>$dev</strong></td><td>$count</td></tr>";
Please login to merge, or discard this patch.
web/admin/sanity_tests.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  *          <base_url>/copyright.php after deploying the software
20 20
  */
21 21
 
22
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
22
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
23 23
 
24 24
 $Tests = [
25 25
     'cat_base_url',
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     'mailer',
38 38
 ];
39 39
 
40
-if (CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_SILVERBULLET'] == "LOCAL" || CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_RADIUS'] == "LOCAL" ) {
40
+if (CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_SILVERBULLET'] == "LOCAL" || CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_RADIUS'] == "LOCAL") {
41 41
     $Tests[] = 'makensis';
42 42
     $Tests[] = 'makensis=>NSISmodules';
43 43
 }
@@ -71,10 +71,10 @@  discard block
 block discarded – undo
71 71
             $message = "Your configuration appears to be fine.";
72 72
             break;
73 73
         default:
74
-            throw new Exception("The result code level " . $test->test_result['global'] . " is not defined!");
74
+            throw new Exception("The result code level ".$test->test_result['global']." is not defined!");
75 75
     }
76 76
     $uiElements = new web\lib\admin\UIElements();
77
-    $out .= $uiElements->boxFlexible($test->test_result['global'], "<br><strong>Test Summary</strong><br>" . $message . "<br>See below for details<br><hr>");
77
+    $out .= $uiElements->boxFlexible($test->test_result['global'], "<br><strong>Test Summary</strong><br>".$message."<br>See below for details<br><hr>");
78 78
     foreach ($test->out as $testValue) {
79 79
         foreach ($testValue as $o) {
80 80
             $out .= $uiElements->boxFlexible($o['level'], $o['message']);
Please login to merge, or discard this patch.