Passed
Push — release_2_0 ( 504768...70923e )
by Tomasz
08:21
created
config/config-confassistant-template.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -116,16 +116,16 @@
 block discarded – undo
116 116
         'server_suffix' => '.hosted.eduroam.org',
117 117
         'gracetime' => 90,
118 118
         'CA' => ["type" => "embedded"], # OCSP URL needs to be configured in openssl.cnf
119
-      # 'CA' => ["type" => "DFN", "SOAP_API_ENDPOINT" => "http://no.idea.where/"],
119
+        # 'CA' => ["type" => "DFN", "SOAP_API_ENDPOINT" => "http://no.idea.where/"],
120 120
 
121 121
     ],
122 122
     
123 123
         /**
124
-     * Lists the RADIUS servers. They have a built-in DB to log auth requests.
125
-     * We need to query those to get auth stats for silverbullet admins
126
-     *
127
-     * @var array
128
-     */
124
+         * Lists the RADIUS servers. They have a built-in DB to log auth requests.
125
+         * We need to query those to get auth stats for silverbullet admins
126
+         *
127
+         * @var array
128
+         */
129 129
     'DB' => [
130 130
         // names don't matter - the source code will iterate through
131 131
         // all entries
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -134,13 +134,13 @@
 block discarded – undo
134 134
             'db' => 'radacct',
135 135
             'user' => 'someuser',
136 136
             'pass' => 'somepass',
137
-            'readonly' => TRUE,],
137
+            'readonly' => TRUE, ],
138 138
         'RADIUS_2' => [
139 139
             'host' => 'auth-2.hosted.eduroam.org',
140 140
             'db' => 'radacct',
141 141
             'user' => 'someuser',
142 142
             'pass' => 'somepass',
143
-            'readonly' => TRUE,],
143
+            'readonly' => TRUE, ],
144 144
     ],
145 145
 
146 146
     /**
Please login to merge, or discard this patch.
web/admin/inc/userStats.inc.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * ******************************************************************************
10 10
  */
11 11
 
12
-require_once dirname(dirname(dirname(dirname(__FILE__)))) . "/config/_config.php";
12
+require_once dirname(dirname(dirname(dirname(__FILE__))))."/config/_config.php";
13 13
 
14 14
 $auth = new \web\lib\admin\Authentication();
15 15
 $auth->authenticate();
@@ -22,30 +22,30 @@  discard block
 block discarded – undo
22 22
 
23 23
 ?>
24 24
 
25
-<h1><?php echo _("User Authentication Records");?></h1>
26
-<p><?php echo _("Note that:");?></p>
25
+<h1><?php echo _("User Authentication Records"); ?></h1>
26
+<p><?php echo _("Note that:"); ?></p>
27 27
 <ul>
28
-    <li><?php echo _("Authentication records are deleted after six months retention time");?></li>
29
-    <li><?php echo _("Operator Domain is based on the RADIUS attribute 'Operator-Name' and not sent by all hotspots");?></li>
30
-    <li><?php echo _("Different MAC addresses per credential may be due to MAC Address randomisation in recent operating systems");?></li>
28
+    <li><?php echo _("Authentication records are deleted after six months retention time"); ?></li>
29
+    <li><?php echo _("Operator Domain is based on the RADIUS attribute 'Operator-Name' and not sent by all hotspots"); ?></li>
30
+    <li><?php echo _("Different MAC addresses per credential may be due to MAC Address randomisation in recent operating systems"); ?></li>
31 31
 </ul>
32 32
 <table class='authrecord'>
33 33
     <tr>
34
-        <td><strong><?php echo _("Timestamp");?></strong></td>
35
-        <td><strong><?php echo _("Credential");?></strong></td>
36
-        <td><strong><?php echo _("MAC Address");?></strong></td>
37
-        <td><strong><?php echo _("Result");?></strong></td>
38
-        <td><strong><?php echo _("Operator Domain");?></strong></td>
34
+        <td><strong><?php echo _("Timestamp"); ?></strong></td>
35
+        <td><strong><?php echo _("Credential"); ?></strong></td>
36
+        <td><strong><?php echo _("MAC Address"); ?></strong></td>
37
+        <td><strong><?php echo _("Result"); ?></strong></td>
38
+        <td><strong><?php echo _("Operator Domain"); ?></strong></td>
39 39
     </tr>
40 40
     <?php
41 41
     $userAuthData = $profile->getUserAuthRecords($userInt);
42 42
     foreach ($userAuthData as $oneRecord) {
43
-        echo "<tr class='".($oneRecord['RESULT'] == "Access-Accept" ? "auth-success" : "auth-fail" )."'>"
43
+        echo "<tr class='".($oneRecord['RESULT'] == "Access-Accept" ? "auth-success" : "auth-fail")."'>"
44 44
                 . "<td>".$oneRecord['TIMESTAMP']."</td>"
45
-                . "<td>".substr_replace($oneRecord['CN'], "@…", strpos($oneRecord['CN'],"@"))."</td>"
45
+                . "<td>".substr_replace($oneRecord['CN'], "@…", strpos($oneRecord['CN'], "@"))."</td>"
46 46
                 . "<td>".$oneRecord['MAC']."</td>"
47 47
                 . "<td>".($oneRecord['RESULT'] == "Access-Accept" ? _("Success") : _("Failure"))."</td>"
48
-                . "<td>".substr($oneRecord['OPERATOR'] ?? "1(unknown)",1)."</td>"
48
+                . "<td>".substr($oneRecord['OPERATOR'] ?? "1(unknown)", 1)."</td>"
49 49
                 . "</tr>";
50 50
     }
51 51
     ?>
Please login to merge, or discard this patch.
core/DBConnection.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
 use \Exception;
34 34
 
35
-require_once dirname(__DIR__) . "/config/_config.php";
35
+require_once dirname(__DIR__)."/config/_config.php";
36 36
 
37 37
 /**
38 38
  * This class is a singleton for establishing a connection to the database
@@ -60,24 +60,24 @@  discard block
 block discarded – undo
60 60
             case "EXTERNAL":
61 61
             case "FRONTEND":
62 62
             case "DIAGNOSTICS":
63
-                if (!isset(self::${"instance" . $theDb})) {
63
+                if (!isset(self::${"instance".$theDb})) {
64 64
                     $class = __CLASS__;
65
-                    self::${"instance" . $theDb} = new $class($database);
66
-                    DBConnection::${"instance" . $theDb}->databaseInstance = $theDb;
65
+                    self::${"instance".$theDb} = new $class($database);
66
+                    DBConnection::${"instance".$theDb}->databaseInstance = $theDb;
67 67
                 }
68
-                return self::${"instance" . $theDb};
68
+                return self::${"instance".$theDb};
69 69
             case "RADIUS":
70
-                if (!isset(self::${"instance" . $theDb})) {
70
+                if (!isset(self::${"instance".$theDb})) {
71 71
                     $class = __CLASS__;
72 72
                     foreach (CONFIG_CONFASSISTANT['DB'] as $name => $oneRadiusAuthDb) {
73 73
                         $theInstance = new $class($name);
74
-                        self::${"instance" . $theDb}[] = $theInstance;
74
+                        self::${"instance".$theDb}[] = $theInstance;
75 75
                         $theInstance->databaseInstance = $theDb;
76 76
                     }
77 77
                 }
78
-                return self::${"instance" . $theDb};
78
+                return self::${"instance".$theDb};
79 79
             default:
80
-                throw new Exception("This type of database (" . strtoupper($database) . ") is not known!");
80
+                throw new Exception("This type of database (".strtoupper($database).") is not known!");
81 81
         }
82 82
     }
83 83
 
@@ -116,18 +116,18 @@  discard block
 block discarded – undo
116 116
             }
117 117
         }
118 118
         // log exact query to debug log, if log level is at 5
119
-        $this->loggerInstance->debug(5, "DB ATTEMPT: " . $querystring . "\n");
119
+        $this->loggerInstance->debug(5, "DB ATTEMPT: ".$querystring."\n");
120 120
         if ($types !== NULL) {
121
-            $this->loggerInstance->debug(5, "Argument type sequence: $types, parameters are: " . print_r($arguments, true));
121
+            $this->loggerInstance->debug(5, "Argument type sequence: $types, parameters are: ".print_r($arguments, true));
122 122
         }
123 123
 
124 124
         if ($this->connection->connect_error) {
125
-            throw new Exception("ERROR: Cannot send query to $this->databaseInstance database (no connection, error number" . $this->connection->connect_error . ")!");
125
+            throw new Exception("ERROR: Cannot send query to $this->databaseInstance database (no connection, error number".$this->connection->connect_error.")!");
126 126
         }
127 127
         if ($types === NULL) {
128 128
             $result = $this->connection->query($querystring);
129 129
             if ($result === FALSE) {
130
-                throw new Exception("DB: Unable to execute simple statement! Error was --> " . $this->connection->error . " <--");
130
+                throw new Exception("DB: Unable to execute simple statement! Error was --> ".$this->connection->error." <--");
131 131
             }
132 132
         } else {
133 133
             // fancy! prepared statement with dedicated argument list
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
             }
141 141
             $prepResult = $statementObject->prepare($querystring);
142 142
             if ($prepResult === FALSE) {
143
-                throw new Exception("DB: Unable to prepare statement! Statement was --> $querystring <--, error was --> " . $statementObject->error . " <--.");
143
+                throw new Exception("DB: Unable to prepare statement! Statement was --> $querystring <--, error was --> ".$statementObject->error." <--.");
144 144
             }
145 145
 
146 146
             // we have a variable number of arguments packed into the ... array
@@ -152,11 +152,11 @@  discard block
 block discarded – undo
152 152
             array_unshift($localArray, $types);
153 153
             $retval = call_user_func_array([$statementObject, "bind_param"], $localArray);
154 154
             if ($retval === FALSE) {
155
-                throw new Exception("DB: Unable to bind parameters to prepared statement! Argument array was --> " . var_export($localArray, TRUE) . " <--. Error was --> " . $statementObject->error . " <--");
155
+                throw new Exception("DB: Unable to bind parameters to prepared statement! Argument array was --> ".var_export($localArray, TRUE)." <--. Error was --> ".$statementObject->error." <--");
156 156
             }
157 157
             $result = $statementObject->execute();
158 158
             if ($result === FALSE) {
159
-                throw new Exception("DB: Unable to execute prepared statement! Error was --> " . $statementObject->error . " <--");
159
+                throw new Exception("DB: Unable to execute prepared statement! Error was --> ".$statementObject->error." <--");
160 160
             }
161 161
             $selectResult = $statementObject->get_result();
162 162
             if ($selectResult !== FALSE) {
@@ -168,14 +168,14 @@  discard block
 block discarded – undo
168 168
 
169 169
         // all cases where $result could be FALSE have been caught earlier
170 170
         if ($this->connection->errno) {
171
-            throw new Exception("ERROR: Cannot execute query in $this->databaseInstance database - (hopefully escaped) query was '$querystring', errno was " . $this->connection->errno . "!");
171
+            throw new Exception("ERROR: Cannot execute query in $this->databaseInstance database - (hopefully escaped) query was '$querystring', errno was ".$this->connection->errno."!");
172 172
         }
173 173
 
174 174
 
175 175
         if ($isMoreThanSelect) {
176
-            $this->loggerInstance->writeSQLAudit("[DB: " . strtoupper($this->databaseInstance) . "] " . $querystring);
176
+            $this->loggerInstance->writeSQLAudit("[DB: ".strtoupper($this->databaseInstance)."] ".$querystring);
177 177
             if ($types !== NULL) {
178
-                $this->loggerInstance->writeSQLAudit("Argument type sequence: $types, parameters are: " . print_r($arguments, true));
178
+                $this->loggerInstance->writeSQLAudit("Argument type sequence: $types, parameters are: ".print_r($arguments, true));
179 179
             }
180 180
         }
181 181
         return $result;
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
             $this->readOnly = CONFIG_CONFASSISTANT['DB'][$databaseCapitalised]['readonly'];
271 271
         }
272 272
         if ($this->connection->connect_error) {
273
-            throw new Exception("ERROR: Unable to connect to $database database! This is a fatal error, giving up (error number " . $this->connection->connect_errno . ").");
273
+            throw new Exception("ERROR: Unable to connect to $database database! This is a fatal error, giving up (error number ".$this->connection->connect_errno.").");
274 274
         }
275 275
 
276 276
         if ($databaseCapitalised == "EXTERNAL" && CONFIG_CONFASSISTANT['CONSORTIUM']['name'] == "eduroam" && isset(CONFIG_CONFASSISTANT['CONSORTIUM']['deployment-voodoo']) && CONFIG_CONFASSISTANT['CONSORTIUM']['deployment-voodoo'] == "Operations Team") {
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<AbstractProfile> 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.
web/lib/common/InputValidation.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
      */
38 38
     private function inputValidationError($customtext) {
39 39
         \core\common\Entity::intoThePotatoes();
40
-        $retval = "<p>" . _("Input validation error: ") . $customtext . "</p>";
40
+        $retval = "<p>"._("Input validation error: ").$customtext."</p>";
41 41
         \core\common\Entity::outOfThePotatoes();
42 42
         return $retval;
43 43
     }
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
      */
150 150
     public function string($input, $allowWhitespace = FALSE) {
151 151
     // always chop out invalid characters, and surrounding whitespace
152
-    $retvalStep0 =  iconv("UTF-8", "UTF-8//TRANSLIT", $input);
152
+    $retvalStep0 = iconv("UTF-8", "UTF-8//TRANSLIT", $input);
153 153
     if ($retvalStep0 === FALSE) {
154 154
         throw new Exception("iconv failure for string sanitisation. With TRANSLIT, this should never happen!");
155 155
     }
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
     try {
458 458
         $image->readImageBlob($binary);
459 459
     } catch (\ImagickException $exception) {
460
-        echo "Error" . $exception->getMessage();
460
+        echo "Error".$exception->getMessage();
461 461
         return FALSE;
462 462
     }
463 463
     // image survived the sanity check
Please login to merge, or discard this patch.
web/skins/modern/user/js/cat_js.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         otherdata = j.otherdata;
88 88
     if(! result) {
89 89
       alert("<?php escaped_echo(_("no matching data found"))?>");
90
-      document.location.href='<?php echo rtrim(dirname($_SERVER['SCRIPT_NAME']), '/') . '/' ?>';
90
+      document.location.href='<?php echo rtrim(dirname($_SERVER['SCRIPT_NAME']), '/').'/' ?>';
91 91
     }
92 92
     j = j.data;
93 93
     n = j.length;
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
        result = j1.status;
225 225
        if(! result) {
226 226
             alert("<?php escaped_echo(_("no matching data found")) ?>");
227
-            document.location.href='<?php echo rtrim(dirname($_SERVER['SCRIPT_NAME']), '/') . '/' ?>';
227
+            document.location.href='<?php echo rtrim(dirname($_SERVER['SCRIPT_NAME']), '/').'/' ?>';
228 228
        }
229 229
        j = j1.data;
230 230
        if(j.description !== undefined && j.description) {
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
          $("#profile_desc").hide();
236 236
          $("#profile_desc").text('');
237 237
        }
238
-       updateTxt = '<span class="user_info"><?php escaped_echo(_("This entry was last updated at:"));?>'+' '+j.last_changed+'</span><br/>';
238
+       updateTxt = '<span class="user_info"><?php escaped_echo(_("This entry was last updated at:")); ?>'+' '+j.last_changed+'</span><br/>';
239 239
        if(j.local_url !== undefined && j.local_url) 
240 240
        txt = txt+'<span class="user_info"><?php escaped_echo(_("WWW:")); ?> <a href="'+j.local_url+'" target="_blank">'+j.local_url+'</a></span><br/>';
241 241
        if(j.local_email !== undefined && j.local_email) 
Please login to merge, or discard this patch.
core/ProfileSilverbullet.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 
91 91
 // realm is automatically calculated, then stored in DB
92 92
 
93
-        $this->realm = "opaquehash@$myInst->identifier-$this->identifier." . strtolower($myInst->federation) . CONFIG_CONFASSISTANT['SILVERBULLET']['realm_suffix'];
93
+        $this->realm = "opaquehash@$myInst->identifier-$this->identifier.".strtolower($myInst->federation).CONFIG_CONFASSISTANT['SILVERBULLET']['realm_suffix'];
94 94
         $localValueIfAny = "";
95 95
 
96 96
 // but there's some common internal attributes populated directly
@@ -107,11 +107,11 @@  discard block
 block discarded – undo
107 107
 
108 108
         // and we need to populate eap:server_name and eap:ca_file with the NRO-specific EAP information
109 109
         $silverbulletAttributes = [
110
-            "eap:server_name" => "auth." . strtolower($myFed->tld) . CONFIG_CONFASSISTANT['SILVERBULLET']['server_suffix'],
110
+            "eap:server_name" => "auth.".strtolower($myFed->tld).CONFIG_CONFASSISTANT['SILVERBULLET']['server_suffix'],
111 111
         ];
112 112
         $temp = array_merge($this->addInternalAttributes($internalAttributes), $this->addInternalAttributes($silverbulletAttributes));
113 113
         $x509 = new \core\common\X509();
114
-        $caHandle = fopen(dirname(__FILE__) . "/../config/SilverbulletServerCerts/" . strtoupper($myFed->tld) . "/root.pem", "r");
114
+        $caHandle = fopen(dirname(__FILE__)."/../config/SilverbulletServerCerts/".strtoupper($myFed->tld)."/root.pem", "r");
115 115
         if ($caHandle !== FALSE) {
116 116
             $cAFile = fread($caHandle, 16000000);
117 117
             foreach ($x509->splitCertificate($cAFile) as $oneCa) {
@@ -132,26 +132,26 @@  discard block
 block discarded – undo
132 132
         $this->loggerInstance->debug(3, "--- END Constructing new Profile object ... ---\n");
133 133
 
134 134
         $this->termsAndConditions = "<h2>Product Definition</h2>
135
-        <p>" . \core\ProfileSilverbullet::PRODUCTNAME . " outsources the technical setup of " . CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'] . " " . CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution'] . " functions to the " . CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'] . " Operations Team. The system includes</p>
135
+        <p>" . \core\ProfileSilverbullet::PRODUCTNAME." outsources the technical setup of ".CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']." ".CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution']." functions to the ".CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']." Operations Team. The system includes</p>
136 136
             <ul>
137 137
                 <li>a web-based user management interface where user accounts and access credentials can be created and revoked (there is a limit to the number of active users)</li>
138 138
                 <li>a technical infrastructure ('CA') which issues and revokes credentials</li>
139
-                <li>a technical infrastructure ('RADIUS') which verifies access credentials and subsequently grants access to " . CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'] . "</li>           
139
+                <li>a technical infrastructure ('RADIUS') which verifies access credentials and subsequently grants access to " . CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']."</li>           
140 140
             </ul>
141 141
         <h2>User Account Liability</h2>
142
-        <p>As an " . CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'] . " " . CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution'] . " administrator using this system, you are authorized to create user accounts according to your local " . CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution'] . " policy. You are fully responsible for the accounts you issue and are the data controller for all user information you deposit in this system; the system is a data processor.</p>";
142
+        <p>As an " . CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']." ".CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution']." administrator using this system, you are authorized to create user accounts according to your local ".CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution']." policy. You are fully responsible for the accounts you issue and are the data controller for all user information you deposit in this system; the system is a data processor.</p>";
143 143
         $this->termsAndConditions .= "<p>Your responsibilities include that you</p>
144 144
         <ul>
145
-            <li>only issue accounts to members of your " . CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution'] . ", as defined by your local policy.</li>
145
+            <li>only issue accounts to members of your " . CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution'].", as defined by your local policy.</li>
146 146
             <li>must make sure that all accounts that you issue can be linked by you to actual human end users</li>
147
-            <li>have to immediately revoke accounts of users when they leave or otherwise stop being a member of your " . CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution'] . "</li>
147
+            <li>have to immediately revoke accounts of users when they leave or otherwise stop being a member of your " . CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution']."</li>
148 148
             <li>will act upon notifications about possible network abuse by your users and will appropriately sanction them</li>
149 149
         </ul>
150 150
         <p>";
151
-        $this->termsAndConditions .= "Failure to comply with these requirements may make your " . CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_federation'] . " act on your behalf, which you authorise, and will ultimately lead to the deletion of your " . CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution'] . " (and all the users you create inside) in this system.";
151
+        $this->termsAndConditions .= "Failure to comply with these requirements may make your ".CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_federation']." act on your behalf, which you authorise, and will ultimately lead to the deletion of your ".CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution']." (and all the users you create inside) in this system.";
152 152
         $this->termsAndConditions .= "</p>
153 153
         <h2>Privacy</h2>
154
-        <p>With " . \core\ProfileSilverbullet::PRODUCTNAME . ", we are necessarily storing personally identifiable information about the end users you create. While the actual human is only identifiable with your help, we consider all the user data as relevant in terms of privacy jurisdiction. Please note that</p>
154
+        <p>With " . \core\ProfileSilverbullet::PRODUCTNAME.", we are necessarily storing personally identifiable information about the end users you create. While the actual human is only identifiable with your help, we consider all the user data as relevant in terms of privacy jurisdiction. Please note that</p>
155 155
         <ul>
156 156
             <li>You are the only one who needs to be able to make a link to the human behind the usernames you create. The usernames you create in the system have to be rich enough to allow you to make that identification step. Also consider situations when you are unavailable or leave the organisation and someone else needs to perform the matching to an individual.</li>
157 157
             <li>The identifiers we create in the credentials are not linked to the usernames you add to the system; they are randomly generated pseudonyms.</li>
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
         if (empty($certNames)) {
255 255
             return [];
256 256
         }
257
-        $namesCondensed = "'" . implode("' OR username = '", $certNames) . "'";
257
+        $namesCondensed = "'".implode("' OR username = '", $certNames)."'";
258 258
         $serverHandles = DBConnection::handle("RADIUS");
259 259
         $returnarray = [];
260 260
         foreach ($serverHandles as $oneDbServer) {
Please login to merge, or discard this patch.
core/DeviceConfig.php 2 patches
Indentation   -2 removed lines patch added patch discarded remove patch
@@ -106,7 +106,6 @@  discard block
 block discarded – undo
106 106
      * ["my.server.name"] => "my.server.name"
107 107
      * ["foo.bar.de", "baz.bar.ge"] => "e"
108 108
      * ["server1.example.com", "server2.example.com", "serverN.example.com"] => ".example.com"
109
-
110 109
      * @return string
111 110
      */
112 111
     public function longestNameSuffix() {
@@ -340,7 +339,6 @@  discard block
 block discarded – undo
340 339
      * 
341 340
      * @param string $format only "der" and "pem" are currently allowed
342 341
      * @return array an array of arrays or empty array on error
343
-
344 342
      */
345 343
     final protected function saveCertificateFiles($format) {
346 344
         switch ($format) {
Please login to merge, or discard this patch.
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
      */
84 84
     protected function setSupportedEapMethods($eapArray) {
85 85
         $this->supportedEapMethods = $eapArray;
86
-        $this->loggerInstance->debug(4, "This device (" . __CLASS__ . ") supports the following EAP methods: ");
86
+        $this->loggerInstance->debug(4, "This device (".__CLASS__.") supports the following EAP methods: ");
87 87
         $this->loggerInstance->debug(4, $this->supportedEapMethods);
88 88
     }
89 89
 
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
                     break 2;
134 134
                 }
135 135
             }
136
-            $longestSuffix = $candidate . $longestSuffix;
136
+            $longestSuffix = $candidate.$longestSuffix;
137 137
         }
138 138
         return $longestSuffix;
139 139
     }
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
             throw new Exception("No EAP type available.");
170 170
         }
171 171
         $this->attributes = $this->getProfileAttributes($profile);
172
-        $this->deviceUUID = common\Entity::uuid('', 'CAT' . $profile->institution . "-" . $profile->identifier . "-" . $this->device_id);
172
+        $this->deviceUUID = common\Entity::uuid('', 'CAT'.$profile->institution."-".$profile->identifier."-".$this->device_id);
173 173
 
174 174
 
175 175
         // if we are instantiating a Silverbullet profile AND have been given
@@ -193,8 +193,8 @@  discard block
 block discarded – undo
193 193
         // create temporary directory, its full path will be saved in $this->FPATH;
194 194
         $tempDir = $this->createTemporaryDirectory($purpose);
195 195
         $this->FPATH = $tempDir['dir'];
196
-        mkdir($tempDir['dir'] . '/tmp');
197
-        chdir($tempDir['dir'] . '/tmp');
196
+        mkdir($tempDir['dir'].'/tmp');
197
+        chdir($tempDir['dir'].'/tmp');
198 198
         $caList = [];
199 199
         $x509 = new \core\common\X509();
200 200
         if (isset($this->attributes['eap:ca_file'])) {
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
         $this->support_url_substitute = sprintf(_("your local %s support page"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']);
231 231
 
232 232
         if ($this->signer && $this->options['sign']) {
233
-            $this->sign = ROOT . '/signer/' . $this->signer;
233
+            $this->sign = ROOT.'/signer/'.$this->signer;
234 234
         }
235 235
         $this->installerBasename = $this->getInstallerBasename();
236 236
         common\Entity::outOfThePotatoes();
@@ -286,10 +286,10 @@  discard block
 block discarded – undo
286 286
      * @return string|boolean the filename as found, with path, or FALSE if it does not exist
287 287
      */
288 288
     protected function findSourceFile($file) {
289
-        if (is_file($this->module_path . '/Files/' . $this->device_id . '/' . $file)) {
290
-            return $this->module_path . '/Files/' . $this->device_id . '/' . $file;
291
-        } elseif (is_file($this->module_path . '/Files/' . $file)) {
292
-            return $this->module_path . '/Files/' . $file;
289
+        if (is_file($this->module_path.'/Files/'.$this->device_id.'/'.$file)) {
290
+            return $this->module_path.'/Files/'.$this->device_id.'/'.$file;
291
+        } elseif (is_file($this->module_path.'/Files/'.$file)) {
292
+            return $this->module_path.'/Files/'.$file;
293 293
         } else {
294 294
             $this->loggerInstance->debug(2, "requested file $file does not exist\n");
295 295
             return FALSE;
@@ -410,17 +410,17 @@  discard block
 block discarded – undo
410 410
      */
411 411
     private function getInstallerBasename() {
412 412
 
413
-        $baseName = $this->customTranslit(CONFIG_CONFASSISTANT['CONSORTIUM']['name']) . "-" . $this->getDeviceId();
413
+        $baseName = $this->customTranslit(CONFIG_CONFASSISTANT['CONSORTIUM']['name'])."-".$this->getDeviceId();
414 414
         if (isset($this->attributes['profile:customsuffix'][1])) {
415 415
             // this string will end up as a filename on a filesystem, so always
416 416
             // take a latin-based language variant if available
417 417
             // and then scrub non-ASCII just in case
418
-            return $baseName . $this->customTranslit($this->attributes['profile:customsuffix'][1]);
418
+            return $baseName.$this->customTranslit($this->attributes['profile:customsuffix'][1]);
419 419
         }
420 420
         // Okay, no custom suffix. 
421 421
         // Use the configured inst name and apply shortening heuristics
422 422
         $lang_pointer = CONFIG['LANGUAGES'][$this->languageInstance->getLang()]['latin_based'] == TRUE ? 0 : 1;
423
-        $this->loggerInstance->debug(5, "getInstallerBasename1:" . $this->attributes['general:instname'][$lang_pointer] . "\n");
423
+        $this->loggerInstance->debug(5, "getInstallerBasename1:".$this->attributes['general:instname'][$lang_pointer]."\n");
424 424
         $inst = $this->customTranslit($this->attributes['general:instname'][$lang_pointer]);
425 425
         $this->loggerInstance->debug(4, "getInstallerBasename2:$inst\n");
426 426
         $Inst_a = explode('_', $inst);
@@ -435,10 +435,10 @@  discard block
 block discarded – undo
435 435
             if (!empty($this->attributes['profile:name']) && !empty($this->attributes['profile:name'][$lang_pointer])) {
436 436
                 $profTemp = $this->customTranslit($this->attributes['profile:name'][$lang_pointer]);
437 437
                 $prof = preg_replace('/_+$/', '', $profTemp);
438
-                return $baseName . $inst . '-' . $prof;
438
+                return $baseName.$inst.'-'.$prof;
439 439
             }
440 440
         }
441
-        return $baseName . $inst;
441
+        return $baseName.$inst;
442 442
     }
443 443
 
444 444
     /**
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
                 $ext = 'unsupported';
552 552
             }
553 553
             $this->loggerInstance->debug(5, "saveLogoFile: $mime : $ext\n");
554
-            $fileName = 'logo-' . $type . $iterator . '.' . $ext;
554
+            $fileName = 'logo-'.$type.$iterator.'.'.$ext;
555 555
             $fileHandle = fopen($fileName, "w");
556 556
             if (!$fileHandle) {
557 557
                 $this->loggerInstance->debug(2, "saveLogoFile failed for: $fileName\n");
@@ -577,13 +577,13 @@  discard block
 block discarded – undo
577 577
         $mime = $finfo->buffer($blob);
578 578
         $ext = isset($this->mime_extensions[$mime]) ? $this->mime_extensions[$mime] : 'usupported';
579 579
         $this->loggerInstance->debug(5, "saveInfoFile: $mime : $ext\n");
580
-        $fileHandle = fopen('local-info.' . $ext, "w");
580
+        $fileHandle = fopen('local-info.'.$ext, "w");
581 581
         if ($fileHandle === FALSE) {
582 582
             throw new Exception("problem opening the file");
583 583
         }
584 584
         fwrite($fileHandle, $blob);
585 585
         fclose($fileHandle);
586
-        return(['name' => 'local-info.' . $ext, 'mime' => $ext]);
586
+        return(['name' => 'local-info.'.$ext, 'mime' => $ext]);
587 587
     }
588 588
 
589 589
     /**
@@ -634,9 +634,9 @@  discard block
 block discarded – undo
634 634
     protected function determineOuterIdString() {
635 635
         $outerId = NULL;
636 636
         if (isset($this->attributes['internal:use_anon_outer']) && $this->attributes['internal:use_anon_outer'][0] == "1" && isset($this->attributes['internal:realm'])) {
637
-            $outerId = "@" . $this->attributes['internal:realm'][0];
637
+            $outerId = "@".$this->attributes['internal:realm'][0];
638 638
             if (isset($this->attributes['internal:anon_local_value'])) {
639
-                $outerId = $this->attributes['internal:anon_local_value'][0] . $outerId;
639
+                $outerId = $this->attributes['internal:anon_local_value'][0].$outerId;
640 640
             }
641 641
         }
642 642
         return $outerId;
Please login to merge, or discard this patch.
web/admin/overview_user.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 
22 22
 namespace core;
23 23
 
24
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
24
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
25 25
 
26 26
 $instMgmt = new \core\UserManagement();
27 27
 $deco = new \web\lib\admin\PageDecoration();
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 <?php echo $uiElements->infoblock($user->getAttributes(), "user", "User"); ?>
52 52
             <tr>
53 53
                 <td>
54
-<?php echo "" . _("Unique Identifier") ?>
54
+<?php echo ""._("Unique Identifier") ?>
55 55
                 </td>
56 56
                 <td>
57 57
                 </td>
@@ -64,14 +64,14 @@  discard block
 block discarded – undo
64 64
     <div>
65 65
         <?php
66 66
         if (CONFIG['DB']['USER']['readonly'] === FALSE) {
67
-            echo "<a href='edit_user.php'><button>" . _("Edit User Details") . "</button></a>";
67
+            echo "<a href='edit_user.php'><button>"._("Edit User Details")."</button></a>";
68 68
         }
69 69
 
70 70
         if ($user->isFederationAdmin()) {
71
-            echo "<form action='overview_federation.php' method='GET' accept-charset='UTF-8'><button type='submit'>" . sprintf(_('Click here for %s management tasks'), $uiElements->nomenclatureFed) . "</button></form>";
71
+            echo "<form action='overview_federation.php' method='GET' accept-charset='UTF-8'><button type='submit'>".sprintf(_('Click here for %s management tasks'), $uiElements->nomenclatureFed)."</button></form>";
72 72
         }
73 73
         if ($user->isSuperadmin()) {
74
-            echo "<form action='112365365321.php' method='GET' accept-charset='UTF-8'><button type='submit'>" . _('Click here to access the superadmin page') . "</button></form>";
74
+            echo "<form action='112365365321.php' method='GET' accept-charset='UTF-8'><button type='submit'>"._('Click here to access the superadmin page')."</button></form>";
75 75
         }
76 76
         ?>
77 77
     </div>
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         if (CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_SILVERBULLET'] == "LOCAL") {
84 84
             $target = "https://wiki.geant.org/x/6Zg7Bw"; // Managed IdP manual
85 85
         }
86
-        $helptext = "<h3 style='display:inline;'>" . sprintf(_("(Need help? Refer to the <a href='%s'>%s administrator manual</a>)"), $target, $uiElements->nomenclatureInst) . "</h3>";
86
+        $helptext = "<h3 style='display:inline;'>".sprintf(_("(Need help? Refer to the <a href='%s'>%s administrator manual</a>)"), $target, $uiElements->nomenclatureInst)."</h3>";
87 87
     } else {
88 88
         $helptext = "";
89 89
     }
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
         // we need to run the Federation constructor
93 93
         $cat = new \core\CAT;
94 94
         /// first parameter: number of Identity Providers; second param is the literal configured term for 'Identity Provider' (you may or may not be able to add a plural suffix for your locale)
95
-        echo "<h2>" . sprintf(ngettext("You are managing the following <span style='display:none'>%d </span>%s:", "You are managing the following <strong>%d</strong> %s:", sizeof($hasInst)), sizeof($hasInst), $uiElements->nomenclatureInst) . "</h2>";
95
+        echo "<h2>".sprintf(ngettext("You are managing the following <span style='display:none'>%d </span>%s:", "You are managing the following <strong>%d</strong> %s:", sizeof($hasInst)), sizeof($hasInst), $uiElements->nomenclatureInst)."</h2>";
96 96
         $instlist = [];
97 97
         $my_idps = [];
98 98
         $myFeds = [];
@@ -114,10 +114,10 @@  discard block
 block discarded – undo
114 114
             $country[$key] = $row['country'];
115 115
             $name[$key] = $row['name'];
116 116
         }
117
-        echo "<tr><th>" . sprintf(_("%s Name"), $uiElements->nomenclatureInst) . "</th><th>" . sprintf(_("Other admins of this %s"), $uiElements->nomenclatureInst) . "</th><th>" . ( CONFIG['DB']['INST']['readonly'] === FALSE ? _("Administrator Management") : "") . "</th></tr>";
117
+        echo "<tr><th>".sprintf(_("%s Name"), $uiElements->nomenclatureInst)."</th><th>".sprintf(_("Other admins of this %s"), $uiElements->nomenclatureInst)."</th><th>".(CONFIG['DB']['INST']['readonly'] === FALSE ? _("Administrator Management") : "")."</th></tr>";
118 118
         foreach ($myFeds as $fed_id => $fed_name) {
119 119
             /// nomenclature 'fed', fed name, nomenclature 'inst'
120
-            echo "<tr><td colspan='3'><strong>" . sprintf(_("%s %s: %s list"), $uiElements->nomenclatureFed, $fed_name, $uiElements->nomenclatureInst) . "</strong></td></tr>";
120
+            echo "<tr><td colspan='3'><strong>".sprintf(_("%s %s: %s list"), $uiElements->nomenclatureFed, $fed_name, $uiElements->nomenclatureInst)."</strong></td></tr>";
121 121
 
122 122
             $fed_idps = $my_idps[$fed_id];
123 123
             asort($fed_idps);
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
                 $oneinst = $instlist[$index];
126 126
                 $the_inst = $oneinst['object'];
127 127
 
128
-                echo "<tr><td><a href='overview_idp.php?inst_id=$the_inst->identifier'>" . $oneinst['name'] . "</a></td><td>";
128
+                echo "<tr><td><a href='overview_idp.php?inst_id=$the_inst->identifier'>".$oneinst['name']."</a></td><td>";
129 129
                 echo "<input type='hidden' name='inst' value='$the_inst->identifier'>";
130 130
                 $admins = $the_inst->listOwners();
131 131
                 $blessedUser = FALSE;
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
                         $coadmin = new \core\User($username['ID']);
135 135
                         $coadmin_name = $coadmin->getAttributes('user:realname');
136 136
                         if (count($coadmin_name) > 0) {
137
-                            echo $coadmin_name[0]['value'] . "<br/>";
137
+                            echo $coadmin_name[0]['value']."<br/>";
138 138
                             unset($admins[$number]);
139 139
                         }
140 140
                     } else { // don't list self
@@ -146,29 +146,29 @@  discard block
 block discarded – undo
146 146
                 }
147 147
                 $otherAdminCount = count($admins); // only the unnamed remain
148 148
                 if ($otherAdminCount > 0) {
149
-                    echo sprintf(ngettext("%d other user", "%d other users", $otherAdminCount),$otherAdminCount);
149
+                    echo sprintf(ngettext("%d other user", "%d other users", $otherAdminCount), $otherAdminCount);
150 150
                 }
151 151
                 echo "</td><td>";
152 152
                 if ($blessedUser && CONFIG['DB']['INST']['readonly'] === FALSE) {
153
-                    echo "<div style='white-space: nowrap;'><form method='post' action='inc/manageAdmins.inc.php?inst_id=" . $the_inst->identifier . "' onsubmit='popupRedirectWindow(this); return false;' accept-charset='UTF-8'><button type='submit'>" . _("Add/Remove Administrators") . "</button></form></div>";
153
+                    echo "<div style='white-space: nowrap;'><form method='post' action='inc/manageAdmins.inc.php?inst_id=".$the_inst->identifier."' onsubmit='popupRedirectWindow(this); return false;' accept-charset='UTF-8'><button type='submit'>"._("Add/Remove Administrators")."</button></form></div>";
154 154
                 }
155 155
                 echo "</td></tr>";
156 156
             }
157 157
         }
158 158
         echo "</table>";
159 159
     } else {
160
-        echo "<h2>" . sprintf(_("You are not managing any %s."), $uiElements->nomenclatureInst) . "</h2>";
160
+        echo "<h2>".sprintf(_("You are not managing any %s."), $uiElements->nomenclatureInst)."</h2>";
161 161
     }
162 162
     if (CONFIG['DB']['INST']['readonly'] === FALSE) {
163 163
         if (CONFIG_CONFASSISTANT['CONSORTIUM']['selfservice_registration'] === NULL) {
164
-            echo "<p>" . sprintf(_("Please ask your %s administrator to invite you to become an %s administrator."), $uiElements->nomenclatureFed, $uiElements->nomenclatureInst) . "</p>";
164
+            echo "<p>".sprintf(_("Please ask your %s administrator to invite you to become an %s administrator."), $uiElements->nomenclatureFed, $uiElements->nomenclatureInst)."</p>";
165 165
             echo "<hr/>
166 166
              <div style='white-space: nowrap;'>
167 167
                 <form action='action_enrollment.php' method='get' accept-charset='UTF-8'>" .
168
-            sprintf(_("Did you receive an invitation token to manage an %s? Please paste it here:"), $uiElements->nomenclatureInst) .
168
+            sprintf(_("Did you receive an invitation token to manage an %s? Please paste it here:"), $uiElements->nomenclatureInst).
169 169
             "        <input type='text' id='token' name='token'/>
170 170
                     <button type='submit'>" .
171
-            _("Go!") . "
171
+            _("Go!")."
172 172
                     </button>
173 173
                 </form>
174 174
              </div>";
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
             <div style='white-space: nowrap;'>
178 178
         <form action='action_enrollment.php' method='get'><button type='submit' accept-charset='UTF-8'>
179 179
                 <input type='hidden' id='token' name='token' value='SELF-REGISTER'/>" .
180
-            sprintf(_("New %s Registration"), $uiElements->nomenclatureInst) . "
180
+            sprintf(_("New %s Registration"), $uiElements->nomenclatureInst)."
181 181
             </button>
182 182
         </form>
183 183
         </div>";
Please login to merge, or discard this patch.