@@ -150,7 +150,6 @@ discard block |
||
150 | 150 | * mails, just configure the signing cert with these parameters. All must |
151 | 151 | * be non-NULL for signing to happen. If you don't need a keypass, make |
152 | 152 | * it an empty string instead. |
153 | - |
|
154 | 153 | * @var array |
155 | 154 | */ |
156 | 155 | const MAILSETTINGS = [// we always use Submission |
@@ -163,8 +162,8 @@ discard block |
||
163 | 162 | 'keyfilename' => NULL, |
164 | 163 | 'keypass' => NULL, |
165 | 164 | 'notify_nro' => false, // normally should be set to TRUE abd causes |
166 | - // notifications being sent to NRO admins when |
|
167 | - // important changes are made |
|
165 | + // notifications being sent to NRO admins when |
|
166 | + // important changes are made |
|
168 | 167 | ]; |
169 | 168 | /** |
170 | 169 | * List of all supported languages in CAT. Comment some if you want to disable them |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | 'db' => 'cat', |
221 | 221 | 'user' => 'kitty', |
222 | 222 | 'pass' => 'somepass', |
223 | - 'readonly' => FALSE,], |
|
223 | + 'readonly' => FALSE, ], |
|
224 | 224 | // this DB stores diagnostics data. The connection details can be |
225 | 225 | // identical to INST as there is no table overlap |
226 | 226 | 'DIAGNOSTICS' => [ |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | 'db' => 'cat', |
229 | 229 | 'user' => 'kitty', |
230 | 230 | 'pass' => 'somepass', |
231 | - 'readonly' => FALSE,], |
|
231 | + 'readonly' => FALSE, ], |
|
232 | 232 | // this slice of DB user is about the downloads table. The corresponding |
233 | 233 | // DB user should have write access to update statistics and the cache |
234 | 234 | // locations of installers. |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | 'db' => 'cat', |
239 | 239 | 'user' => 'kitty', |
240 | 240 | 'pass' => 'somepass', |
241 | - 'readonly' => FALSE,], |
|
241 | + 'readonly' => FALSE, ], |
|
242 | 242 | // this slice of DB use is about user management in the user_options |
243 | 243 | // table. Giving the corresponding user only read-only access means that |
244 | 244 | // all user properties have to "magically" occur in the table by OOB |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | 'db' => 'cat', |
250 | 250 | 'user' => 'kitty', |
251 | 251 | 'pass' => 'somepass', |
252 | - 'readonly' => FALSE,], |
|
252 | + 'readonly' => FALSE, ], |
|
253 | 253 | /* If you use this tool in conjunction with an external customer management database, you can configure that every |
254 | 254 | * institution entry in CAT MUST correspond to a customer entry in an external database. If you want this, set this |
255 | 255 | * config variable to TRUE. |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | 'db' => 'customer_db', |
276 | 276 | 'user' => 'customerservice', |
277 | 277 | 'pass' => '2lame4u', |
278 | - 'readonly' => TRUE,], |
|
278 | + 'readonly' => TRUE, ], |
|
279 | 279 | /* |
280 | 280 | * EXTERNAL_SOURCE is the source only used in the caching script, if you |
281 | 281 | * do not use local caching then thse settins are irrelevant |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | 'db' => 'customer_db', |
286 | 286 | 'user' => 'customerservice', |
287 | 287 | 'pass' => '2lame4u', |
288 | - 'readonly' => TRUE,], |
|
288 | + 'readonly' => TRUE, ], |
|
289 | 289 | |
290 | 290 | |
291 | 291 |
@@ -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 | $result = $this->db->query("SET NAMES 'utf8'"); |
123 | 123 | $result = $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 | $result = $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 | } |