auth->isSuperAdmin()) { return; } # Var initialisation $p_url = 'plugin.php?p=dcLog'; $page = isset($_GET['page']) ? $_GET['page'] : 1; $status = isset($_GET['status']) ? $_GET['status'] : null; # filter initialisation $blog_id = isset($_GET['blog_id']) ? $_GET['blog_id'] : null; $user_id = isset($_GET['user_id']) ? $_GET['user_id'] : null; $table = isset($_GET['table']) ? $_GET['table'] : null; $ip = isset($_GET['ip']) ? $_GET['ip'] : null; $nb = isset($_GET['nb']) ? $_GET['nb'] : 20; # form initialisation $ids = isset($_POST['ids']) ? $_POST['ids'] : null; $del_all_log = isset($_POST['del_all_logs']) ? true : false; # Delete logs if (isset($_POST['del_logs']) || isset($_POST['del_all_logs'])) { try { $core->log->delLogs($ids,$del_all_log); $status = $del_all_log ? '2' : '1'; http::redirect($p_url.'&del='.$status); } catch (Exception $e) { $core->error->add($e->getMessage()); } } # Gets logs & prepares display object $params = array( 'blog_id' => $blog_id, 'user_id' => !is_null($user_id) && $user_id !== '' ? explode(',',$user_id) : $user_id, 'log_table' => !is_null($table) && $table !== '' ? explode(',',$table) : $table, 'log_ip' => !is_null($ip) && $ip !== '' ? explode(',',$ip) : $ip ); $l_rs = $core->log->getLogs($params); $l_nb = $l_rs->count(); $l_list = new dcLogList($core,$l_rs,$l_nb); # Display echo ''. ''. ''.__('Log').''. dcPage::jsLoad('js/filter-controls.js'). dcPage::jsLoad('index.php?pf=dcLog/js/dclog.js'). ''. ''."\n". ''; # Message if (isset($_GET['del'])) { $msg = ''; if ((integer) $_GET['del'] === 1) { $msg = __('Selected logs have been successfully deleted'); } if ((integer) $_GET['del'] === 2) { $msg = __('All logs have been successfully deleted'); } echo !empty($msg) ? '

'.$msg.'

' : ''; } # Combo blog $combo_blog = array(__('All blogs') => 'all'); $blogs = $core->getBlogs(); while ($blogs->fetch()) { $combo_blog[sprintf('%s (%s)',$blogs->blog_name,$blogs->blog_id)] = $blogs->blog_id; } echo '

'.html::escapeHTML($core->blog->name).' › '.__('Log').'

'. '

'. __('Filters').'

'. '
'. form::hidden('p','dcLog'). '
'.__('Filters').''. '
'. '

'. '

'. '

 '. '

'. '
'. '

'. '

'. '
'. '
'. //Opera sucks '
'. '
'; $l_list->display($page,$nb, '
'. '%s'. '
'. '

'. '

 '. '

'. $core->formNonce(). '
'. '
' ); echo ''. ''; ?>