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 +52 -2 2.2.32.3.11 View file →
@@ -211,8 +211,49 @@
211 211 }
212 212 }
213 213
214 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 +
215 256 function wtsec_getConfigs($host_id)
216 257 {
217 258 $config = WTSEC_LIBRARY_WT::getConfigs($host_id);
218 259 return wtsec_arrayIndex($config['data']['auth']['viewer']['sites']['one']['configs'], 'service');
@@ -220,9 +261,11 @@
220 261
221 262 function wtsec_arrayIndex($array, $key){
222 263 $newArray = [];
223 264 foreach ($array as $item){
224 - $newArray[$item[$key]] = $item;
265 + if(array_key_exists($key,$item)){
266 + $newArray[$item[$key]] = $item;
267 + }
225 268 }
226 269 return $newArray;
227 270 }
228 271
@@ -297,5 +340,12 @@
297 340
298 341 function wtsec_getInstalledFile($service)
299 342 {
300 343 return wtsec_app()->get($service . "_installed_file");
301 -}
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 +}