Passed
Push — release_2_0 ( 70d6cc...7f91d2 )
by Stefan
07:10
created
devices/xml/Device_XML.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
         return $helpdesk;
295 295
     }
296 296
 
297
-   private function getCredentialApplicability() {
297
+    private function getCredentialApplicability() {
298 298
         $ssids = $this->attributes['internal:SSID'];
299 299
         $oids = $this->attributes['internal:consortia'];
300 300
         $credentialapplicability = new CredentialApplicability();
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
     }
421 421
     
422 422
     private function getAuthMethod($eap) {
423
- //       $attr = $this->attributes;
423
+    //       $attr = $this->attributes;
424 424
         $authmethod = new AuthenticationMethod();
425 425
         $eapParams = $this->getAuthenticationMethodParams($eap);
426 426
         $eaptype = new Type();
Please login to merge, or discard this patch.
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.
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/SilverbulletCertificate.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
         $invitationObject = new SilverbulletInvitation($token);
156 156
         $profile = new ProfileSilverbullet($invitationObject->profile);
157 157
         $inst = new IdP($profile->institution);
158
-        $loggerInstance->debug(5, "tokenStatus: done, got " . $invitationObject->invitationTokenStatus . ", " . $invitationObject->profile . ", " . $invitationObject->userId . ", " . $invitationObject->expiry . ", " . $invitationObject->invitationTokenString . "\n");
158
+        $loggerInstance->debug(5, "tokenStatus: done, got ".$invitationObject->invitationTokenStatus.", ".$invitationObject->profile.", ".$invitationObject->userId.", ".$invitationObject->expiry.", ".$invitationObject->invitationTokenString."\n");
159 159
         if ($invitationObject->invitationTokenStatus != SilverbulletInvitation::SB_TOKENSTATUS_VALID && $invitationObject->invitationTokenStatus != SilverbulletInvitation::SB_TOKENSTATUS_PARTIALLY_REDEEMED) {
160 160
             throw new Exception("Attempt to generate a SilverBullet installer with an invalid/redeemed/expired token. The user should never have gotten that far!");
161 161
         }
@@ -168,12 +168,12 @@  discard block
 block discarded – undo
168 168
             throw new Exception("Despite a valid token, the corresponding user was not found in database or database query error!");
169 169
         }
170 170
         $expiryObject = mysqli_fetch_object(/** @scrutinizer ignore-type */ $userrow);
171
-        $loggerInstance->debug(5, "EXP: " . $expiryObject->expiry . "\n");
171
+        $loggerInstance->debug(5, "EXP: ".$expiryObject->expiry."\n");
172 172
         $expiryDateObject = date_create_from_format("Y-m-d H:i:s", $expiryObject->expiry);
173 173
         if ($expiryDateObject === FALSE) {
174 174
             throw new Exception("The expiry date we got from the DB is bogus!");
175 175
         }
176
-        $loggerInstance->debug(5, $expiryDateObject->format("Y-m-d H:i:s") . "\n");
176
+        $loggerInstance->debug(5, $expiryDateObject->format("Y-m-d H:i:s")."\n");
177 177
         // date_create with no parameters can't fail, i.e. is never FALSE
178 178
         $validity = date_diff(/** @scrutinizer ignore-type */ date_create(), $expiryDateObject);
179 179
         $expiryDays = $validity->days + 1;
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
         $certString = "";
223 223
         openssl_x509_export($cert, $certString);
224 224
         $parsedCert = $x509->processCertificate($certString);
225
-        $loggerInstance->debug(5, "CERTINFO: " . print_r($parsedCert['full_details'], true));
225
+        $loggerInstance->debug(5, "CERTINFO: ".print_r($parsedCert['full_details'], true));
226 226
         $realExpiryDate = date_create_from_format("U", $parsedCert['full_details']['validTo_time_t'])->format("Y-m-d H:i:s");
227 227
 
228 228
         // store new cert info in DB
@@ -280,26 +280,26 @@  discard block
 block discarded – undo
280 280
                 $cat = new CAT();
281 281
                 $tempdirArray = $cat->createTemporaryDirectory("test");
282 282
                 $tempdir = $tempdirArray['dir'];
283
-                $nowIndexTxt = (new \DateTime())->format("ymdHis") . "Z";
284
-                $expiryIndexTxt = $originalExpiry->format("ymdHis") . "Z";
283
+                $nowIndexTxt = (new \DateTime())->format("ymdHis")."Z";
284
+                $expiryIndexTxt = $originalExpiry->format("ymdHis")."Z";
285 285
                 $serialHex = strtoupper(dechex($this->serial));
286 286
                 if (strlen($serialHex) % 2 == 1) {
287
-                    $serialHex = "0" . $serialHex;
287
+                    $serialHex = "0".$serialHex;
288 288
                 }
289 289
 
290
-                $indexStatement = "$certstatus\t$expiryIndexTxt\t" . ($certstatus == "R" ? "$nowIndexTxt,unspecified" : "") . "\t$serialHex\tunknown\t/O=" . CONFIG_CONFASSISTANT['CONSORTIUM']['name'] . "/OU=$federation/CN=$this->username\n";
290
+                $indexStatement = "$certstatus\t$expiryIndexTxt\t".($certstatus == "R" ? "$nowIndexTxt,unspecified" : "")."\t$serialHex\tunknown\t/O=".CONFIG_CONFASSISTANT['CONSORTIUM']['name']."/OU=$federation/CN=$this->username\n";
291 291
                 $logHandle->debug(4, "index.txt contents-to-be: $indexStatement");
292
-                if (!file_put_contents($tempdir . "/index.txt", $indexStatement)) {
292
+                if (!file_put_contents($tempdir."/index.txt", $indexStatement)) {
293 293
                     $logHandle->debug(1, "Unable to write openssl index.txt file for revocation handling!");
294 294
                 }
295 295
                 // index.txt.attr is dull but needs to exist
296
-                file_put_contents($tempdir . "/index.txt.attr", "unique_subject = yes\n");
296
+                file_put_contents($tempdir."/index.txt.attr", "unique_subject = yes\n");
297 297
                 // call "openssl ocsp" to manufacture our own OCSP statement
298 298
                 // adding "-rmd sha1" to the following command-line makes the
299 299
                 // choice of signature algorithm for the response explicit
300 300
                 // but it's only available from openssl-1.1.0 (which we do not
301 301
                 // want to require just for that one thing).
302
-                $execCmd = CONFIG['PATHS']['openssl'] . " ocsp -issuer " . ROOT . "/config/SilverbulletClientCerts/real-".$this->ca_type.".pem -sha1 -ndays 10 -no_nonce -serial 0x$serialHex -CA " . ROOT . "/config/SilverbulletClientCerts/real-".$this->ca_type.".pem -rsigner " . ROOT . "/config/SilverbulletClientCerts/real-".$this->ca_type.".pem -rkey " . ROOT . "/config/SilverbulletClientCerts/real-".$this->ca_type.".key -index $tempdir/index.txt -no_cert_verify -respout $tempdir/$serialHex.response.der";
302
+                $execCmd = CONFIG['PATHS']['openssl']." ocsp -issuer ".ROOT."/config/SilverbulletClientCerts/real-".$this->ca_type.".pem -sha1 -ndays 10 -no_nonce -serial 0x$serialHex -CA ".ROOT."/config/SilverbulletClientCerts/real-".$this->ca_type.".pem -rsigner ".ROOT."/config/SilverbulletClientCerts/real-".$this->ca_type.".pem -rkey ".ROOT."/config/SilverbulletClientCerts/real-".$this->ca_type.".key -index $tempdir/index.txt -no_cert_verify -respout $tempdir/$serialHex.response.der";
303 303
                 $logHandle->debug(2, "Calling openssl ocsp with following cmdline: $execCmd\n");
304 304
                 $output = [];
305 305
                 $return = 999;
@@ -307,11 +307,11 @@  discard block
 block discarded – undo
307 307
                 if ($return !== 0) {
308 308
                     throw new Exception("Non-zero return value from openssl ocsp!");
309 309
                 }
310
-                $ocsp = file_get_contents($tempdir . "/$serialHex.response.der");
310
+                $ocsp = file_get_contents($tempdir."/$serialHex.response.der");
311 311
                 // remove the temp dir!
312
-                unlink($tempdir . "/$serialHex.response.der");
313
-                unlink($tempdir . "/index.txt.attr");
314
-                unlink($tempdir . "/index.txt");
312
+                unlink($tempdir."/$serialHex.response.der");
313
+                unlink($tempdir."/index.txt.attr");
314
+                unlink($tempdir."/index.txt");
315 315
                 rmdir($tempdir);
316 316
                 break;
317 317
             default:
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
         $username = "";
366 366
         while ($usernameIsUnique === FALSE) {
367 367
             $usernameLocalPart = common\Entity::randomString(64 - 1 - strlen($realm), "0123456789abcdefghijklmnopqrstuvwxyz");
368
-            $username = $usernameLocalPart . "@" . $realm;
368
+            $username = $usernameLocalPart."@".$realm;
369 369
             $uniquenessQuery = $databaseHandle->exec("SELECT cn from silverbullet_certificate WHERE cn = ?", "s", $username);
370 370
             // SELECT -> resource, not boolean
371 371
             if (mysqli_num_rows(/** @scrutinizer ignore-type */ $uniquenessQuery) == 0) {
@@ -417,10 +417,10 @@  discard block
 block discarded – undo
417 417
         $databaseHandle = DBConnection::handle("INST");
418 418
         switch (CONFIG_CONFASSISTANT['SILVERBULLET']['CA']['type']) {
419 419
             case "embedded":
420
-                $rootCaPem = file_get_contents(ROOT . "/config/SilverbulletClientCerts/rootca-$certtype.pem");
421
-                $issuingCaPem = file_get_contents(ROOT . "/config/SilverbulletClientCerts/real-$certtype.pem");
420
+                $rootCaPem = file_get_contents(ROOT."/config/SilverbulletClientCerts/rootca-$certtype.pem");
421
+                $issuingCaPem = file_get_contents(ROOT."/config/SilverbulletClientCerts/real-$certtype.pem");
422 422
                 $issuingCa = openssl_x509_read($issuingCaPem);
423
-                $issuingCaKey = openssl_pkey_get_private("file://" . ROOT . "/config/SilverbulletClientCerts/real-$certtype.key");
423
+                $issuingCaKey = openssl_pkey_get_private("file://".ROOT."/config/SilverbulletClientCerts/real-$certtype.key");
424 424
                 $nonDupSerialFound = FALSE;
425 425
                 do {
426 426
                     $serial = random_int(1000000000, PHP_INT_MAX);
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
                         throw new Exception("Unknown cert type!");
443 443
                 }
444 444
                 return [
445
-                    "CERT" => openssl_csr_sign($csr, $issuingCa, $issuingCaKey, $expiryDays, ['digest_alg' => $alg, 'config' => dirname(__DIR__) . "/config/SilverbulletClientCerts/openssl-$certtype.cnf"], $serial),
445
+                    "CERT" => openssl_csr_sign($csr, $issuingCa, $issuingCaKey, $expiryDays, ['digest_alg' => $alg, 'config' => dirname(__DIR__)."/config/SilverbulletClientCerts/openssl-$certtype.cnf"], $serial),
446 446
                     "SERIAL" => $serial,
447 447
                     "ISSUER" => $issuingCaPem,
448 448
                     "ROOT" => $rootCaPem,
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.
core/SanityTests.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -48,9 +48,9 @@  discard block
 block discarded – undo
48 48
 use GeoIp2\Database\Reader;
49 49
 use \Exception;
50 50
 
51
-require_once dirname(dirname(__FILE__)) . "/config/_config.php";
52
-require_once dirname(dirname(__FILE__)) . "/core/PHPMailer/src/PHPMailer.php";
53
-require_once dirname(dirname(__FILE__)) . "/core/PHPMailer/src/SMTP.php";
51
+require_once dirname(dirname(__FILE__))."/config/_config.php";
52
+require_once dirname(dirname(__FILE__))."/core/PHPMailer/src/PHPMailer.php";
53
+require_once dirname(dirname(__FILE__))."/core/PHPMailer/src/SMTP.php";
54 54
 
55 55
 class SanityTests extends CAT {
56 56
     /* in this section set current CAT requirements */
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
         $this->test_result = [];
91 91
         $this->test_result['global'] = 0;
92 92
         // parse the schema file to find out the number of expected rows...
93
-        $schema = file(dirname(dirname(__FILE__)) . "/schema/schema.sql");
93
+        $schema = file(dirname(dirname(__FILE__))."/schema/schema.sql");
94 94
         $this->profile_option_ct = 0;
95 95
         $passedTheWindmill = FALSE;
96 96
         foreach ($schema as $schemaLine) {
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
     public function test($test) {
117 117
         $this->out[$test] = [];
118 118
         $this->name = $test;
119
-        $m_name = $test . '_test';
119
+        $m_name = $test.'_test';
120 120
         $this->test_result[$test] = 0;
121 121
         if (!method_exists($this, $m_name)) {
122 122
             $this->testReturn(\core\common\Entity::L_ERROR, "Configuration error, no test configured for <strong>$test</strong>.");
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
                 $matchArray = [];
205 205
                 preg_match('/([^ ]+) ?/', $config['PATHS'][$pathToCheck], $matchArray);
206 206
                 $exe = $matchArray[1];
207
-                $the_path = exec("which " . $config['PATHS'][$pathToCheck]);
207
+                $the_path = exec("which ".$config['PATHS'][$pathToCheck]);
208 208
                 if ($the_path == $exe) {
209 209
                     $exec_is = "EXPLICIT";
210 210
                 } else {
@@ -223,9 +223,9 @@  discard block
 block discarded – undo
223 223
      */
224 224
     private function php_test() {
225 225
         if (version_compare(phpversion(), $this->php_needversion, '>=')) {
226
-            $this->testReturn(\core\common\Entity::L_OK, "<strong>PHP</strong> is sufficiently recent. You are running " . phpversion() . ".");
226
+            $this->testReturn(\core\common\Entity::L_OK, "<strong>PHP</strong> is sufficiently recent. You are running ".phpversion().".");
227 227
         } else {
228
-            $this->testReturn(\core\common\Entity::L_ERROR, "<strong>PHP</strong> is too old. We need at least $this->php_needversion, but you only have " . phpversion() . ".");
228
+            $this->testReturn(\core\common\Entity::L_ERROR, "<strong>PHP</strong> is too old. We need at least $this->php_needversion, but you only have ".phpversion().".");
229 229
         }
230 230
     }
231 231
 
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
             $this->testReturn(\core\common\Entity::L_OK, "<strong>cat_base_url</strong> set correctly");
242 242
         } else {
243 243
             $rootFromScript = $m[1] === '' ? '/' : $m[1];
244
-            $this->testReturn(\core\common\Entity::L_ERROR, "<strong>cat_base_url</strong> is set to <strong>" . CONFIG['PATHS']['cat_base_url'] . "</strong> and should be <strong>$rootFromScript</strong>");
244
+            $this->testReturn(\core\common\Entity::L_ERROR, "<strong>cat_base_url</strong> is set to <strong>".CONFIG['PATHS']['cat_base_url']."</strong> and should be <strong>$rootFromScript</strong>");
245 245
         }
246 246
     }
247 247
 
@@ -258,9 +258,9 @@  discard block
 block discarded – undo
258 258
             $SSPconfig = \SimpleSAML_Configuration::getInstance();
259 259
             $sspVersion = explode('.', $SSPconfig->getVersion());
260 260
             if ((int) $sspVersion[0] >= $this->ssp_needversion['major'] && (int) $sspVersion[1] >= $this->ssp_needversion['minor']) {
261
-                $this->testReturn(\core\common\Entity::L_OK, "<strong>simpleSAMLphp</strong> is sufficently recent. You are running " . implode('.', $sspVersion));
261
+                $this->testReturn(\core\common\Entity::L_OK, "<strong>simpleSAMLphp</strong> is sufficently recent. You are running ".implode('.', $sspVersion));
262 262
             } else {
263
-                $this->testReturn(\core\common\Entity::L_ERROR, "<strong>simpleSAMLphp</strong> is too old. We need at least " . implode('.', $this->ssp_needversion));
263
+                $this->testReturn(\core\common\Entity::L_ERROR, "<strong>simpleSAMLphp</strong> is too old. We need at least ".implode('.', $this->ssp_needversion));
264 264
             }
265 265
         }
266 266
     }
@@ -314,8 +314,8 @@  discard block
 block discarded – undo
314 314
      * @return void
315 315
      */
316 316
     private function logdir_test() {
317
-        if (fopen(CONFIG['PATHS']['logdir'] . "/debug.log", "a") == FALSE) {
318
-            $this->testReturn(\core\common\Entity::L_WARN, "Log files in <strong>" . CONFIG['PATHS']['logdir'] . "</strong> are not writable!");
317
+        if (fopen(CONFIG['PATHS']['logdir']."/debug.log", "a") == FALSE) {
318
+            $this->testReturn(\core\common\Entity::L_WARN, "Log files in <strong>".CONFIG['PATHS']['logdir']."</strong> are not writable!");
319 319
         } else {
320 320
             $this->testReturn(\core\common\Entity::L_OK, "Log directory is writable.");
321 321
         }
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
     private function openssl_test() {
440 440
         $A = $this->getExecPath('openssl');
441 441
         if ($A['exec'] != "") {
442
-            $t = exec($A['exec'] . ' version');
442
+            $t = exec($A['exec'].' version');
443 443
             if ($A['exec_is'] == "EXPLICIT") {
444 444
                 $this->testReturn(\core\common\Entity::L_OK, "<strong>$t</strong> was found and is configured explicitly in your config.");
445 445
             } else {
@@ -466,14 +466,14 @@  discard block
 block discarded – undo
466 466
         }
467 467
         $A = $this->getExecPath('makensis');
468 468
         if ($A['exec'] != "") {
469
-            $t = exec($A['exec'] . ' -VERSION');
469
+            $t = exec($A['exec'].' -VERSION');
470 470
             if ($A['exec_is'] == "EXPLICIT") {
471 471
                 $this->testReturn(\core\common\Entity::L_OK, "<strong>makensis $t</strong> was found and is configured explicitly in your config.");
472 472
             } else {
473 473
                 $this->testReturn(\core\common\Entity::L_WARN, "<strong>makensis $t</strong> was found, but is not configured with an absolute path in your config.");
474 474
             }
475 475
             $outputArray = [];
476
-            exec($A['exec'] . ' -HELP', $outputArray);
476
+            exec($A['exec'].' -HELP', $outputArray);
477 477
             $t1 = count(preg_grep('/INPUTCHARSET/', $outputArray));
478 478
             if ($t1 == 1 && CONFIG_CONFASSISTANT['NSIS_VERSION'] == 2) {
479 479
                 $this->testReturn(\core\common\Entity::L_ERROR, "Declared NSIS_VERSION does not seem to match the file pointed to by PATHS['makensis']!");
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
         $NSIS_Module_status = [];
503 503
         foreach ($this->NSIS_Modules as $module) {
504 504
             unset($out);
505
-            exec(CONFIG_CONFASSISTANT['PATHS']['makensis'] . " -V1 '-X!include $module' '-XOutFile $exe' '-XSection X' '-XSectionEnd'", $out, $retval);
505
+            exec(CONFIG_CONFASSISTANT['PATHS']['makensis']." -V1 '-X!include $module' '-XOutFile $exe' '-XSection X' '-XSectionEnd'", $out, $retval);
506 506
             if ($retval > 0) {
507 507
                 $NSIS_Module_status[$module] = 0;
508 508
             } else {
@@ -565,8 +565,8 @@  discard block
 block discarded – undo
565 565
         $locales = shell_exec("locale -a");
566 566
         $allthere = "";
567 567
         foreach (CONFIG['LANGUAGES'] as $onelanguage) {
568
-            if (preg_match("/" . $onelanguage['locale'] . "/", $locales) == 0) {
569
-                $allthere .= $onelanguage['locale'] . " ";
568
+            if (preg_match("/".$onelanguage['locale']."/", $locales) == 0) {
569
+                $allthere .= $onelanguage['locale']." ";
570 570
             }
571 571
         }
572 572
         if ($allthere == "") {
@@ -580,47 +580,47 @@  discard block
 block discarded – undo
580 580
         ["SETTING" => CONFIG['APPEARANCE']['from-mail'],
581 581
             "DEFVALUE" => "[email protected]",
582 582
             "COMPLAINTSTRING" => "APPEARANCE/from-mail ",
583
-            "REQUIRED" => FALSE,],
583
+            "REQUIRED" => FALSE, ],
584 584
         ["SETTING" => CONFIG['APPEARANCE']['support-contact']['url'],
585 585
             "DEFVALUE" => "[email protected]?body=Only%20English%20language%20please!",
586 586
             "COMPLAINTSTRING" => "APPEARANCE/support-contact/url ",
587
-            "REQUIRED" => FALSE,],
587
+            "REQUIRED" => FALSE, ],
588 588
         ["SETTING" => CONFIG['APPEARANCE']['support-contact']['display'],
589 589
             "DEFVALUE" => "[email protected]",
590 590
             "COMPLAINTSTRING" => "APPEARANCE/support-contact/display ",
591
-            "REQUIRED" => FALSE,],
591
+            "REQUIRED" => FALSE, ],
592 592
         ["SETTING" => CONFIG['APPEARANCE']['support-contact']['developer-mail'],
593 593
             "DEFVALUE" => "[email protected]",
594 594
             "COMPLAINTSTRING" => "APPEARANCE/support-contact/mail ",
595
-            "REQUIRED" => FALSE,],
595
+            "REQUIRED" => FALSE, ],
596 596
         ["SETTING" => CONFIG['APPEARANCE']['abuse-mail'],
597 597
             "DEFVALUE" => "[email protected]",
598 598
             "COMPLAINTSTRING" => "APPEARANCE/abuse-mail ",
599
-            "REQUIRED" => FALSE,],
599
+            "REQUIRED" => FALSE, ],
600 600
         ["SETTING" => CONFIG['APPEARANCE']['MOTD'],
601 601
             "DEFVALUE" => "Release Candidate. All bugs to be shot on sight!",
602 602
             "COMPLAINTSTRING" => "APPEARANCE/MOTD ",
603
-            "REQUIRED" => FALSE,],
603
+            "REQUIRED" => FALSE, ],
604 604
         ["SETTING" => CONFIG['APPEARANCE']['webcert_CRLDP'],
605 605
             "DEFVALUE" => ['list', 'of', 'CRL', 'pointers'],
606 606
             "COMPLAINTSTRING" => "APPEARANCE/webcert_CRLDP ",
607
-            "REQUIRED" => TRUE,],
607
+            "REQUIRED" => TRUE, ],
608 608
         ["SETTING" => CONFIG['APPEARANCE']['webcert_OCSP'],
609 609
             "DEFVALUE" => ['list', 'of', 'OCSP', 'pointers'],
610 610
             "COMPLAINTSTRING" => "APPEARANCE/webcert_OCSP ",
611
-            "REQUIRED" => TRUE,],
611
+            "REQUIRED" => TRUE, ],
612 612
         ["SETTING" => CONFIG['DB']['INST']['host'],
613 613
             "DEFVALUE" => "db.host.example",
614 614
             "COMPLAINTSTRING" => "DB/INST ",
615
-            "REQUIRED" => TRUE,],
615
+            "REQUIRED" => TRUE, ],
616 616
         ["SETTING" => CONFIG['DB']['INST']['host'],
617 617
             "DEFVALUE" => "db.host.example",
618 618
             "COMPLAINTSTRING" => "DB/USER ",
619
-            "REQUIRED" => TRUE,],
619
+            "REQUIRED" => TRUE, ],
620 620
         ["SETTING" => CONFIG['DB']['EXTERNAL']['host'],
621 621
             "DEFVALUE" => "customerdb.otherhost.example",
622 622
             "COMPLAINTSTRING" => "DB/EXTERNAL ",
623
-            "REQUIRED" => FALSE,],
623
+            "REQUIRED" => FALSE, ],
624 624
     ];
625 625
 
626 626
     /**
@@ -646,11 +646,11 @@  discard block
 block discarded – undo
646 646
 
647 647
         foreach (CONFIG_DIAGNOSTICS['RADIUSTESTS']['TLS-clientcerts'] as $cadata) {
648 648
             foreach ($cadata['certificates'] as $cert_files) {
649
-                if (file_get_contents(ROOT . "/config/cli-certs/" . $cert_files['public']) === FALSE) {
650
-                    $defaultvalues .= "CERTIFICATE/" . $cert_files['public'] . " ";
649
+                if (file_get_contents(ROOT."/config/cli-certs/".$cert_files['public']) === FALSE) {
650
+                    $defaultvalues .= "CERTIFICATE/".$cert_files['public']." ";
651 651
                 }
652
-                if (file_get_contents(ROOT . "/config/cli-certs/" . $cert_files['private']) === FALSE) {
653
-                    $defaultvalues .= "CERTIFICATE/" . $cert_files['private'] . " ";
652
+                if (file_get_contents(ROOT."/config/cli-certs/".$cert_files['private']) === FALSE) {
653
+                    $defaultvalues .= "CERTIFICATE/".$cert_files['private']." ";
654 654
                 }
655 655
             }
656 656
         }
@@ -740,14 +740,14 @@  discard block
 block discarded – undo
740 740
         if ($global_no_cache) {
741 741
             foreach ($Devs as $dev => $D) {
742 742
                 if (empty($D['options']['no_cache']) || $D['options']['no_cache'] != 0) {
743
-                    $no_cache_dev .= $dev . " ";
743
+                    $no_cache_dev .= $dev." ";
744 744
                     $no_cache_dev_count++;
745 745
                 }
746 746
             }
747 747
         } else {
748 748
             foreach ($Devs as $dev => $D) {
749 749
                 if (!empty($D['options']['no_cache']) && $D['options']['no_cache'] != 0) {
750
-                    $no_cache_dev .= $dev . " ";
750
+                    $no_cache_dev .= $dev." ";
751 751
                     $no_cache_dev_count++;
752 752
                 }
753 753
             }
@@ -785,13 +785,13 @@  discard block
 block discarded – undo
785 785
         $mail->isHTML(FALSE);
786 786
         $mail->CharSet = 'UTF-8';
787 787
         $mail->From = CONFIG['APPEARANCE']['from-mail'];
788
-        $mail->FromName = CONFIG['APPEARANCE']['productname'] . " Invitation System";
788
+        $mail->FromName = CONFIG['APPEARANCE']['productname']." Invitation System";
789 789
         $mail->addAddress(CONFIG['APPEARANCE']['abuse-mail']);
790 790
         $mail->Subject = "testing CAT configuration mail";
791 791
         $mail->Body = "Testing CAT mailing\n";
792 792
         $sent = $mail->send();
793 793
         if ($sent) {
794
-            $this->testReturn(\core\common\Entity::L_OK, "mailer settings appear to be working, check " . CONFIG['APPEARANCE']['abuse-mail'] . " mailbox if the message was receiced.");
794
+            $this->testReturn(\core\common\Entity::L_OK, "mailer settings appear to be working, check ".CONFIG['APPEARANCE']['abuse-mail']." mailbox if the message was receiced.");
795 795
         } else {
796 796
             $this->testReturn(\core\common\Entity::L_ERROR, "mailer settings failed, check the Config::MAILSETTINGS");
797 797
         }
Please login to merge, or discard this patch.
core/IdP.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
      * @return array list of Profiles of this IdP
111 111
      */
112 112
     public function listProfiles(bool $activeOnly = FALSE) {
113
-        $query = "SELECT profile_id FROM profile WHERE inst_id = $this->identifier" . ($activeOnly ? " AND showtime = 1" : "");
113
+        $query = "SELECT profile_id FROM profile WHERE inst_id = $this->identifier".($activeOnly ? " AND showtime = 1" : "");
114 114
         $allProfiles = $this->databaseHandle->exec($query);
115 115
         $returnarray = [];
116 116
         // SELECT -> resource, not boolean
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
             $returnarray[] = $oneProfile;
121 121
         }
122 122
 
123
-        $this->loggerInstance->debug(4, "listProfiles: " . print_r($returnarray, true));
123
+        $this->loggerInstance->debug(4, "listProfiles: ".print_r($returnarray, true));
124 124
         return $returnarray;
125 125
     }
126 126
 
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
                 case AbstractProfile::PROFILETYPE_SILVERBULLET:
220 220
                     $theProfile = new ProfileSilverbullet($identifier, $this);
221 221
                     $theProfile->addSupportedEapMethod(new \core\common\EAP(\core\common\EAP::EAPTYPE_SILVERBULLET), 1);
222
-                    $theProfile->setRealm($this->identifier . "-" . $theProfile->identifier . "." . strtolower($this->federation) . strtolower(CONFIG_CONFASSISTANT['SILVERBULLET']['realm_suffix']));
222
+                    $theProfile->setRealm($this->identifier."-".$theProfile->identifier.".".strtolower($this->federation).strtolower(CONFIG_CONFASSISTANT['SILVERBULLET']['realm_suffix']));
223 223
                     return $theProfile;
224 224
                 default:
225 225
                     throw new Exception("This type of profile is unknown and can not be added.");
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
      */
337 337
     public function getExternalDBId() {
338 338
         if (CONFIG_CONFASSISTANT['CONSORTIUM']['name'] == "eduroam" && isset(CONFIG_CONFASSISTANT['CONSORTIUM']['deployment-voodoo']) && CONFIG_CONFASSISTANT['CONSORTIUM']['deployment-voodoo'] == "Operations Team") { // SW: APPROVED
339
-            $idQuery = $this->databaseHandle->exec("SELECT external_db_id FROM institution WHERE inst_id = $this->identifier AND external_db_syncstate = " . self::EXTERNAL_DB_SYNCSTATE_SYNCED);
339
+            $idQuery = $this->databaseHandle->exec("SELECT external_db_id FROM institution WHERE inst_id = $this->identifier AND external_db_syncstate = ".self::EXTERNAL_DB_SYNCSTATE_SYNCED);
340 340
             // SELECT -> it's a resource, not a boolean
341 341
             if (mysqli_num_rows(/** @scrutinizer ignore-type */ $idQuery) == 0) {
342 342
                 return FALSE;
Please login to merge, or discard this patch.