@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | */ |
34 | 34 | public static function logRotate(): void |
35 | 35 | { |
36 | - $log_dir = System::getLogDir() . '/nats'; |
|
36 | + $log_dir = System::getLogDir().'/nats'; |
|
37 | 37 | $gnatsdPath = Util::which('gnatsd'); |
38 | 38 | $pid = Util::getPidOfProcess($gnatsdPath, 'custom_modules'); |
39 | 39 | $max_size = 1; |
@@ -62,13 +62,13 @@ discard block |
||
62 | 62 | if (Util::mFileSize("{$log_dir}/gnatsd.log") > $mb10) { |
63 | 63 | $options = '-f'; |
64 | 64 | } |
65 | - $di = Di::getDefault(); |
|
66 | - if ($di !== null){ |
|
65 | + $di = Di::getDefault(); |
|
66 | + if ($di !== null) { |
|
67 | 67 | $varEtcDir = $di->getShared('config')->path('core.varEtcDir'); |
68 | 68 | } else { |
69 | 69 | $varEtcDir = '/var/etc'; |
70 | 70 | } |
71 | - $path_conf = $varEtcDir . '/gnatsd_logrotate.conf'; |
|
71 | + $path_conf = $varEtcDir.'/gnatsd_logrotate.conf'; |
|
72 | 72 | file_put_contents($path_conf, $text_config); |
73 | 73 | if (file_exists("{$log_dir}/gnatsd.log")) { |
74 | 74 | $logrotatePath = Util::which('logrotate'); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | $confdir = '/etc/nats'; |
85 | 85 | Util::mwMkdir($confdir); |
86 | 86 | |
87 | - $logdir = System::getLogDir() . '/nats'; |
|
87 | + $logdir = System::getLogDir().'/nats'; |
|
88 | 88 | Util::mwMkdir($logdir); |
89 | 89 | |
90 | 90 | $tempDir = $this->di->getShared('config')->path('core.tempDir'); |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | 'sessions_path' => $sessionsDir, |
106 | 106 | 'log_file' => "{$logdir}/gnatsd.log", |
107 | 107 | ]; |
108 | - $config = ''; |
|
108 | + $config = ''; |
|
109 | 109 | foreach ($settings as $key => $val) { |
110 | 110 | $config .= "{$key}: {$val} \n"; |
111 | 111 | } |
@@ -91,7 +91,7 @@ |
||
91 | 91 | $offset_prefix = $offset < 0 ? '-' : '+'; |
92 | 92 | $offset_formatted = gmdate('H:i', $offset); |
93 | 93 | |
94 | - $pretty_offset = "UTC${offset_prefix}${offset_formatted}"; |
|
94 | + $pretty_offset = "utc${offset_prefix}${offset_formatted}"; |
|
95 | 95 | |
96 | 96 | $timezone_list[$timezone] = "$timezone (${pretty_offset})"; |
97 | 97 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $timezone_offsets = []; |
77 | 77 | foreach ($timezones as $timezone) { |
78 | 78 | $tz = new DateTimeZone($timezone); |
79 | - $timezone_offsets[$timezone] = (int)$tz->getOffset(new DateTime()); |
|
79 | + $timezone_offsets[$timezone] = (int) $tz->getOffset(new DateTime()); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | // sort timezone by offset |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | */ |
101 | 101 | public function saveAction() |
102 | 102 | { |
103 | - if ( ! $this->request->isPost()) { |
|
103 | + if (!$this->request->isPost()) { |
|
104 | 104 | return; |
105 | 105 | } |
106 | 106 | |
@@ -122,12 +122,12 @@ discard block |
||
122 | 122 | break; |
123 | 123 | case "NTPServer": |
124 | 124 | $ntp_servers = preg_split('/\r\n|\r|\n| |,/', $data[$key]); |
125 | - if (is_array($ntp_servers)){ |
|
125 | + if (is_array($ntp_servers)) { |
|
126 | 126 | $record->value = implode(PHP_EOL, $ntp_servers); |
127 | 127 | } |
128 | 128 | break; |
129 | 129 | default: |
130 | - if ( ! array_key_exists($key, $data)) { |
|
130 | + if (!array_key_exists($key, $data)) { |
|
131 | 131 | continue 2; |
132 | 132 | } |
133 | 133 | $record->value = $data[$key]; |
@@ -22,6 +22,6 @@ |
||
22 | 22 | |
23 | 23 | // Перестрахова на случай с перехватом звонка через *8. |
24 | 24 | $timeoutChannel = $am->GetVar($srcChannel, 'MASTER_CHANNEL(M_TIMEOUT_CHANNEL)', null, false); |
25 | -if(is_string($timeoutChannel) && !empty($timeoutChannel)){ |
|
25 | +if (is_string($timeoutChannel) && !empty($timeoutChannel)) { |
|
26 | 26 | $am->SetVar($timeoutChannel, "TIMEOUT(absolute)", '0'); |
27 | 27 | } |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | private array $queue = []; |
17 | 17 | private int $starting_point = 0; |
18 | 18 | private int $interval = 28800; |
19 | - protected int $maxProc=1; |
|
19 | + protected int $maxProc = 1; |
|
20 | 20 | |
21 | 21 | /** |
22 | 22 | * Наполняем очередь уведомлениями. |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | continue; |
68 | 68 | } |
69 | 69 | if (Util::isJson($text_error)) { |
70 | - $data = json_decode($text_error, true); |
|
70 | + $data = json_decode($text_error, true); |
|
71 | 71 | $test_email .= "<hr>"; |
72 | 72 | $test_email .= "{$section}"; |
73 | 73 | $test_email .= "<hr>"; |
@@ -36,10 +36,10 @@ discard block |
||
36 | 36 | $localAddresses[] = $calculator->cidr2network( |
37 | 37 | $interface->ipaddr, |
38 | 38 | $interface->subnet |
39 | - ) . '/' . $interface->subnet; |
|
39 | + ).'/'.$interface->subnet; |
|
40 | 40 | } else { |
41 | 41 | $cidr = $calculator->netmask2cidr($interface->subnet); |
42 | - $localAddresses[] = $calculator->cidr2network($interface->ipaddr, $cidr) . '/' . $cidr; |
|
42 | + $localAddresses[] = $calculator->cidr2network($interface->ipaddr, $cidr).'/'.$cidr; |
|
43 | 43 | } |
44 | 44 | } |
45 | 45 | |
@@ -57,13 +57,13 @@ discard block |
||
57 | 57 | $networksTable[$filter->id]['network'] = $calculator->cidr2network( |
58 | 58 | $permitParts[0], |
59 | 59 | $permitParts[1] |
60 | - ) . '/' . $permitParts[1]; |
|
60 | + ).'/'.$permitParts[1]; |
|
61 | 61 | } else { |
62 | 62 | $cidr = $calculator->netmask2cidr($permitParts[1]); |
63 | 63 | $networksTable[$filter->id]['network'] = $calculator->cidr2network( |
64 | 64 | $permitParts[0], |
65 | 65 | $cidr |
66 | - ) . '/' . $cidr; |
|
66 | + ).'/'.$cidr; |
|
67 | 67 | } |
68 | 68 | $networksTable[$filter->id]['permanent'] = false; |
69 | 69 | |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $firewallRules = $filter->FirewallRules; |
81 | 81 | foreach ($firewallRules as $rule) { |
82 | 82 | $networksTable[$filter->id]['category'][$rule->category]['action'] = $rule->action; |
83 | - if ( ! array_key_exists('name', $networksTable[$filter->id]['category'][$rule->category])) { |
|
83 | + if (!array_key_exists('name', $networksTable[$filter->id]['category'][$rule->category])) { |
|
84 | 84 | $networksTable[$filter->id]['category'][$rule->category]['name'] = $rule->category; |
85 | 85 | } |
86 | 86 | } |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | break; |
97 | 97 | } |
98 | 98 | } |
99 | - if ( ! $existsPersistentRecord) { |
|
99 | + if (!$existsPersistentRecord) { |
|
100 | 100 | foreach ($defaultRules as $key => $value) { |
101 | 101 | $networksTableNewRecord['category'][$key] = [ |
102 | 102 | 'name' => $key, |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | } |
144 | 144 | $permitParts = explode('/', $networkFilter->permit); |
145 | 145 | |
146 | - $this->view->form = new FirewallEditForm( |
|
146 | + $this->view->form = new FirewallEditForm( |
|
147 | 147 | $networkFilter, |
148 | 148 | ['network' => $permitParts[0], 'subnet' => $permitParts[1]] |
149 | 149 | ); |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | */ |
158 | 158 | public function saveAction(): void |
159 | 159 | { |
160 | - if ( ! $this->request->isPost()) { |
|
160 | + if (!$this->request->isPost()) { |
|
161 | 161 | return; |
162 | 162 | } |
163 | 163 | |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | } |
172 | 172 | |
173 | 173 | // Update network filters Network Filter |
174 | - if ( ! $this->updateNetworkFilters($filterRecord, $data)) { |
|
174 | + if (!$this->updateNetworkFilters($filterRecord, $data)) { |
|
175 | 175 | $this->view->success = false; |
176 | 176 | $this->db->rollback(); |
177 | 177 | |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | |
186 | 186 | // Update firewall rules Firewall |
187 | 187 | $data['id'] = $filterRecord->id; |
188 | - if ( ! $this->updateFirewallRules($data)) { |
|
188 | + if (!$this->updateFirewallRules($data)) { |
|
189 | 189 | $this->view->success = false; |
190 | 190 | $this->db->rollback(); |
191 | 191 | |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | $filterRecord->$name = $calculator->cidr2network( |
216 | 216 | $data['network'], |
217 | 217 | $data['subnet'] |
218 | - ) . '/' . $data['subnet']; |
|
218 | + ).'/'.$data['subnet']; |
|
219 | 219 | break; |
220 | 220 | case 'deny': |
221 | 221 | $filterRecord->$name = '0.0.0.0/0'; |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | } |
265 | 265 | |
266 | 266 | // Delete outdated records |
267 | - $parameters = [ |
|
267 | + $parameters = [ |
|
268 | 268 | 'conditions' => 'networkfilterid=:networkfilterid:', |
269 | 269 | 'bind' => [ |
270 | 270 | 'networkfilterid' => $data['id'], |
@@ -298,8 +298,8 @@ discard block |
||
298 | 298 | $newRule->portto = $rule['portto']; |
299 | 299 | $newRule->category = $key; |
300 | 300 | |
301 | - if (array_key_exists('rule_' . $key, $data) && $data['rule_' . $key]) { |
|
302 | - $newRule->action = $data['rule_' . $key] === 'on' ? 'allow' : 'block'; |
|
301 | + if (array_key_exists('rule_'.$key, $data) && $data['rule_'.$key]) { |
|
302 | + $newRule->action = $data['rule_'.$key] === 'on' ? 'allow' : 'block'; |
|
303 | 303 | } else { |
304 | 304 | $newRule->action = 'block'; |
305 | 305 | } |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | $filterRecord = NetworkFilters::findFirstById($networkId); |
331 | 331 | |
332 | 332 | $errors = null; |
333 | - if ($filterRecord !== null && ! $filterRecord->delete()) { |
|
333 | + if ($filterRecord !== null && !$filterRecord->delete()) { |
|
334 | 334 | $errors = $filterRecord->getMessages(); |
335 | 335 | } |
336 | 336 |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | return [ |
3 | 3 | /** |
4 | - * Copyright © MIKO LLC - All Rights Reserved |
|
5 | - * Unauthorized copying of this file, via any medium is strictly prohibited |
|
6 | - * Proprietary and confidential |
|
7 | - * Written by Alexey Portnov, 7 2020 |
|
8 | - */ |
|
4 | + * Copyright © MIKO LLC - All Rights Reserved |
|
5 | + * Unauthorized copying of this file, via any medium is strictly prohibited |
|
6 | + * Proprietary and confidential |
|
7 | + * Written by Alexey Portnov, 7 2020 |
|
8 | + */ |
|
9 | 9 | 'March' => 'Březen', |
10 | 10 | 'April' => 'Duben', |
11 | 11 | 'May' => 'Květen', |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | return [ |
3 | 3 | /** |
4 | - * Copyright © MIKO LLC - All Rights Reserved |
|
5 | - * Unauthorized copying of this file, via any medium is strictly prohibited |
|
6 | - * Proprietary and confidential |
|
7 | - * Written by Alexey Portnov, 7 2020 |
|
8 | - */ |
|
4 | + * Copyright © MIKO LLC - All Rights Reserved |
|
5 | + * Unauthorized copying of this file, via any medium is strictly prohibited |
|
6 | + * Proprietary and confidential |
|
7 | + * Written by Alexey Portnov, 7 2020 |
|
8 | + */ |
|
9 | 9 | 'March' => '三月', |
10 | 10 | 'April' => '四月', |
11 | 11 | 'May' => '五月', |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | return [ |
3 | 3 | /** |
4 | - * Copyright © MIKO LLC - All Rights Reserved |
|
5 | - * Unauthorized copying of this file, via any medium is strictly prohibited |
|
6 | - * Proprietary and confidential |
|
7 | - * Written by Alexey Portnov, 7 2020 |
|
8 | - */ |
|
4 | + * Copyright © MIKO LLC - All Rights Reserved |
|
5 | + * Unauthorized copying of this file, via any medium is strictly prohibited |
|
6 | + * Proprietary and confidential |
|
7 | + * Written by Alexey Portnov, 7 2020 |
|
8 | + */ |
|
9 | 9 | 'tf_ActionPlayMessage' => 'Odtwórz plik <b>% message%</b>', |
10 | 10 | 'tf_ActionTransferToExtension' => 'Przekaż połączenie na <b>%message%</b>', |
11 | 11 | 'tf_TableColumnDatePeriod' => 'Okres', |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | return [ |
3 | 3 | /** |
4 | - * Copyright © MIKO LLC - All Rights Reserved |
|
5 | - * Unauthorized copying of this file, via any medium is strictly prohibited |
|
6 | - * Proprietary and confidential |
|
7 | - * Written by Alexey Portnov, 7 2020 |
|
8 | - */ |
|
4 | + * Copyright © MIKO LLC - All Rights Reserved |
|
5 | + * Unauthorized copying of this file, via any medium is strictly prohibited |
|
6 | + * Proprietary and confidential |
|
7 | + * Written by Alexey Portnov, 7 2020 |
|
8 | + */ |
|
9 | 9 | 'January' => 'Січень', |
10 | 10 | 'February' => 'Лютий', |
11 | 11 | 'March' => 'Березень', |