Passed
Push — release_2_0 ( b112ba...f79cc0 )
by Stefan
10:50
created
core/IdP.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
      */
115 115
     public function listProfiles(bool $activeOnly = FALSE)
116 116
     {
117
-        $query = "SELECT profile_id FROM profile WHERE inst_id = $this->identifier" . ($activeOnly ? " AND showtime = 1" : "");
117
+        $query = "SELECT profile_id FROM profile WHERE inst_id = $this->identifier".($activeOnly ? " AND showtime = 1" : "");
118 118
         $allProfiles = $this->databaseHandle->exec($query);
119 119
         $returnarray = [];
120 120
         // SELECT -> resource, not boolean
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
             $returnarray[] = $oneProfile;
125 125
         }
126 126
 
127
-        $this->loggerInstance->debug(4, "listProfiles: " . print_r($returnarray, true));
127
+        $this->loggerInstance->debug(4, "listProfiles: ".print_r($returnarray, true));
128 128
         return $returnarray;
129 129
     }
130 130
 
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
                 case AbstractProfile::PROFILETYPE_SILVERBULLET:
230 230
                     $theProfile = new ProfileSilverbullet($identifier, $this);
231 231
                     $theProfile->addSupportedEapMethod(new \core\common\EAP(\core\common\EAP::EAPTYPE_SILVERBULLET), 1);
232
-                    $theProfile->setRealm($this->identifier . "-" . $theProfile->identifier . "." . strtolower($this->federation) . strtolower(CONFIG_CONFASSISTANT['SILVERBULLET']['realm_suffix']));
232
+                    $theProfile->setRealm($this->identifier."-".$theProfile->identifier.".".strtolower($this->federation).strtolower(CONFIG_CONFASSISTANT['SILVERBULLET']['realm_suffix']));
233 233
                     return $theProfile;
234 234
                 default:
235 235
                     throw new Exception("This type of profile is unknown and can not be added.");
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
     public function getExternalDBId()
351 351
     {
352 352
         if (CONFIG_CONFASSISTANT['CONSORTIUM']['name'] == "eduroam" && isset(CONFIG_CONFASSISTANT['CONSORTIUM']['deployment-voodoo']) && CONFIG_CONFASSISTANT['CONSORTIUM']['deployment-voodoo'] == "Operations Team") { // SW: APPROVED
353
-            $idQuery = $this->databaseHandle->exec("SELECT external_db_id FROM institution WHERE inst_id = $this->identifier AND external_db_syncstate = " . self::EXTERNAL_DB_SYNCSTATE_SYNCED);
353
+            $idQuery = $this->databaseHandle->exec("SELECT external_db_id FROM institution WHERE inst_id = $this->identifier AND external_db_syncstate = ".self::EXTERNAL_DB_SYNCSTATE_SYNCED);
354 354
             // SELECT -> it's a resource, not a boolean
355 355
             if (mysqli_num_rows(/** @scrutinizer ignore-type */ $idQuery) == 0) {
356 356
                 return FALSE;
Please login to merge, or discard this patch.
web/admin/edit_idp_result.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
  *          <base_url>/copyright.php after deploying the software
21 21
  */
22 22
 
23
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
23
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
24 24
 
25 25
 $auth = new \web\lib\admin\Authentication();
26 26
 $loggerInstance = new \core\common\Logging();
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 switch ($_POST['submitbutton']) {
41 41
     case web\lib\common\FormElements::BUTTON_DELETE:
42 42
         $myInstOriginal->destroy();
43
-        $loggerInstance->writeAudit($_SESSION['user'], "DEL", "IdP " . $instId);
43
+        $loggerInstance->writeAudit($_SESSION['user'], "DEL", "IdP ".$instId);
44 44
         header("Location: overview_user.php");
45 45
         exit;
46 46
     case web\lib\common\FormElements::BUTTON_FLUSH_AND_RESTART:
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
         }
51 51
         // flush all IdP attributes and send user to creation wizard
52 52
         $myInstOriginal->flushAttributes();
53
-        $loggerInstance->writeAudit($_SESSION['user'], "DEL", "IdP starting over" . $instId);
53
+        $loggerInstance->writeAudit($_SESSION['user'], "DEL", "IdP starting over".$instId);
54 54
         header("Location: edit_idp.php?inst_id=$instId&wizard=true");
55 55
         exit;
56 56
     case web\lib\common\FormElements::BUTTON_SAVE:
@@ -63,19 +63,19 @@  discard block
 block discarded – undo
63 63
             exit(0);
64 64
         }
65 65
         $inst_name = $myInstOriginal->name;
66
-        echo "<h1>" . sprintf(_("Submitted attributes for IdP '%s'"), $inst_name) . "</h1>";
66
+        echo "<h1>".sprintf(_("Submitted attributes for IdP '%s'"), $inst_name)."</h1>";
67 67
         echo "<table>";
68 68
         echo $optionParser->processSubmittedFields($myInstOriginal, $_POST, $_FILES);
69 69
         echo "</table>";
70 70
 // delete cached logo, if present
71
-        $dir = ROOT . '/web/downloads/logos/';
72
-        $globResult = glob($dir . $myInstOriginal->identifier . "_*.png");
71
+        $dir = ROOT.'/web/downloads/logos/';
72
+        $globResult = glob($dir.$myInstOriginal->identifier."_*.png");
73 73
         if ($globResult === FALSE) { // we should catch the improbable error condition
74 74
             $globResult = [];
75 75
         }
76 76
         array_map('unlink', $globResult);
77 77
         $loggerInstance->debug(4, "UNLINK from $dir\n");
78
-        $loggerInstance->writeAudit($_SESSION['user'], "MOD", "IdP " . $myInstOriginal->identifier . " - attributes changed");
78
+        $loggerInstance->writeAudit($_SESSION['user'], "MOD", "IdP ".$myInstOriginal->identifier." - attributes changed");
79 79
 
80 80
 // re-instantiate ourselves... profiles need fresh data
81 81
         $myInstReinstantiated = $validator->IdP($_GET['inst_id'], $_SESSION['user']);
@@ -83,32 +83,32 @@  discard block
 block discarded – undo
83 83
         $significantChanges = \core\IdP::significantChanges($myInstOriginal, $myInstReinstantiated);
84 84
         if (count($significantChanges) > 0) {
85 85
             // send a notification/alert mail to someone we know is in charge
86
-            $text = _("To whom it may concern,") . "\n\n";
86
+            $text = _("To whom it may concern,")."\n\n";
87 87
             /// were made to the *Identity Provider* *LU* / integer number of IdP / (previously known as) Name
88
-            $text .= sprintf(_("significant changes were made to the %s %s / %s / (previously known as) %s."), $uiElements->nomenclatureInst, strtoupper($myInstOriginal->federation), $myInstOriginal->identifier, $myInstOriginal->name) . "\n\n";
88
+            $text .= sprintf(_("significant changes were made to the %s %s / %s / (previously known as) %s."), $uiElements->nomenclatureInst, strtoupper($myInstOriginal->federation), $myInstOriginal->identifier, $myInstOriginal->name)."\n\n";
89 89
             if (isset($significantChanges[\core\IdP::CA_CLASH_ADDED])) {
90
-                $text .= _("WARNING! A new trusted root CA was added, and it has the exact same name as a previously existing root CA. This may (but does not necessarily) mean that this is an attempt to insert an unauthorised trust root by disguising as the genuine one. The details are below:") . "\n";
91
-                $text .= $significantChanges[\core\IdP::CA_CLASH_ADDED] . "\n\n";
90
+                $text .= _("WARNING! A new trusted root CA was added, and it has the exact same name as a previously existing root CA. This may (but does not necessarily) mean that this is an attempt to insert an unauthorised trust root by disguising as the genuine one. The details are below:")."\n";
91
+                $text .= $significantChanges[\core\IdP::CA_CLASH_ADDED]."\n\n";
92 92
             }
93 93
             if (isset($significantChanges[\core\IdP::INSTNAME_CHANGED])) {
94
-                $text .= sprintf(_("The %s has changed its name. The details are below:"), $uiElements->nomenclatureInst) . "\n\n";
95
-                $text .= $significantChanges[\core\IdP::INSTNAME_CHANGED] . "\n\n";
94
+                $text .= sprintf(_("The %s has changed its name. The details are below:"), $uiElements->nomenclatureInst)."\n\n";
95
+                $text .= $significantChanges[\core\IdP::INSTNAME_CHANGED]."\n\n";
96 96
             }
97 97
             if (isset($significantChanges[\core\IdP::CA_ADDED])) {
98 98
                 $text .= _("A new trusted root CA was added. The details are below:\n\n");
99
-                $text .= $significantChanges[\core\IdP::CA_ADDED] . "\n\n";
99
+                $text .= $significantChanges[\core\IdP::CA_ADDED]."\n\n";
100 100
             }
101 101
             if (isset($significantChanges[\core\IdP::SERVERNAME_ADDED])) {
102
-                $text .= _("A new acceptable server name for the authentication server was added. The details are below:") . "\n\n";
103
-                $text .= $significantChanges[\core\IdP::SERVERNAME_ADDED] . "\n\n";
102
+                $text .= _("A new acceptable server name for the authentication server was added. The details are below:")."\n\n";
103
+                $text .= $significantChanges[\core\IdP::SERVERNAME_ADDED]."\n\n";
104 104
             }
105
-            $text .= _("This mail is merely a cross-check because these changes can be security-relevant. If the change was expected, you do not need to take any action.") . "\n\n";
106
-            $text .= _("Greetings, ") . "\n\n" . CONFIG['APPEARANCE']['productname_long'];
105
+            $text .= _("This mail is merely a cross-check because these changes can be security-relevant. If the change was expected, you do not need to take any action.")."\n\n";
106
+            $text .= _("Greetings, ")."\n\n".CONFIG['APPEARANCE']['productname_long'];
107 107
             // (currently, send hard-wired to NRO - future: for linked insts, check eduroam DBv2 and send to registered admins directly)
108 108
             $fed = new Federation($$myInstOriginal->federation);
109 109
             foreach ($fed->listFederationAdmins() as $id) {
110 110
                 $user = new core\User($id);
111
-                $user->sendMailToUser(sprintf(_("%s: Significant Changes made to %s"),CONFIG['APPEARANCE']['productname'], $uiElements->nomenclatureInst), $text);
111
+                $user->sendMailToUser(sprintf(_("%s: Significant Changes made to %s"), CONFIG['APPEARANCE']['productname'], $uiElements->nomenclatureInst), $text);
112 112
             }
113 113
         }
114 114
 
@@ -119,15 +119,15 @@  discard block
 block discarded – undo
119 119
 
120 120
         if (isset(CONFIG_CONFASSISTANT['CONSORTIUM']['ssid']) && count(CONFIG_CONFASSISTANT['CONSORTIUM']['ssid']) > 0) {
121 121
             foreach (CONFIG_CONFASSISTANT['CONSORTIUM']['ssid'] as $ssidname) {
122
-                $ssids[] = $ssidname . " " . (isset(CONFIG_CONFASSISTANT['CONSORTIUM']['tkipsupport']) && CONFIG_CONFASSISTANT['CONSORTIUM']['tkipsupport'] === TRUE ? _("(WPA2/AES and WPA/TKIP)") : _("(WPA2/AES)") );
122
+                $ssids[] = $ssidname." ".(isset(CONFIG_CONFASSISTANT['CONSORTIUM']['tkipsupport']) && CONFIG_CONFASSISTANT['CONSORTIUM']['tkipsupport'] === TRUE ? _("(WPA2/AES and WPA/TKIP)") : _("(WPA2/AES)"));
123 123
             }
124 124
         }
125 125
 
126 126
         foreach ($myInstReinstantiated->getAttributes("media:SSID_with_legacy") as $ssidname) {
127
-            $ssids[] = $ssidname['value'] . " " . _("(WPA2/AES and WPA/TKIP)");
127
+            $ssids[] = $ssidname['value']." "._("(WPA2/AES and WPA/TKIP)");
128 128
         }
129 129
         foreach ($myInstReinstantiated->getAttributes("media:SSID") as $ssidname) {
130
-            $ssids[] = $ssidname['value'] . " " . _("(WPA2/AES)");
130
+            $ssids[] = $ssidname['value']." "._("(WPA2/AES)");
131 131
         }
132 132
 
133 133
         echo "<table>";
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
         if (count($ssids) > 0) {
136 136
             $printedlist = "";
137 137
             foreach ($ssids as $names) {
138
-                $printedlist = $printedlist . "$names ";
138
+                $printedlist = $printedlist."$names ";
139 139
             }
140 140
             echo $uiElements->boxOkay(sprintf(_("Your installers will configure the following SSIDs: <strong>%s</strong>"), $printedlist), _("SSIDs configured"));
141 141
         }
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
                 // did we get an email address? then, show the silverbullet jumpstart button
164 164
                 // otherwise, issue a smartass comment
165 165
                 if (count($myInstReinstantiated->getAttributes("support:email")) > 0) {
166
-                    echo "<form method='post' action='edit_silverbullet.php?inst_id=$myInstReinstantiated->identifier' accept-charset='UTF-8'><button type='submit'>" . sprintf(_("Continue to %s properties"), \core\ProfileSilverbullet::PRODUCTNAME) . "</button></form>";
166
+                    echo "<form method='post' action='edit_silverbullet.php?inst_id=$myInstReinstantiated->identifier' accept-charset='UTF-8'><button type='submit'>".sprintf(_("Continue to %s properties"), \core\ProfileSilverbullet::PRODUCTNAME)."</button></form>";
167 167
                 } else {
168 168
                     echo "<table>";
169 169
                     echo $uiElements->boxError(sprintf(_("You did not submit an e-mail address. This is required for %s. Please go to the %s dashboard and edit your helpdesk settings to include a helpdesk e-mail address."), core\ProfileSilverbullet::PRODUCTNAME, $ui->nomenclatureInst), _("No support e-mail!"));
@@ -171,10 +171,10 @@  discard block
 block discarded – undo
171 171
                 }
172 172
             }
173 173
             if (CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_RADIUS'] == "LOCAL") {
174
-                echo "<br/><form method='post' action='edit_profile.php?inst_id=$myInstReinstantiated->identifier' accept-charset='UTF-8'><button type='submit'>" . _("Continue to RADIUS/EAP profile definition") . "</button></form>";
174
+                echo "<br/><form method='post' action='edit_profile.php?inst_id=$myInstReinstantiated->identifier' accept-charset='UTF-8'><button type='submit'>"._("Continue to RADIUS/EAP profile definition")."</button></form>";
175 175
             }
176 176
         }
177
-        echo "<br/><form method='post' action='overview_idp.php?inst_id=$myInstReinstantiated->identifier' accept-charset='UTF-8'><button type='submit'>" . _("Continue to dashboard") . "</button></form>";
177
+        echo "<br/><form method='post' action='overview_idp.php?inst_id=$myInstReinstantiated->identifier' accept-charset='UTF-8'><button type='submit'>"._("Continue to dashboard")."</button></form>";
178 178
         echo $deco->footer();
179 179
         break;
180 180
     default:
Please login to merge, or discard this patch.