array( 'filter' => FILTER_VALIDATE_INT, 'pageset' => true, 'default' => '-1' ), 'page' => array( 'filter' => FILTER_VALIDATE_INT, 'default' => '1' ), 'filter' => array( 'filter' => FILTER_DEFAULT, 'pageset' => true, 'default' => '' ), 'sort_column' => array( 'filter' => FILTER_CALLBACK, 'default' => 'time', 'options' => array('options' => 'sanitize_search_string') ), 'sort_direction' => array( 'filter' => FILTER_CALLBACK, 'default' => 'DESC', 'options' => array('options' => 'sanitize_search_string') ), 'username' => array( 'filter' => FILTER_CALLBACK, 'default' => '-1', 'options' => array('options' => 'sanitize_search_string') ), 'result' => array( 'filter' => FILTER_VALIDATE_INT, 'pageset' => true, 'default' => '-1' ) ); validate_store_request_vars($filters, 'sess_userlog'); /* ================= input validation ================= */ if (get_request_var('rows') == '-1') { $rows = read_config_option('num_rows_table'); } else { $rows = get_request_var('rows'); } ?>
' title=''> ' title=''> ' title=''>
'>
array(__('User'), 'ASC'), 'full_name' => array(__('Full Name'), 'ASC'), 'realm' => array(__('Authentication Realm'), 'ASC'), 'time' => array(__('Date'), 'DESC'), 'result' => array(__('Result'), 'DESC'), 'ip' => array(__('IP Address'), 'DESC') ); html_header_sort($display_text, get_request_var('sort_column'), get_request_var('sort_direction'), 1, 'user_log.php?action=view'); $i = 0; if (cacti_sizeof($user_log)) { foreach ($user_log as $item) { form_alternate_row('line' . $i, true); ?> 1) { db_execute_prepared('DELETE FROM user_log WHERE username = ? AND result = ? ORDER BY time LIMIT ' . ($total_rows - 1), array($user['username'], $result)); } } db_execute_prepared('DELETE FROM user_log WHERE username = ? AND result = 0', array($user['username'])); } /* delete inactive users */ db_execute('DELETE FROM user_log WHERE user_id NOT IN (SELECT id FROM user_auth) OR username NOT IN (SELECT username FROM user_auth)'); } } function purge_user_log() { form_start('user_log.php'); html_start_box(__('Purge User Log'), '50%', '', '3', 'center', ''); print "

" . __('Click \'Continue\' to purge the User Log.


Note: If logging is set to both Cacti and Syslog, the log information will remain in Syslog.') . "

  \n"; html_end_box(); }