PluginProbe
WebTotem Security / 2.3.11
WebTotem Security v2.3.11
3.0.2 3.0.1 3.0.0 trunk 1.0 1.1 1.2 1.3 1.3.1 1.3.2 1.3.3 2.0 2.1 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.1 2.2.2 2.2.3 All 110 releases
← All changes | services.php +66 -1 2.2.22.3.11 View file →
@@ -210,8 +210,66 @@
210 210 return false;
211 211 }
212 212 }
213 213
214 +
215 +function wtsec_AVLogsData($logs){
216 + foreach ($logs as $key => $log){
217 + $log = $log['node'];
218 + $log['filePath'] = urldecode($log['filePath']);
219 + $log['text'] = (strlen($log['filePath']) > 40) ? substr($log['filePath'],0,40).'...' : $log['filePath'];
220 + $log['time'] = convertToCurrentTime($log['time']);
221 +
222 + if ($log['event'] === 'modified') {
223 + $log['info'] = WTSEC_LIBRARY_Localization::lmsg("antivirus.info.normal");
224 + $log['class_path'] = "wtotem_file-table__td_changed";
225 + $log['class_info'] = "wtotem_file-table__td_normal";
226 + $log['description'] = WTSEC_LIBRARY_Localization::lmsg("antivirus.status.changed");
227 + } elseif ($log['event'] === 'quarantine') {
228 + $log['info'] = WTSEC_LIBRARY_Localization::lmsg("antivirus.info.backdoor_virus");
229 + $log['class_path'] = "wtotem_file-table__td_changed";
230 + $log['class_info'] = "wtotem_file-table__td_normal";
231 + $log['description'] = WTSEC_LIBRARY_Localization::lmsg("antivirus.status.quarantine");
232 + } elseif ($log['event'] === 'infected') {
233 + $log['info'] = WTSEC_LIBRARY_Localization::lmsg("antivirus.info.backdoor_virus");
234 + $log['class_path'] = "wtotem_file-table__td_critical";
235 + $log['class_info'] = "wtotem_file-table__td_critical";
236 + $log['description'] = WTSEC_LIBRARY_Localization::lmsg("antivirus.status.infected");
237 + } elseif ($log['event'] === 'deleted') {
238 + $log['info'] = WTSEC_LIBRARY_Localization::lmsg("antivirus.info.deleted");
239 + $log['description'] = WTSEC_LIBRARY_Localization::lmsg("antivirus.status.deleted");
240 + }elseif ($log['event'] === 'new'){
241 + $log['info'] = WTSEC_LIBRARY_Localization::lmsg("antivirus.info.normal");
242 + $log['description'] = WTSEC_LIBRARY_Localization::lmsg("antivirus.status.new");
243 + }elseif ($log['event'] === 'scanned'){
244 + $log['info'] = WTSEC_LIBRARY_Localization::lmsg("antivirus.info.normal");
245 + $log['description'] = WTSEC_LIBRARY_Localization::lmsg("antivirus.status.scanned");
246 + }else{
247 + $log['info'] = WTSEC_LIBRARY_Localization::lmsg("antivirus.status.error");
248 + $log['description'] = WTSEC_LIBRARY_Localization::lmsg("antivirus.status.error");
249 + }
250 +
251 + $logs[$key]['node'] = $log;
252 + }
253 + return $logs;
254 +}
255 +
256 +function wtsec_getConfigs($host_id)
257 +{
258 + $config = WTSEC_LIBRARY_WT::getConfigs($host_id);
259 + return wtsec_arrayIndex($config['data']['auth']['viewer']['sites']['one']['configs'], 'service');
260 +}
261 +
262 +function wtsec_arrayIndex($array, $key){
263 + $newArray = [];
264 + foreach ($array as $item){
265 + if(array_key_exists($key,$item)){
266 + $newArray[$item[$key]] = $item;
267 + }
268 + }
269 + return $newArray;
270 +}
271 +
214 272 function wtsec_button($label = '', $class = '')
215 273 {
216 274 return '<button class="ww-button ' . $class . '">' . $label . '</button>';
217 275 }
@@ -282,5 +340,12 @@
282 340
283 341 function wtsec_getInstalledFile($service)
284 342 {
285 343 return wtsec_app()->get($service . "_installed_file");
286 -}
344 +}
345 +
346 +function wtsec_DeleteAm(){
347 + $host = WTSEC_LIBRARY_WT::getOwnSite();
348 + if(!empty($host)){
349 + WTSEC_LIBRARY_WT::deleteAm($host['id']);
350 + }
351 +}