@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * update the local copy |
25 | 25 | */ |
26 | 26 | |
27 | -require_once dirname(dirname(__FILE__)) . "/config/_config.php"; |
|
27 | +require_once dirname(dirname(__FILE__))."/config/_config.php"; |
|
28 | 28 | setlocale(LC_CTYPE, "en_US.UTF-8"); |
29 | 29 | |
30 | 30 | class updateFromMonitor { |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | $tmp_table = 'tmp_'.$table_name; |
114 | 114 | if ($this->tablesource[$table_name] == 'eduroam') { |
115 | 115 | $this->db_local->select_db('monitor_copy'); |
116 | - } elseif($this->tablesource[$table_name] == 'eduroamv2') { |
|
116 | + } elseif ($this->tablesource[$table_name] == 'eduroamv2') { |
|
117 | 117 | $this->db_local->select_db('eduroamv2'); |
118 | 118 | } |
119 | 119 | $this->db_local->query("CREATE TEMPORARY TABLE $tmp_table SELECT * FROM $table LIMIT 0"); |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | $this->db->query("SET NAMES 'utf8'"); |
123 | 123 | $this->db_local->query("SET NAMES 'utf8mb4'"); |
124 | 124 | $result = $this->db->query("SELECT * FROM $table"); |
125 | - $queryFields = implode(',', array_column($this->fields[$table_name],0)); |
|
125 | + $queryFields = implode(',', array_column($this->fields[$table_name], 0)); |
|
126 | 126 | while ($row = $result->fetch_assoc()) { |
127 | 127 | $v = []; |
128 | 128 | foreach ($this->fields[$table_name] as $field) { |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | } |
141 | 141 | } |
142 | 142 | } |
143 | - $queryValues = implode(',',$v); |
|
143 | + $queryValues = implode(',', $v); |
|
144 | 144 | $query = "INSERT INTO $tmp_table (".$queryFields.") VALUES (".$queryValues.")"; |
145 | 145 | $this->db_local->query($query); |
146 | 146 | } |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | $tmp_table = 'tmp_'.$table_name; |
153 | 153 | if ($this->tablesource[$table_name] == 'eduroam') { |
154 | 154 | $this->db_local->select_db('monitor_copy'); |
155 | - } elseif($this->tablesource[$table_name] == 'eduroamv2') { |
|
155 | + } elseif ($this->tablesource[$table_name] == 'eduroamv2') { |
|
156 | 156 | $this->db_local->select_db('eduroamv2'); |
157 | 157 | } |
158 | 158 | $this->db_local->query("SET NAMES 'utf8mb4'"); |
@@ -161,9 +161,9 @@ discard block |
||
161 | 161 | } |
162 | 162 | |
163 | 163 | private function escape($inp) { |
164 | - $out=str_replace('\\','\\\\',$inp); |
|
165 | - $out=str_replace('"','\"',$out); |
|
166 | - $out=str_replace('?','\?',$out); |
|
164 | + $out = str_replace('\\', '\\\\', $inp); |
|
165 | + $out = str_replace('"', '\"', $out); |
|
166 | + $out = str_replace('?', '\?', $out); |
|
167 | 167 | $out = 'convert(cast(convert("'.$out.'" using latin1) as binary) using utf8)'; |
168 | 168 | return($out); |
169 | 169 | } |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | */ |
28 | 28 | ?> |
29 | 29 | <?php |
30 | -require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php"; |
|
30 | +require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php"; |
|
31 | 31 | $auth = new \web\lib\admin\Authentication(); |
32 | 32 | $deco = new \web\lib\admin\PageDecoration(); |
33 | 33 | $validator = new \web\lib\common\InputValidation(); |
@@ -105,10 +105,10 @@ discard block |
||
105 | 105 | $fed = $validator->existingFederation($_POST['NRO-list']); |
106 | 106 | $country = strtoupper($fed->tld); |
107 | 107 | $DN[] = "C=$country"; |
108 | - $DN[] = "O=NRO of " . iconv('UTF-8', 'ASCII//TRANSLIT', $cat->knownFederations[strtoupper($fed->tld)]); |
|
108 | + $DN[] = "O=NRO of ".iconv('UTF-8', 'ASCII//TRANSLIT', $cat->knownFederations[strtoupper($fed->tld)]); |
|
109 | 109 | $serverInfo = $externalDb->listExternalTlsServersFederation($fed->tld); |
110 | 110 | $serverList = explode(",", array_key_first($serverInfo)); |
111 | - $DN[] = "CN=" . $serverList[0]; |
|
111 | + $DN[] = "CN=".$serverList[0]; |
|
112 | 112 | $policies[] = "eduroam IdP"; |
113 | 113 | $policies[] = "eduroam SP"; |
114 | 114 | $firstName = $serverInfo[array_key_first($serverInfo)][0]["name"]; |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | } |
133 | 133 | $DN[] = "O=".iconv('UTF-8', 'ASCII//TRANSLIT', $ou); |
134 | 134 | $serverList = explode(",", $serverInfo["servers"]); |
135 | - $DN[] = "CN=" . $serverList[0]; |
|
135 | + $DN[] = "CN=".$serverList[0]; |
|
136 | 136 | switch ($serverInfo["type"]) { |
137 | 137 | case core\IdP::TYPE_IDPSP: |
138 | 138 | $policies[] = "eduroam IdP"; |
@@ -152,12 +152,12 @@ discard block |
||
152 | 152 | default: |
153 | 153 | throw new Exception("Sorry: Unknown level of issuance requested."); |
154 | 154 | } |
155 | - echo "<p style='font-size: large'>" . _("Requesting a certificate with the following properties"); |
|
155 | + echo "<p style='font-size: large'>"._("Requesting a certificate with the following properties"); |
|
156 | 156 | echo "<ul>"; |
157 | - echo "<li>" . _("Policy OIDs: ") . implode(", ", $policies) . "</li>"; |
|
158 | - echo "<li>" . _("Distinguished Name: ") . implode(", ", $DN) . "</li>"; |
|
159 | - echo "<li>" . _("subjectAltName:DNS : ") . implode(", ", $serverList) . "</li>"; |
|
160 | - echo "<li>" . _("Requester Contact Details: ") . $firstName . " <" . $firstMail . ">" . "</li>"; |
|
157 | + echo "<li>"._("Policy OIDs: ").implode(", ", $policies)."</li>"; |
|
158 | + echo "<li>"._("Distinguished Name: ").implode(", ", $DN)."</li>"; |
|
159 | + echo "<li>"._("subjectAltName:DNS : ").implode(", ", $serverList)."</li>"; |
|
160 | + echo "<li>"._("Requester Contact Details: ").$firstName." <".$firstMail.">"."</li>"; |
|
161 | 161 | echo "</ul></p>"; |
162 | 162 | |
163 | 163 | $vettedCsr = $validator->string($_POST['CSR'], true); |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | $loggerInstance->debug(2, $DN, "CERT DN: ", "\n"); |
174 | 174 | // our certs can be good for max 5 years |
175 | 175 | $fed->requestCertificate($user->identifier, $newCsrWithMeta, $expiryDays); |
176 | - echo "<p>" . _("The certificate was requested.") . "</p>"; |
|
176 | + echo "<p>"._("The certificate was requested.")."</p>"; |
|
177 | 177 | ?> |
178 | 178 | <form action="overview_certificates.php" method="GET"> |
179 | 179 | <button type="submit"><?php echo _("Back to Certificate Overview"); ?></button> |
@@ -191,23 +191,23 @@ discard block |
||
191 | 191 | switch (count($feds)) { |
192 | 192 | case 0: |
193 | 193 | echo "<div>"; |
194 | - echo $uiElements->boxRemark("<strong>" . sprintf(_("None of your %s servers has complete information in the database."),$uiElements->nomenclatureFed)."</strong>" . _("At least the DNS names of TLS servers and a role-based contact mail address are required.")); |
|
194 | + echo $uiElements->boxRemark("<strong>".sprintf(_("None of your %s servers has complete information in the database."), $uiElements->nomenclatureFed)."</strong>"._("At least the DNS names of TLS servers and a role-based contact mail address are required.")); |
|
195 | 195 | echo "</div>"; |
196 | 196 | break; |
197 | 197 | case 1: |
198 | - echo '<input type="radio" name="LEVEL" id="NRO" value="NRO" checked>' . sprintf(_("Certificate for %s") ." ", $uiElements->nomenclatureFed) . '</input>'; |
|
199 | - echo " <strong>" . $cat->knownFederations[$feds[0]->tld] . "</strong>"; |
|
200 | - echo '<input type="hidden" name="NRO-list" id="NRO-list" value="' . $feds[0]->tld . '"/>'; |
|
198 | + echo '<input type="radio" name="LEVEL" id="NRO" value="NRO" checked>'.sprintf(_("Certificate for %s")." ", $uiElements->nomenclatureFed).'</input>'; |
|
199 | + echo " <strong>".$cat->knownFederations[$feds[0]->tld]."</strong>"; |
|
200 | + echo '<input type="hidden" name="NRO-list" id="NRO-list" value="'.$feds[0]->tld.'"/>'; |
|
201 | 201 | break; |
202 | 202 | default: |
203 | - echo '<input type="radio" name="LEVEL" id="NRO" value="NRO" checked>' . sprintf(_("Certificate for %s") ." ", $uiElements->nomenclatureFed) . '</input>'; |
|
203 | + echo '<input type="radio" name="LEVEL" id="NRO" value="NRO" checked>'.sprintf(_("Certificate for %s")." ", $uiElements->nomenclatureFed).'</input>'; |
|
204 | 204 | ?> |
205 | 205 | <select name="NRO-list" id="NRO-list"> |
206 | 206 | <option value="notset"><?php echo _("---PLEASE CHOOSE---"); ?></option> |
207 | 207 | <?php |
208 | 208 | foreach ($feds as $oneFed) { |
209 | 209 | #echo '<option value="' . strtoupper($oneFed->tld) . '">' . $cat->knownFederations[$oneFed->tld] . "</option>"; |
210 | - echo '<option value="AAA' . strtoupper($oneFed->tld) . '">' . $oneIdP["names"][$langObject->getLang()] . "</option>"; |
|
210 | + echo '<option value="AAA'.strtoupper($oneFed->tld).'">'.$oneIdP["names"][$langObject->getLang()]."</option>"; |
|
211 | 211 | |
212 | 212 | } |
213 | 213 | ?> |
@@ -218,13 +218,13 @@ discard block |
||
218 | 218 | ?> |
219 | 219 | <script> |
220 | 220 | var instservers = []; |
221 | - var nroservers = '<?php echo str_replace(",", ", ", array_key_first($serverInfo));?>'; |
|
221 | + var nroservers = '<?php echo str_replace(",", ", ", array_key_first($serverInfo)); ?>'; |
|
222 | 222 | <?php |
223 | 223 | $allIdPs = []; |
224 | 224 | foreach ($allAuthorizedFeds as $oneFed) { |
225 | 225 | foreach ($externalDb->listExternalTlsServersInstitution($oneFed['value']) as $id => $oneIdP) { |
226 | - $allIdPs[$id] = '[' . substr($id, 0, 2) . '] ' . $oneIdP["names"][$langObject->getLang()]; |
|
227 | - echo "instservers['" . $id . "']='" . str_replace(",", ", ", $oneIdP["servers"]) . "';\n"; |
|
226 | + $allIdPs[$id] = '['.substr($id, 0, 2).'] '.$oneIdP["names"][$langObject->getLang()]; |
|
227 | + echo "instservers['".$id."']='".str_replace(",", ", ", $oneIdP["servers"])."';\n"; |
|
228 | 228 | } |
229 | 229 | } |
230 | 230 | ?> |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | <option value="notset"><?php echo _("---PLEASE CHOOSE---"); ?></option> |
253 | 253 | <?php |
254 | 254 | foreach ($allIdPs as $id => $name) { |
255 | - echo '<option value="' . $id . '">' . $name . "</option>"; |
|
255 | + echo '<option value="'.$id.'">'.$name."</option>"; |
|
256 | 256 | } |
257 | 257 | ?> |
258 | 258 | </select> |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | <?php |
262 | 262 | echo _('According to the above settings you will receive') |
263 | 263 | ?> |
264 | - <span id='certlevel'><?php echo _('NRO level certificate');?></span> |
|
264 | + <span id='certlevel'><?php echo _('NRO level certificate'); ?></span> |
|
265 | 265 | |
266 | 266 | </span>for server names: |
267 | 267 | <span id='serversinfo'><?php echo str_replace(",", ", ", array_key_first($serverInfo)); ?></span> |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | <?php |
270 | 270 | } else { |
271 | 271 | echo "<div>"; |
272 | - echo $uiElements->boxRemark(sprintf(_("<strong>No organisation inside your %s has complete information in the database</strong>."." "._("At least the DNS names of TLS servers and a role-based contact mail address are required.")),$uiElements->nomenclatureFed), "No TLS capable org!", true); |
|
272 | + echo $uiElements->boxRemark(sprintf(_("<strong>No organisation inside your %s has complete information in the database</strong>."." "._("At least the DNS names of TLS servers and a role-based contact mail address are required.")), $uiElements->nomenclatureFed), "No TLS capable org!", true); |
|
273 | 273 | echo "</div>"; |
274 | 274 | } |
275 | 275 | ?> |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | <h2><?php echo _("2. CSR generation"); ?></h2> |
280 | 280 | <p><?php echo _("One way to generate an acceptable certificate request is via this openssl one-liner:"); ?></p> |
281 | 281 | <?php |
282 | - echo "openssl req -new -newkey rsa:4096 -out test.csr -keyout test.key -subj /". implode('/', array_reverse($DN)) ."/C=XY/O=WillBeReplaced/CN=will.be.replaced"; |
|
282 | + echo "openssl req -new -newkey rsa:4096 -out test.csr -keyout test.key -subj /".implode('/', array_reverse($DN))."/C=XY/O=WillBeReplaced/CN=will.be.replaced"; |
|
283 | 283 | ?> |
284 | 284 | <h2><?php echo _("3. Submission"); ?></h2> |
285 | 285 | <?php echo _("Please paste your CSR here:"); ?><br/><textarea name="CSR" id="CSR" rows="20" cols="85"/></textarea><br/> |
@@ -62,24 +62,24 @@ discard block |
||
62 | 62 | case "EXTERNAL": |
63 | 63 | case "FRONTEND": |
64 | 64 | case "DIAGNOSTICS": |
65 | - if (!isset(self::${"instance" . $theDb})) { |
|
65 | + if (!isset(self::${"instance".$theDb})) { |
|
66 | 66 | $class = __CLASS__; |
67 | - self::${"instance" . $theDb} = new $class($database); |
|
68 | - DBConnection::${"instance" . $theDb}->databaseInstance = $theDb; |
|
67 | + self::${"instance".$theDb} = new $class($database); |
|
68 | + DBConnection::${"instance".$theDb}->databaseInstance = $theDb; |
|
69 | 69 | } |
70 | - return self::${"instance" . $theDb}; |
|
70 | + return self::${"instance".$theDb}; |
|
71 | 71 | case "RADIUS": |
72 | - if (!isset(self::${"instance" . $theDb})) { |
|
72 | + if (!isset(self::${"instance".$theDb})) { |
|
73 | 73 | $class = __CLASS__; |
74 | 74 | foreach (\config\ConfAssistant::DB as $name => $oneRadiusAuthDb) { |
75 | 75 | $theInstance = new $class($name); |
76 | - self::${"instance" . $theDb}[] = $theInstance; |
|
76 | + self::${"instance".$theDb}[] = $theInstance; |
|
77 | 77 | $theInstance->databaseInstance = $theDb; |
78 | 78 | } |
79 | 79 | } |
80 | - return self::${"instance" . $theDb}; |
|
80 | + return self::${"instance".$theDb}; |
|
81 | 81 | default: |
82 | - throw new Exception("This type of database (" . strtoupper($database) . ") is not known!"); |
|
82 | + throw new Exception("This type of database (".strtoupper($database).") is not known!"); |
|
83 | 83 | } |
84 | 84 | } |
85 | 85 | |
@@ -121,18 +121,18 @@ discard block |
||
121 | 121 | } |
122 | 122 | } |
123 | 123 | // log exact query to debug log, if log level is at 5 |
124 | - $this->loggerInstance->debug(5, "DB ATTEMPT: ".$this->databaseInstance .": " . $querystring . "\n"); |
|
124 | + $this->loggerInstance->debug(5, "DB ATTEMPT: ".$this->databaseInstance.": ".$querystring."\n"); |
|
125 | 125 | if ($types !== NULL) { |
126 | - $this->loggerInstance->debug(5, "Argument type sequence: $types, parameters are: " . /** @scrutinizer ignore-type */ print_r($arguments, true)); |
|
126 | + $this->loggerInstance->debug(5, "Argument type sequence: $types, parameters are: "./** @scrutinizer ignore-type */ print_r($arguments, true)); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | if ($this->connection->connect_error) { |
130 | - throw new Exception("ERROR: Cannot send query to $this->databaseInstance database (no connection, error number" . $this->connection->connect_error . ")!"); |
|
130 | + throw new Exception("ERROR: Cannot send query to $this->databaseInstance database (no connection, error number".$this->connection->connect_error.")!"); |
|
131 | 131 | } |
132 | 132 | if ($types === NULL) { |
133 | 133 | $result = $this->connection->query($querystring); |
134 | 134 | if ($result === FALSE) { |
135 | - throw new Exception("DB: Unable to execute simple statement! Error was --> " . $this->connection->error . " <--"); |
|
135 | + throw new Exception("DB: Unable to execute simple statement! Error was --> ".$this->connection->error." <--"); |
|
136 | 136 | } |
137 | 137 | } else { |
138 | 138 | // fancy! prepared statement with dedicated argument list |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | } |
149 | 149 | $prepResult = $statementObject->prepare($querystring); |
150 | 150 | if ($prepResult === FALSE) { |
151 | - throw new Exception("DB: Unable to prepare statement! Statement was --> $querystring <--, error was --> " . $statementObject->error . " <--."); |
|
151 | + throw new Exception("DB: Unable to prepare statement! Statement was --> $querystring <--, error was --> ".$statementObject->error." <--."); |
|
152 | 152 | } |
153 | 153 | $this->preparedStatements[$querystring] = $statementObject; |
154 | 154 | } |
@@ -161,11 +161,11 @@ discard block |
||
161 | 161 | array_unshift($localArray, $types); |
162 | 162 | $retval = call_user_func_array([$statementObject, "bind_param"], $localArray); |
163 | 163 | if ($retval === FALSE) { |
164 | - throw new Exception("DB: Unable to bind parameters to prepared statement! Argument array was --> " . var_export($localArray, TRUE) . " <--. Error was --> " . $statementObject->error . " <--"); |
|
164 | + throw new Exception("DB: Unable to bind parameters to prepared statement! Argument array was --> ".var_export($localArray, TRUE)." <--. Error was --> ".$statementObject->error." <--"); |
|
165 | 165 | } |
166 | 166 | $result = $statementObject->execute(); |
167 | 167 | if ($result === FALSE) { |
168 | - throw new Exception("DB: Unable to execute prepared statement! Error was --> " . $statementObject->error . " <--"); |
|
168 | + throw new Exception("DB: Unable to execute prepared statement! Error was --> ".$statementObject->error." <--"); |
|
169 | 169 | } |
170 | 170 | $selectResult = $statementObject->get_result(); |
171 | 171 | if ($selectResult !== FALSE) { |
@@ -175,14 +175,14 @@ discard block |
||
175 | 175 | |
176 | 176 | // all cases where $result could be FALSE have been caught earlier |
177 | 177 | if ($this->connection->errno) { |
178 | - throw new Exception("ERROR: Cannot execute query in $this->databaseInstance database - (hopefully escaped) query was '$querystring', errno was " . $this->connection->errno . "!"); |
|
178 | + throw new Exception("ERROR: Cannot execute query in $this->databaseInstance database - (hopefully escaped) query was '$querystring', errno was ".$this->connection->errno."!"); |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | |
182 | 182 | if ($isMoreThanSelect || \config\Master::DEBUG_LEVEL == 5) { |
183 | - $this->loggerInstance->writeSQLAudit("[DB: " . strtoupper($this->databaseInstance) . "] " . $querystring); |
|
183 | + $this->loggerInstance->writeSQLAudit("[DB: ".strtoupper($this->databaseInstance)."] ".$querystring); |
|
184 | 184 | if ($types !== NULL) { |
185 | - $this->loggerInstance->writeSQLAudit("Argument type sequence: $types, parameters are: " . /** @scrutinizer ignore-type */ print_r($arguments, true)); |
|
185 | + $this->loggerInstance->writeSQLAudit("Argument type sequence: $types, parameters are: "./** @scrutinizer ignore-type */ print_r($arguments, true)); |
|
186 | 186 | } |
187 | 187 | } |
188 | 188 | return $result; |
@@ -280,13 +280,13 @@ discard block |
||
280 | 280 | if (isset(\config\Master::DB[$databaseCapitalised])) { |
281 | 281 | $this->connection = new \mysqli(\config\Master::DB[$databaseCapitalised]['host'], \config\Master::DB[$databaseCapitalised]['user'], \config\Master::DB[$databaseCapitalised]['pass'], \config\Master::DB[$databaseCapitalised]['db']); |
282 | 282 | if ($this->connection->connect_error) { |
283 | - throw new Exception("ERROR: Unable to connect to $database database! This is a fatal error, giving up (error number " . $this->connection->connect_errno . ")."); |
|
283 | + throw new Exception("ERROR: Unable to connect to $database database! This is a fatal error, giving up (error number ".$this->connection->connect_errno.")."); |
|
284 | 284 | } |
285 | 285 | $this->readOnly = \config\Master::DB[$databaseCapitalised]['readonly']; |
286 | 286 | } else { // one of the RADIUS DBs |
287 | 287 | $this->connection = new \mysqli(\config\ConfAssistant::DB[$databaseCapitalised]['host'], \config\ConfAssistant::DB[$databaseCapitalised]['user'], \config\ConfAssistant::DB[$databaseCapitalised]['pass'], \config\ConfAssistant::DB[$databaseCapitalised]['db']); |
288 | 288 | if ($this->connection->connect_error) { |
289 | - throw new Exception("ERROR: Unable to connect to $database database! This is a fatal error, giving up (error number " . $this->connection->connect_errno . ")."); |
|
289 | + throw new Exception("ERROR: Unable to connect to $database database! This is a fatal error, giving up (error number ".$this->connection->connect_errno.")."); |
|
290 | 290 | } |
291 | 291 | $this->readOnly = \config\ConfAssistant::DB[$databaseCapitalised]['readonly']; |
292 | 292 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | ?> |
31 | 31 | <?php |
32 | 32 | |
33 | -require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php"; |
|
33 | +require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php"; |
|
34 | 34 | |
35 | 35 | $auth = new \web\lib\admin\Authentication(); |
36 | 36 | $deco = new \web\lib\admin\PageDecoration(); |
@@ -41,11 +41,11 @@ discard block |
||
41 | 41 | $auth->authenticate(); |
42 | 42 | |
43 | 43 | if (!isset($_GET['token'])) { |
44 | - $elements->errorPage(_("Error creating new IdP binding!"),_("This page needs to be called with a valid invitation token!")); |
|
44 | + $elements->errorPage(_("Error creating new IdP binding!"), _("This page needs to be called with a valid invitation token!")); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | if (\config\ConfAssistant::CONSORTIUM['selfservice_registration'] === NULL && $_GET['token'] == "SELF-REGISTER") { |
48 | - $elements->errorPage(_("Error creating new IdP binding!"),_("You tried to register in self-service, but this deployment does not allow self-service!")); |
|
48 | + $elements->errorPage(_("Error creating new IdP binding!"), _("You tried to register in self-service, but this deployment does not allow self-service!")); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | switch ($_GET['token']) { |
@@ -55,23 +55,23 @@ discard block |
||
55 | 55 | $federation = \config\ConfAssistant::CONSORTIUM['selfservice_registration']; |
56 | 56 | break; |
57 | 57 | default: |
58 | - $tokenUnfiltered = $validator->token(filter_input(INPUT_GET,'token')); |
|
58 | + $tokenUnfiltered = $validator->token(filter_input(INPUT_GET, 'token')); |
|
59 | 59 | $token = htmlspecialchars(strip_tags($token)); |
60 | 60 | $checkval = $usermgmt->checkTokenValidity($token); |
61 | 61 | } |
62 | 62 | |
63 | 63 | if ($checkval < 0) { |
64 | 64 | echo $deco->pageheader(_("Error creating new IdP binding!"), "ADMIN-IDP"); |
65 | - echo "<h1>" . _("Error creating new IdP binding!") . "</h1>"; |
|
65 | + echo "<h1>"._("Error creating new IdP binding!")."</h1>"; |
|
66 | 66 | switch ($checkval) { |
67 | 67 | case \core\UserManagement::TOKENSTATUS_FAIL_ALREADYCONSUMED: |
68 | - echo "<p>" . sprintf(_("Sorry... this token has already been used. The %s is already created. If you got the invitation from a mailing list, probably someone else used it before you."), $elements->nomenclatureParticipant) . "</p>"; |
|
68 | + echo "<p>".sprintf(_("Sorry... this token has already been used. The %s is already created. If you got the invitation from a mailing list, probably someone else used it before you."), $elements->nomenclatureParticipant)."</p>"; |
|
69 | 69 | break; |
70 | 70 | case \core\UserManagement::TOKENSTATUS_FAIL_EXPIRED: |
71 | - echo "<p>" . sprintf(_("Sorry... this token has expired. Invitation tokens are valid for 24 hours. The %s administrator can create a new one for you."), $elements->nomenclatureFed) . "</p>"; |
|
71 | + echo "<p>".sprintf(_("Sorry... this token has expired. Invitation tokens are valid for 24 hours. The %s administrator can create a new one for you."), $elements->nomenclatureFed)."</p>"; |
|
72 | 72 | break; |
73 | 73 | default: |
74 | - echo "<p>" . _("Sorry... you have come to the enrollment page without a valid token. Are you a nasty person? If not, you should go to <a href='overview_user.php'>your profile page</a> instead.") . "</p>"; |
|
74 | + echo "<p>"._("Sorry... you have come to the enrollment page without a valid token. Are you a nasty person? If not, you should go to <a href='overview_user.php'>your profile page</a> instead.")."</p>"; |
|
75 | 75 | } |
76 | 76 | echo $deco->footer(); |
77 | 77 | throw new Exception("Terminating because something is wrong with the token we received."); |
@@ -86,12 +86,12 @@ discard block |
||
86 | 86 | case "SELF-REGISTER": |
87 | 87 | $fed = new \core\Federation($federation); |
88 | 88 | $newidp = new \core\IdP($fed->newIdP(core\IdP::TYPE_IDPSP, $user, "FED", "SELFSERVICE")); |
89 | - $loggerInstance->writeAudit($user, "MOD", "IdP " . $newidp->identifier . " - selfservice registration"); |
|
89 | + $loggerInstance->writeAudit($user, "MOD", "IdP ".$newidp->identifier." - selfservice registration"); |
|
90 | 90 | break; |
91 | 91 | default: |
92 | 92 | $newidp = $usermgmt->createIdPFromToken($token, $user); |
93 | 93 | $usermgmt->invalidateToken($token); |
94 | - $loggerInstance->writeAudit($user, "MOD", "IdP " . $newidp->identifier . " - Token used and invalidated"); |
|
94 | + $loggerInstance->writeAudit($user, "MOD", "IdP ".$newidp->identifier." - Token used and invalidated"); |
|
95 | 95 | break; |
96 | 96 | } |
97 | 97 |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | * <base_url>/copyright.php after deploying the software |
20 | 20 | */ |
21 | 21 | |
22 | -require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php"; |
|
22 | +require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php"; |
|
23 | 23 | $admin = filter_input(INPUT_GET, 'admin', FILTER_VALIDATE_INT); |
24 | 24 | $sp = filter_input(INPUT_GET, 'sp', FILTER_VALIDATE_INT); |
25 | 25 | $givenRealm = htmlspecialchars(strip_tags(filter_input(INPUT_GET, 'realm'))); |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | unset($q_el[$idx]); |
36 | 36 | $q_r = preg_replace("/\?.*/", "", $_SERVER['REQUEST_URI']); |
37 | 37 | if (count($q_el)) { |
38 | - $q_r = $q_r . '?' . implode('&', $q_el); |
|
38 | + $q_r = $q_r.'?'.implode('&', $q_el); |
|
39 | 39 | } |
40 | 40 | $_SERVER['REQUEST_URI'] = $q_r; |
41 | 41 | } |
@@ -44,11 +44,11 @@ discard block |
||
44 | 44 | $auth->authenticate(); |
45 | 45 | } |
46 | 46 | if (isset($_SESSION['admin_diag_auth'])) { |
47 | - $admin = 1; |
|
47 | + $admin = 1; |
|
48 | 48 | unset($_SESSION['admin_diag_auth']); |
49 | 49 | } |
50 | 50 | $Gui = new \web\lib\user\Gui(); |
51 | 51 | $skinObject = new \web\lib\user\Skinjob($_REQUEST['skin'] ?? $_SESSION['skin'] ?? $fedskin[0] ?? \config\Master::APPEARANCE['skins'][0]); |
52 | -require "../skins/" . $skinObject->skin . "/diag/diag.php"; |
|
52 | +require "../skins/".$skinObject->skin."/diag/diag.php"; |
|
53 | 53 | |
54 | 54 |
@@ -19,10 +19,10 @@ |
||
19 | 19 | * <base_url>/copyright.php after deploying the software |
20 | 20 | */ |
21 | 21 | |
22 | -require_once dirname(dirname(__DIR__)) . "/config/_config.php"; |
|
22 | +require_once dirname(dirname(__DIR__))."/config/_config.php"; |
|
23 | 23 | $realm = htmlspecialchars(strip_tags(filter_input(INPUT_GET, 'realm'))); |
24 | -$visited = htmlspecialchars(strip_tags(filter_input(INPUT_GET,'visited'))); |
|
25 | -$nro = htmlspecialchars(strip_tags(filter_input(INPUT_GET,'nro'))); |
|
24 | +$visited = htmlspecialchars(strip_tags(filter_input(INPUT_GET, 'visited'))); |
|
25 | +$nro = htmlspecialchars(strip_tags(filter_input(INPUT_GET, 'nro'))); |
|
26 | 26 | \core\CAT::sessionStart(); |
27 | 27 | $languageObject = new core\common\Language(); |
28 | 28 | $languageObject->setTextDomain("diagonstics"); |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | * <base_url>/copyright.php after deploying the software |
20 | 20 | */ |
21 | 21 | |
22 | -require_once dirname(dirname(__DIR__)) . "/config/_config.php"; |
|
22 | +require_once dirname(dirname(__DIR__))."/config/_config.php"; |
|
23 | 23 | |
24 | 24 | $therealm = htmlspecialchars(strip_tags(filter_input(INPUT_GET, 'realm'))); |
25 | 25 | $thevisited = htmlspecialchars(strip_tags(filter_input(INPUT_GET, 'visited'))); |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $validator = new \web\lib\common\InputValidation(); |
36 | 36 | |
37 | 37 | echo "<pre>"; |
38 | - echo "Testing " . $validatedRealm . " in " . $validator->string($thevisited); |
|
38 | + echo "Testing ".$validatedRealm." in ".$validator->string($thevisited); |
|
39 | 39 | print_r($telepath->magic()); |
40 | 40 | echo "</pre>"; |
41 | 41 | } |
42 | 42 | \ No newline at end of file |
@@ -73,17 +73,17 @@ discard block |
||
73 | 73 | $retval = "<div class='sidebar'><p>"; |
74 | 74 | $user = new \core\User($_SESSION['user']); |
75 | 75 | if ($advancedControls) { |
76 | - $retval .= "<strong>" . _("You are:") . "</strong> ".$_SESSION['name'] |
|
76 | + $retval .= "<strong>"._("You are:")."</strong> ".$_SESSION['name'] |
|
77 | 77 | ."<br/> |
78 | 78 | <br/>"; |
79 | 79 | if ($user->isFederationAdmin()) { |
80 | - $retval .= "<a href='" . \core\CAT::getRootUrlPath() . "/admin/overview_federation.php'>" . _("The NRO page") . "</a> "; |
|
80 | + $retval .= "<a href='".\core\CAT::getRootUrlPath()."/admin/overview_federation.php'>"._("The NRO page")."</a> "; |
|
81 | 81 | |
82 | 82 | } |
83 | - $retval .= "<a href='" . \core\CAT::getRootUrlPath() . "/admin/overview_user.php'>" . _("Go to your Profile page") . "</a> |
|
84 | - <a href='" . \core\CAT::getRootUrlPath() . "/admin/inc/logout.php'>" . _("Logout") . "</a> "; |
|
83 | + $retval .= "<a href='".\core\CAT::getRootUrlPath()."/admin/overview_user.php'>"._("Go to your Profile page")."</a> |
|
84 | + <a href='" . \core\CAT::getRootUrlPath()."/admin/inc/logout.php'>"._("Logout")."</a> "; |
|
85 | 85 | } |
86 | - $retval .= "<a href='" . \core\CAT::getRootUrlPath() . "/'>" . _("Start page") . "</a> |
|
86 | + $retval .= "<a href='".\core\CAT::getRootUrlPath()."/'>"._("Start page")."</a> |
|
87 | 87 | </p> |
88 | 88 | </div> <!-- sidebar -->"; |
89 | 89 | \core\common\Entity::outOfThePotatoes(); |
@@ -107,23 +107,23 @@ discard block |
||
107 | 107 | <h1>$cap1</h1> |
108 | 108 | </div><!--header_captions--> |
109 | 109 | <div id='langselection' style='padding-top:20px; padding-".$this->start.":10px;'> |
110 | - <form action='$place' method='GET' accept-charset='UTF-8'>" . _("View this page in") . " |
|
110 | + <form action='$place' method='GET' accept-charset='UTF-8'>"._("View this page in")." |
|
111 | 111 | <select id='lang' name='lang' onchange='this.form.submit()'>"; |
112 | 112 | |
113 | 113 | foreach (\config\Master::LANGUAGES as $lang => $getValue) { |
114 | - $retval .= "<option value='$lang' " . (strtoupper($language) == strtoupper($lang) ? "selected" : "" ) . " >" . $getValue['display'] . "</option> "; |
|
114 | + $retval .= "<option value='$lang' ".(strtoupper($language) == strtoupper($lang) ? "selected" : "")." >".$getValue['display']."</option> "; |
|
115 | 115 | } |
116 | 116 | $retval .= "</select>"; |
117 | 117 | |
118 | 118 | foreach ($_GET as $getVar => $getValue) { |
119 | 119 | $filterValue = htmlspecialchars(strip_tags(filter_input(INPUT_GET, $getVar))); |
120 | 120 | if ($getVar != "lang" && $getValue != "") { |
121 | - $retval .= "<input type='hidden' name='" . htmlspecialchars($getVar) . "' value='" . htmlspecialchars($filterValue) . "'>"; |
|
121 | + $retval .= "<input type='hidden' name='".htmlspecialchars($getVar)."' value='".htmlspecialchars($filterValue)."'>"; |
|
122 | 122 | } |
123 | 123 | } |
124 | 124 | $retval .= "</form> |
125 | 125 | </div><!--langselection-->"; |
126 | - $logoUrl = \core\CAT::getRootUrlPath() . "/resources/images/consortium_logo.png"; |
|
126 | + $logoUrl = \core\CAT::getRootUrlPath()."/resources/images/consortium_logo.png"; |
|
127 | 127 | $retval .= "<div class='consortium_logo'> |
128 | 128 | <img id='test_locate' src='$logoUrl' alt='Consortium Logo'> |
129 | 129 | </div> <!-- consortium_logo --> |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | |
217 | 217 | if (isset(\config\Master::APPEARANCE['MOTD']) && \config\Master::APPEARANCE['MOTD'] != "") { |
218 | 218 | $retval .= "<div id='header_MOTD' style='display:inline-block; padding-".$this->start.":20px;vertical-align:top;'> |
219 | - <p class='MOTD'>" . \config\Master::APPEARANCE['MOTD'] . "</p> |
|
219 | + <p class='MOTD'>" . \config\Master::APPEARANCE['MOTD']."</p> |
|
220 | 220 | </div><!--header_MOTD-->"; |
221 | 221 | } |
222 | 222 | $retval .= $this->sidebar($advancedControls); |
@@ -242,9 +242,9 @@ discard block |
||
242 | 242 | <html xmlns='http://www.w3.org/1999/xhtml' lang='$ourlocale'".($this->langObject->rtl ? "dir='rtl'" : "")."> |
243 | 243 | <head lang='$ourlocale'> |
244 | 244 | <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>"; |
245 | - $cssUrl = \core\CAT::getRootUrlPath() . "/resources/css/cat.css.php"; |
|
245 | + $cssUrl = \core\CAT::getRootUrlPath()."/resources/css/cat.css.php"; |
|
246 | 246 | $retval .= "<link rel='stylesheet' type='text/css' href='$cssUrl' />"; |
247 | - $retval .= "<title>" . htmlspecialchars($pagetitle) . "</title>"; |
|
247 | + $retval .= "<title>".htmlspecialchars($pagetitle)."</title>"; |
|
248 | 248 | return $retval; |
249 | 249 | } |
250 | 250 | |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | // we may need to jump up one dir if we are either in admin/ or accountstatus/ |
259 | 259 | // (accountstatus courtesy of my good mood. It's userspace not admin space so |
260 | 260 | // it shouldn't be using this function any more.) |
261 | - $logoBase = \core\CAT::getRootUrlPath() . "/resources/images"; |
|
261 | + $logoBase = \core\CAT::getRootUrlPath()."/resources/images"; |
|
262 | 262 | return "<span id='logos'><img src='$logoBase/dante.png' alt='DANTE' style='height:23px;width:47px'/> |
263 | 263 | <img src='$logoBase/eu.png' alt='EU' style='height:23px;width:27px;border-width:0px;'/></span> |
264 | 264 | <span id='eu_text' style='text-align:right;'><a href='http://ec.europa.eu/dgs/connect/index_en.htm' style='text-decoration:none; vertical-align:top;'>European Commission Communications Networks, Content and Technology</a></span>"; |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | * @author Stefan Winter <[email protected]> |
27 | 27 | * @package Core |
28 | 28 | */ |
29 | -require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php"; |
|
29 | +require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php"; |
|
30 | 30 | |
31 | 31 | $cleanToken = FALSE; |
32 | 32 | $invitationObject = new core\SilverbulletInvitation("INVALID"); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | |
75 | 75 | $statusInfo = ["token" => $cleanToken, |
76 | 76 | "invitation_object" => $invitationObject, |
77 | - "OS" => $Gui->operatingSystem,]; |
|
77 | + "OS" => $Gui->operatingSystem, ]; |
|
78 | 78 | |
79 | 79 | if ($profile !== NULL) { |
80 | 80 | $attributes = $Gui->profileAttributes($profile->identifier); |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $caAndSerial = htmlspecialchars(strip_tags($caAndSerialUnfiltered)); |
89 | 89 | |
90 | 90 | if ($action !== NULL && $action !== FALSE && $action === \web\lib\common\FormElements::BUTTON_DELETE && $caAndSerial !== NULL && $caAndSerial !== FALSE) { |
91 | - $tuple = explode(':',$caAndSerial); |
|
91 | + $tuple = explode(':', $caAndSerial); |
|
92 | 92 | $ca_type = $tuple[0]; |
93 | 93 | $serial = $tuple[1]; |
94 | 94 | if ($statusInfo['invitation_object']->invitationTokenStatus != \core\SilverbulletInvitation::SB_TOKENSTATUS_INVALID) { |
@@ -103,12 +103,12 @@ discard block |
||
103 | 103 | print "//REVOKING\n"; |
104 | 104 | $certObject = new \core\SilverbulletCertificate($serial, $ca_type); |
105 | 105 | $certObject->revokeCertificate(); |
106 | - header("Location: accountstatus.php?token=" . $statusInfo['token']); |
|
106 | + header("Location: accountstatus.php?token=".$statusInfo['token']); |
|
107 | 107 | exit; |
108 | 108 | } |
109 | 109 | } |
110 | 110 | } |
111 | - header("Location: accountstatus.php?token=" . $statusInfo['token']); |
|
111 | + header("Location: accountstatus.php?token=".$statusInfo['token']); |
|
112 | 112 | exit; |
113 | 113 | } |
114 | 114 | |
@@ -133,4 +133,4 @@ discard block |
||
133 | 133 | $skinObject = new \web\lib\user\Skinjob($_REQUEST['skin'] ?? $_SESSION['skin'] ?? $fedskin[0] ?? \config\Master::APPEARANCE['skins'][0]); |
134 | 134 | |
135 | 135 | // and now, serve actual data |
136 | -require "../skins/" . $skinObject->skin . "/accountstatus/accountstatus.php"; |
|
136 | +require "../skins/".$skinObject->skin."/accountstatus/accountstatus.php"; |