Passed
Push — master ( a7425d...dd80fa )
by Tomasz
03:35
created
web/lib/admin/domain/SilverbulletUser.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @author Zilvinas Vaira
7 7
  *
8 8
  */
9
-class SilverbulletUser extends PersistentEntity{
9
+class SilverbulletUser extends PersistentEntity {
10 10
     
11 11
     const LEVEL_GREEN = 0;
12 12
     const LEVEL_YELLOW = 1;
@@ -89,14 +89,14 @@  discard block
 block discarded – undo
89 89
      * @param int $profileId
90 90
      * @param string $username
91 91
      */
92
-    public function __construct($profileId, $username){
92
+    public function __construct($profileId, $username) {
93 93
         parent::__construct(self::TABLE, self::TYPE_INST);
94 94
         $this->setAttributeType(self::PROFILEID, Attribute::TYPE_INTEGER);
95 95
         
96 96
         $this->set(self::PROFILEID, $profileId);
97 97
         $this->set(self::USERNAME, $username);
98 98
         //$this->set(self::EXPIRY, 'NOW() + INTERVAL 1 WEEK');
99
-        $this->defaultUserExpiry = date('Y-m-d H:i:s',strtotime("today"));
99
+        $this->defaultUserExpiry = date('Y-m-d H:i:s', strtotime("today"));
100 100
         //$this->set(self::EXPIRY, $this->defaultUserExpiry);
101 101
     }
102 102
     
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
      * {@inheritDoc}
106 106
      * @see \web\lib\admin\domain\PersistentInterface::validate()
107 107
      */
108
-    public function validate(){
108
+    public function validate() {
109 109
         return (
110 110
                 !empty($this->get(self::PROFILEID))
111 111
         );
@@ -116,11 +116,11 @@  discard block
 block discarded – undo
116 116
      * 
117 117
      * @param string $date Takes any string value that can passed to strtotime() function.
118 118
      */
119
-    public function setExpiry($date){
119
+    public function setExpiry($date) {
120 120
         $tokenExpiry = date('Y-m-d H:i:s', strtotime($date));
121
-        if($tokenExpiry > $this->defaultUserExpiry){
121
+        if ($tokenExpiry > $this->defaultUserExpiry) {
122 122
             $this->set(self::EXPIRY, $tokenExpiry);
123
-        }else{
123
+        } else {
124 124
             $this->clear();
125 125
         }
126 126
     }
@@ -128,8 +128,8 @@  discard block
 block discarded – undo
128 128
     /**
129 129
      * 
130 130
      */
131
-    public function makeAcknowledged(){
132
-        $this->set(self::LAST_ACKNOWLEDGE, date('Y-m-d H:i:s',strtotime("now")));
131
+    public function makeAcknowledged() {
132
+        $this->set(self::LAST_ACKNOWLEDGE, date('Y-m-d H:i:s', strtotime("now")));
133 133
     }
134 134
     
135 135
     /**
@@ -137,14 +137,14 @@  discard block
 block discarded – undo
137 137
      * 
138 138
      * @return int One of the following constants LEVEL_GREEN, LEVEL_YELLOW, LEVEL_RED.
139 139
      */
140
-    public function getAcknowledgeLevel(){
140
+    public function getAcknowledgeLevel() {
141 141
         $max = CONFIG_CONFASSISTANT['SILVERBULLET']['gracetime'] ?? SilverbulletUser::MAX_ACKNOWLEDGE;
142 142
         $days = $this->getAcknowledgeDays();
143
-        if($days <= $max * 0.2 && $days > $max * 0.1){
143
+        if ($days <= $max * 0.2 && $days > $max * 0.1) {
144 144
             return self::LEVEL_YELLOW;
145
-        }elseif ($days <= $max * 0.1){
145
+        }elseif ($days <= $max * 0.1) {
146 146
             return self::LEVEL_RED;
147
-        }else{
147
+        } else {
148 148
             return self::LEVEL_GREEN;
149 149
         }
150 150
     }
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
      * 
155 155
      * @return number Number of days from 0 to maximum period.
156 156
      */
157
-    public function getAcknowledgeDays(){
157
+    public function getAcknowledgeDays() {
158 158
         $max = CONFIG_CONFASSISTANT['SILVERBULLET']['gracetime'] ?? SilverbulletUser::MAX_ACKNOWLEDGE;
159 159
         $lastAcknowledge = strtotime($this->get(self::LAST_ACKNOWLEDGE));
160 160
         $now = strtotime('now');
@@ -162,11 +162,11 @@  discard block
 block discarded – undo
162 162
         return $days > 0 ? $days : 0;
163 163
     }
164 164
     
165
-    public function getProfileId(){
165
+    public function getProfileId() {
166 166
         return $this->get(self::PROFILEID);
167 167
     }
168 168
     
169
-    public function getUsername(){
169
+    public function getUsername() {
170 170
         return $this->get(self::USERNAME);
171 171
     }
172 172
     
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
      * 
175 175
      * @return boolean
176 176
      */
177
-    public function isExpired(){
177
+    public function isExpired() {
178 178
         $expiryTime = strtotime($this->get(self::EXPIRY));
179 179
         $currentTime = time();
180 180
         return $currentTime > $expiryTime;
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
      *
185 185
      * @return string
186 186
      */
187
-    public function getExpiry(){
187
+    public function getExpiry() {
188 188
         return date('Y-m-d', strtotime($this->get(self::EXPIRY)));
189 189
     }
190 190
     
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
      * 
193 193
      * @return \web\lib\admin\domain\SilverbulletCertificate
194 194
      */
195
-    public function getCertificates(){
195
+    public function getCertificates() {
196 196
         return $this->certificates;
197 197
     }
198 198
 
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
      *
201 201
      * @return \web\lib\admin\domain\SilverbulletInvitation
202 202
      */
203
-    public function getInvitations(){
203
+    public function getInvitations() {
204 204
         return $this->invitations;
205 205
     }
206 206
     
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
      * 
209 209
      * @return boolean
210 210
      */
211
-    public function hasCertificates(){
211
+    public function hasCertificates() {
212 212
         return count($this->certificates) > 0;
213 213
     }
214 214
     
@@ -216,10 +216,10 @@  discard block
 block discarded – undo
216 216
      *
217 217
      * @return boolean
218 218
      */
219
-    public function hasActiveCertificates(){
219
+    public function hasActiveCertificates() {
220 220
         $count = 0;
221 221
         foreach ($this->certificates as $certificate) {
222
-            if(!$certificate->isExpired() && !$certificate->isRevoked()){
222
+            if (!$certificate->isExpired() && !$certificate->isRevoked()) {
223 223
                 $count++;
224 224
             }
225 225
         }
@@ -231,14 +231,14 @@  discard block
 block discarded – undo
231 231
      * 
232 232
      * @param boolean $isDeactivated
233 233
      */
234
-    public function setDeactivated($isDeactivated, $profile){
234
+    public function setDeactivated($isDeactivated, $profile) {
235 235
         $this->set(self::DEACTIVATION_STATUS, $isDeactivated ? self::INACTIVE : self::ACTIVE);
236
-        if($isDeactivated){
236
+        if ($isDeactivated) {
237 237
             $this->set(self::DEACTIVATION_TIME, date('Y-m-d H:i:s', strtotime("now")));
238 238
             foreach ($this->certificates as $certificate) {
239 239
                 $certificate->revoke($profile);
240 240
             }
241
-        }else{
241
+        } else {
242 242
             $this->set(self::DEACTIVATION_TIME, '0000-00-00 00:00:00');
243 243
         }
244 244
     }
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
      * 
248 248
      * @return boolean
249 249
      */
250
-    public function isDeactivated(){
250
+    public function isDeactivated() {
251 251
         return $this->get(self::DEACTIVATION_STATUS) == self::INACTIVE;
252 252
     }
253 253
     
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
      * {@inheritDoc}
257 257
      * @see \web\lib\admin\domain\PersistentInterface::load()
258 258
      */
259
-    public function load($searchAttribute = null){
259
+    public function load($searchAttribute = null) {
260 260
         $state = parent::load();
261 261
         $this->certificates = SilverbulletCertificate::getList($this, $searchAttribute);
262 262
         $this->invitations = SilverbulletInvitation::getList($this);
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
      * {@inheritDoc}
269 269
      * @see \web\lib\admin\domain\PersistentInterface::delete()
270 270
      */
271
-    public function delete(){
271
+    public function delete() {
272 272
         $state = parent::delete();
273 273
         foreach ($this->certificates as $certificate) {
274 274
             $certificate->delete();
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
      * @param integer $userId
285 285
      * @return \web\lib\admin\domain\SilverbulletUser
286 286
      */
287
-    public static function prepare($userId){
287
+    public static function prepare($userId) {
288 288
         $instance = new SilverbulletUser(null, '');
289 289
         $instance->set(self::ID, $userId);
290 290
         return $instance;
Please login to merge, or discard this patch.
web/user/faq.inc.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -14,50 +14,50 @@
 block discarded – undo
14 14
     $Faq = [
15 15
       [
16 16
         'id'=>'idp_not_listed',
17
-        'title'=>sprintf(_("My %s is not listed. Can't I just use any of the other ones?"),$Gui->nomenclature_inst),
17
+        'title'=>sprintf(_("My %s is not listed. Can't I just use any of the other ones?"), $Gui->nomenclature_inst),
18 18
         'text'=>sprintf(_("No! The installers contain security settings which are specific to the %s. If you are not from that %s, your computer will detect that you are about to send your username and credential to an unauthorised server and will abort the login. Using a different %s installer is <i>guaranteed to not work</i>!"), $Gui->nomenclature_inst, $Gui->nomenclature_inst, $Gui->nomenclature_inst)
19 19
          ],
20 20
       [
21 21
         'id'=>'idp_not_listed',
22 22
         'title'=>sprintf(_("What can I do to get my %s listed?"), $Gui->nomenclature_inst),
23
-        'text'=>sprintf(_("Contact %s administrators at your %s and complain. It will take at most one hour of their time to get things done."),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $Gui->nomenclature_inst)
23
+        'text'=>sprintf(_("Contact %s administrators at your %s and complain. It will take at most one hour of their time to get things done."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $Gui->nomenclature_inst)
24 24
 ],
25 25
       [
26 26
         'id'=>'device_not_listed',
27
-        'title'=>sprintf(_("My device is not listed! Does that mean I can't do %s?"),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']),
28
-        'text'=>sprintf(_("No. The CAT tool can only support Operating Systems which can be automatically configured in some way. Many other devices can still be used with %s, but must be configured manually. Please contact your %s Identity Provider to get help in setting up such a device."),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'],CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'])
27
+        'title'=>sprintf(_("My device is not listed! Does that mean I can't do %s?"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']),
28
+        'text'=>sprintf(_("No. The CAT tool can only support Operating Systems which can be automatically configured in some way. Many other devices can still be used with %s, but must be configured manually. Please contact your %s Identity Provider to get help in setting up such a device."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'])
29 29
       ],
30 30
 
31 31
       [
32
-        'title'=>sprintf(_("I can connect to %s simply by providing username and password, what is the point of using an installer?"),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']),
32
+        'title'=>sprintf(_("I can connect to %s simply by providing username and password, what is the point of using an installer?"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']),
33 33
         'text'=>sprintf(_("When you are connecting from an unconfigured device your security is at risk. The very point of preconfiguration is to set up security, when this is done, your device will first confirm that it talks to the correct authentication server and will never send your password to an untrusted one."))
34 34
 ],
35 35
       [
36
-        'title'=>sprintf(_("Is it safe to use %s installers?"),CONFIG['APPEARANCE']['productname']),
37
-        'text'=>sprintf(_("%s installers configure security settings on your device, therefore you should be sure that you are using genuine ones."),CONFIG['APPEARANCE']['productname']).' '.( isset(CONFIG_CONFASSISTANT['CONSORTIUM']['signer_name']) && CONFIG_CONFASSISTANT['CONSORTIUM']['signer_name'] != "" ? sprintf(_("This is why %s installers are digitally signed by %s. Watch out for a system message confirming this."),CONFIG['APPEARANCE']['productname'],CONFIG_CONFASSISTANT['CONSORTIUM']['signer_name']):""),
36
+        'title'=>sprintf(_("Is it safe to use %s installers?"), CONFIG['APPEARANCE']['productname']),
37
+        'text'=>sprintf(_("%s installers configure security settings on your device, therefore you should be sure that you are using genuine ones."), CONFIG['APPEARANCE']['productname']) . ' ' . (isset(CONFIG_CONFASSISTANT['CONSORTIUM']['signer_name']) && CONFIG_CONFASSISTANT['CONSORTIUM']['signer_name'] != "" ? sprintf(_("This is why %s installers are digitally signed by %s. Watch out for a system message confirming this."), CONFIG['APPEARANCE']['productname'], CONFIG_CONFASSISTANT['CONSORTIUM']['signer_name']) : ""),
38 38
         
39 39
 ],
40 40
       [
41 41
         'title'=>_("Windows 'SmartScreen' or 'Internet Explorer' tell me that the file is not commonly downloaded and possibly harmful. Should I be concerned?"),
42
-        'text'=>_("Contrary to what the name suggests, 'SmartScreen' isn't actually very smart. The warning merely means that the file has not yet been downloaded by enough users to make Microsoft consider it popular (which would strangely enough make it be considered 'safe'). This message alone is not a security problem.")." ".(isset(CONFIG_CONFASSISTANT['CONSORTIUM']['signer_name']) && CONFIG_CONFASSISTANT['CONSORTIUM']['signer_name'] != "" ? sprintf(_("So long as the file is carrying a valid signature from %s, the download is safe."),CONFIG_CONFASSISTANT['CONSORTIUM']['signer_name'])." ":"").sprintf(_("Please see also Microsoft's FAQ regarding SmartScreen at %s."),"<a href='http://windows.microsoft.com/en-US/windows7/SmartScreen-Filter-frequently-asked-questions-IE9?SignedIn=1'>Microsoft FAQ</a>")
42
+        'text'=>_("Contrary to what the name suggests, 'SmartScreen' isn't actually very smart. The warning merely means that the file has not yet been downloaded by enough users to make Microsoft consider it popular (which would strangely enough make it be considered 'safe'). This message alone is not a security problem.") . " " . (isset(CONFIG_CONFASSISTANT['CONSORTIUM']['signer_name']) && CONFIG_CONFASSISTANT['CONSORTIUM']['signer_name'] != "" ? sprintf(_("So long as the file is carrying a valid signature from %s, the download is safe."), CONFIG_CONFASSISTANT['CONSORTIUM']['signer_name']) . " " : "") . sprintf(_("Please see also Microsoft's FAQ regarding SmartScreen at %s."), "<a href='http://windows.microsoft.com/en-US/windows7/SmartScreen-Filter-frequently-asked-questions-IE9?SignedIn=1'>Microsoft FAQ</a>")
43 43
         
44 44
 ],
45 45
       [
46
-        'title'=>sprintf(_("I can see %s network and my device is configured but it does not connect, what can be the cause?"),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']),
47
-      'text'=>sprintf(_("There can be a number of different reasons. The network you see may not be a genuine %s one and your device silently drops the connection attempt; there may be something wrong with the configuration of the network; your account may have expired; there may be a connection problem with your home authentication server; you may have broken the regulations of the network you are using and have been refused access as a consequence. You should contact your %s and report the problem, the administrators should be able to trace your connections."),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $Gui->nomenclature_inst)
46
+        'title'=>sprintf(_("I can see %s network and my device is configured but it does not connect, what can be the cause?"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']),
47
+      'text'=>sprintf(_("There can be a number of different reasons. The network you see may not be a genuine %s one and your device silently drops the connection attempt; there may be something wrong with the configuration of the network; your account may have expired; there may be a connection problem with your home authentication server; you may have broken the regulations of the network you are using and have been refused access as a consequence. You should contact your %s and report the problem, the administrators should be able to trace your connections."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $Gui->nomenclature_inst)
48 48
 ],
49 49
       [
50 50
         'id'=>'contact',
51 51
         'title'=>sprintf(_("I have a question about this web site. Whom should I contact?")),
52
-        'text'=>sprintf(_("You should send a mail to %s."),CONFIG['APPEARANCE']['support-contact']['display'])
52
+        'text'=>sprintf(_("You should send a mail to %s."), CONFIG['APPEARANCE']['support-contact']['display'])
53 53
       ],
54 54
 ];
55 55
 
56 56
     if (CONFIG_CONFASSISTANT['CONSORTIUM']['name'] == "eduroam") {
57 57
        array_push($Faq,
58 58
          [
59
-           'id'=>'what_is_'.CONFIG_CONFASSISTANT['CONSORTIUM']['name'],
59
+           'id'=>'what_is_' . CONFIG_CONFASSISTANT['CONSORTIUM']['name'],
60 60
            'title'=>sprintf(_("What is this %s thing anyway?"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']),
61
-           'text'=>sprintf(_("%s is a global WiFi roaming consortium which gives members of education and research access to the internet <i>for free</i> on all %s hotspots on the planet. There are several million %s users already, enjoying free internet access on more than 6.000 hotspots! Visit <a href='http://www.eduroam.org'>the %s homepage</a> for more details."),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'],CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'],CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'],CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'])
61
+           'text'=>sprintf(_("%s is a global WiFi roaming consortium which gives members of education and research access to the internet <i>for free</i> on all %s hotspots on the planet. There are several million %s users already, enjoying free internet access on more than 6.000 hotspots! Visit <a href='http://www.eduroam.org'>the %s homepage</a> for more details."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'])
62 62
          ]);
63 63
     }
64 64
\ No newline at end of file
Please login to merge, or discard this patch.
core/CAT.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -137,7 +137,7 @@
 block discarded – undo
137 137
         $dummy_inst2 = _("organisation");
138 138
         $dummy_inst3 = _("Identity Provider");
139 139
         // and do something useless with the strings so that there's no "unused" complaint
140
-        if (strlen($dummy_NRO . $dummy_inst1 . $dummy_inst2 . $dummy_inst3) < 0 ) {
140
+        if (strlen($dummy_NRO . $dummy_inst1 . $dummy_inst2 . $dummy_inst3) < 0) {
141 141
             throw new Exception("Strings are usually not shorter than 0 characters. We've encountered a string blackhole.");
142 142
         }
143 143
 
Please login to merge, or discard this patch.
web/admin/inc/toggleRedirect.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
         throw new Exception("POSTed EAP type value is not an integer!");
52 52
     }
53 53
     // conversion routine throws an exception if the EAP type id is not known
54
-    $eaptype = new \core\common\EAP((int)$posted_eaptype);
54
+    $eaptype = new \core\common\EAP((int) $posted_eaptype);
55 55
 }
56 56
 
57 57
 // there is either one or the other. If both are set, something's fishy.
Please login to merge, or discard this patch.
web/skins/classic/user/cat_info.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
         }
44 44
         break;
45 45
     case 'about':
46
-        $out = sprintf(_("<span class='edu_cat'>%s</span> is built as a cooperation platform.<p>Local %s administrators enter their %s configuration details and based on them, <span class='edu_cat'>%s</span> builds customised installers for a number of popular platforms. An installer prepared for one %s will not work for users of another one, therefore if your %s is not on the list, you cannot use this system. Please contact your local administrators and try to influence them to add your %s configuration to <span class='edu_cat'>%s</span>."), CONFIG['APPEARANCE']['productname'], CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], CONFIG['APPEARANCE']['productname'],$skinObject->nomenclature_inst, $skinObject->nomenclature_inst, $skinObject->nomenclature_inst, CONFIG['APPEARANCE']['productname']);
46
+        $out = sprintf(_("<span class='edu_cat'>%s</span> is built as a cooperation platform.<p>Local %s administrators enter their %s configuration details and based on them, <span class='edu_cat'>%s</span> builds customised installers for a number of popular platforms. An installer prepared for one %s will not work for users of another one, therefore if your %s is not on the list, you cannot use this system. Please contact your local administrators and try to influence them to add your %s configuration to <span class='edu_cat'>%s</span>."), CONFIG['APPEARANCE']['productname'], CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], CONFIG['APPEARANCE']['productname'], $skinObject->nomenclature_inst, $skinObject->nomenclature_inst, $skinObject->nomenclature_inst, CONFIG['APPEARANCE']['productname']);
47 47
         $out .= "<p>" . sprintf(_("<span class='edu_cat'>%s</span> currently supports the following devices and EAP type combinations:"), CONFIG['APPEARANCE']['productname']) . "</p>";
48 48
         $out .= "<table><tr><th>" . _("Device Group") . "</th><th>" . _("Device") . "</th>";
49 49
 foreach (\core\common\EAP::listKnownEAPTypes() as $oneeap) {
Please login to merge, or discard this patch.
core/ProfileRADIUS.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 
71 71
         $this->realm = $profileQuery->realm;
72 72
 
73
-        $localValueIfAny = (preg_match('/@/', $this->realm) ? substr($this->realm, 0, strpos($this->realm, '@')) : "anonymous" );
73
+        $localValueIfAny = (preg_match('/@/', $this->realm) ? substr($this->realm, 0, strpos($this->realm, '@')) : "anonymous");
74 74
 
75 75
         $internalAttributes = [
76 76
             "internal:profile_count" => $this->idpNumberOfProfiles,
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
                 "row" => $attributeQuery->row,
168 168
                 "flag" => $optinfo['flag'],
169 169
                 "device" => ($devicesOrEAPMethods == "DEVICES" ? $attributeQuery->deviceormethod : NULL),
170
-                "eapmethod" => ($devicesOrEAPMethods == "DEVICES" ? 0 : (new \core\common\EAP($attributeQuery->deviceormethod))->getArrayRep() )];
170
+                "eapmethod" => ($devicesOrEAPMethods == "DEVICES" ? 0 : (new \core\common\EAP($attributeQuery->deviceormethod))->getArrayRep())];
171 171
         }
172 172
         return $temparray;
173 173
     }
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
      */
268 268
     public function setRealmCheckUser($shallwe, $localpart = NULL) {
269 269
         $this->databaseHandle->exec("UPDATE profile SET checkuser_outer = " . ($shallwe === true ? "1" : "0") .
270
-                ( $localpart !== NULL ? ", checkuser_value = '$localpart' " : "") .
270
+                ($localpart !== NULL ? ", checkuser_value = '$localpart' " : "") .
271 271
                 " WHERE profile_id = $this->identifier");
272 272
     }
273 273
 
Please login to merge, or discard this patch.
web/diag/action_userdiag.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -167,10 +167,10 @@
 block discarded – undo
167 167
             $checks[] = ["realm" => $sanitised_realm, "instance" => new \core\diag\RADIUSTests($sanitised_realm, $profile->getRealmCheckOuterUsername(), $profile->getEapMethodsinOrderOfPreference(1), $profile->getCollapsedAttributes()['eap:server_name'], $profile->getCollapsedAttributes()['eap:ca_file']), "class" => "CAT", "profile" => $profile];
168 168
             echo "Debugging CAT Profile $profile_id for $sanitised_realm<br/>";
169 169
         } else if (!empty($cat->getExternalDBEntityDetails(0, $realm))) {
170
-            $checks[] = ["realm" => $sanitised_realm, "instance" => new \core\diag\RADIUSTests($sanitised_realm, "@".$sanitised_realm), "class" => "EXT_DB"];
170
+            $checks[] = ["realm" => $sanitised_realm, "instance" => new \core\diag\RADIUSTests($sanitised_realm, "@" . $sanitised_realm), "class" => "EXT_DB"];
171 171
             echo "Debugging non-CAT but existing realm $sanitised_realm<br/>";
172 172
         } else {
173
-            $checks[] = ["realm" => $sanitised_realm, "instance" => new \core\diag\RADIUSTests($sanitised_realm, "@".$sanitised_realm), "class" => "ALIEN"];
173
+            $checks[] = ["realm" => $sanitised_realm, "instance" => new \core\diag\RADIUSTests($sanitised_realm, "@" . $sanitised_realm), "class" => "ALIEN"];
174 174
             echo "Debugging non-existing realm $sanitised_realm<br/>";
175 175
         }
176 176
     }
Please login to merge, or discard this patch.
web/diag/radius_tests.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 
28 28
 function disp_name($eap) {
29 29
     $displayName = EAP::eapDisplayName($eap);
30
-    return $displayName['OUTER'] . ( $displayName['INNER'] != '' ? '-' . $displayName['INNER'] : '');
30
+    return $displayName['OUTER'] . ($displayName['INNER'] != '' ? '-' . $displayName['INNER'] : '');
31 31
 }
32 32
 
33 33
 if (!isset($_REQUEST['test_type']) || !$_REQUEST['test_type']) {
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     $testsuite = new \core\diag\RADIUSTests($check_realm, $my_profile->getRealmCheckOuterUsername(), $my_profile->getEapMethodsinOrderOfPreference(1), $my_profile->getCollapsedAttributes()['eap:server_name'], $my_profile->getCollapsedAttributes()['eap:ca_file']);
51 51
 } else {
52 52
     $my_profile = NULL;
53
-    $testsuite = new \core\diag\RADIUSTests($check_realm, "@".$check_realm);
53
+    $testsuite = new \core\diag\RADIUSTests($check_realm, "@" . $check_realm);
54 54
 }
55 55
 
56 56
 
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
     // contains port number; needs to be redacted for filter_var to work
67 67
     // in any case, it's a printable string, so filter it initially
68 68
     
69
-    $filteredHost = filter_input(INPUT_GET,'src', FILTER_SANITIZE_STRING) ?? filter_input(INPUT_POST,'src', FILTER_SANITIZE_STRING);
69
+    $filteredHost = filter_input(INPUT_GET, 'src', FILTER_SANITIZE_STRING) ?? filter_input(INPUT_POST, 'src', FILTER_SANITIZE_STRING);
70 70
     $hostonly1 = preg_replace('/:[0-9]*$/', "", $filteredHost);
71 71
     $hostonly2 = preg_replace('/^\[/', "", $hostonly1);
72 72
     $hostonly3 = preg_replace('/\]$/', "", $hostonly2);
@@ -295,12 +295,12 @@  discard block
 block discarded – undo
295 295
         $returnarray['time_millisec'] = sprintf("%d", $testsuite->UDP_reachability_result[$host]['time_millisec']);
296 296
 
297 297
         if (preg_match('/verify error:num=19/', implode($opensslbabble))) {
298
-            $printedres .= "<tr><td>"._("<strong>ERROR</strong>: the server presented a certificate which is from an unknown authority!") . $measure ."</td></tr>";
298
+            $printedres .= "<tr><td>" . _("<strong>ERROR</strong>: the server presented a certificate which is from an unknown authority!") . $measure . "</td></tr>";
299 299
             $my_ip_addrs[$key]["status"] = "FAILED";
300 300
             $goterror = 1;
301 301
         }
302 302
         if (preg_match('/verify return:1/', implode($opensslbabble))) {
303
-            $printedres .= "<tr><td>"._("Completed.") . $measure . "</td></tr>";
303
+            $printedres .= "<tr><td>" . _("Completed.") . $measure . "</td></tr>";
304 304
             $printedres .= "<tr><td></td><td><div class=\"more\">";
305 305
             $my_ip_addrs[$key]["status"] = "OK";
306 306
             $servercertRaw = implode("\n", $opensslbabble);
Please login to merge, or discard this patch.
web/admin/API.php 1 patch
Spacing   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -40,8 +40,7 @@  discard block
 block discarded – undo
40 40
         $leftNum = (int) preg_replace($pat, $rep, $left);
41 41
         $rightNum = (int) preg_replace($pat, $rep, $right);
42 42
         return ($left != $leftNum && $right != $rightNum) ?
43
-                $leftNum - $rightNum :
44
-                strcmp($left, $right);
43
+                $leftNum - $rightNum : strcmp($left, $right);
45 44
     }
46 45
 
47 46
     
@@ -118,8 +117,8 @@  discard block
 block discarded – undo
118 117
             $therealm = "";
119 118
             $theanonid = "anonymous";
120 119
             $useAnon = FALSE;
121
-            $stringValuesFiltered = filter_input(INPUT_POST,'value', FILTER_SANITIZE_STRING, FILTER_REQUIRE_ARRAY);
122
-            $intValuesFiltered = filter_input(INPUT_POST,'value', FILTER_SANITIZE_NUMBER_INT, FILTER_REQUIRE_ARRAY);
120
+            $stringValuesFiltered = filter_input(INPUT_POST, 'value', FILTER_SANITIZE_STRING, FILTER_REQUIRE_ARRAY);
121
+            $intValuesFiltered = filter_input(INPUT_POST, 'value', FILTER_SANITIZE_NUMBER_INT, FILTER_REQUIRE_ARRAY);
123 122
             $pref = 0;
124 123
             foreach ($_POST['option'] as $optindex => $optname) {
125 124
                 switch ($optname) {
@@ -145,7 +144,7 @@  discard block
 block discarded – undo
145 144
                         
146 145
                         if (isset($intValuesFiltered[$optindex . "-0"])) {
147 146
                             $filteredType = $intValuesFiltered[$optindex . "-0"];
148
-                            if ($filteredType <0 || $filteredType >8) {
147
+                            if ($filteredType < 0 || $filteredType > 8) {
149 148
                                 break;
150 149
                             }
151 150
                             $newprofile->addSupportedEapMethod(new \core\common\EAP($filteredType), $pref);
Please login to merge, or discard this patch.