<?php /** * $Id$ * * @category System * @package Mediboard * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @link http://www.mediboard.org */ CCanDo::checkAdmin(); $log_id = CValue::get("log_id"); $log = new CLongRequestLog(); $log->load($log_id); $log->getLink(); $smarty = new CSmartyDP(); $smarty->assign("log", $log); $smarty->display("edit_long_request_log.tpl");
} $bot = CAppUI::$user->isRobot(); // Determine the log_level to apply $long_request_log_level = false; if ($bot && $bot_long_request_level) { $long_request_log_level = $bot_long_request_level; } elseif (!$bot && $human_long_request_level) { $long_request_log_level = $human_long_request_level; } if (!$long_request_log_level) { return; } // If request is too slow if ($duration > $long_request_log_level) { // We store it $long_request_log = new CLongRequestLog(); $long_request_log->datetime = CMbDT::format(null, "%Y-%m-%d %H:%M:00"); $long_request_log->duration = $duration; $long_request_log->server_addr = get_server_var('SERVER_ADDR'); $long_request_log->user_id = CAppUI::$user->_id; // GET and POST params $long_request_log->_query_params_get = $_GET; $long_request_log->_query_params_post = $_POST; $session = $_SESSION; unset($session['AppUI']); unset($session['dPcompteRendu']['templateManager']); // SESSION params $long_request_log->_session_data = $session; // Unique Request ID $long_request_log->requestUID = CApp::getRequestUID(); if ($msg = $long_request_log->store()) {
<?php $_date_min = CValue::post('_date_min'); $_date_max = CValue::post('_date_max'); $user_id = CValue::post('user_id'); $duration = CValue::post('duration'); $duration_operand = CValue::post('duration_operand'); $purge_limit = CValue::post('purge_limit', '100'); $just_count = CValue::post('just_count'); $purge_limit = $purge_limit ? $purge_limit : 100; $ds = CSQLDataSource::get('std'); $log = new CLongRequestLog(); $where = array(); if ($_date_min) { $where[] = $ds->prepare('`datetime` >= ?', $_date_min); } if ($_date_max) { $where[] = $ds->prepare('`datetime` <= ?', $_date_max); } if ($user_id) { $where['user_id'] = $ds->prepare('= ?', $user_id); } if ($duration && in_array($duration_operand, array('<', '<=', '=', '>', '>='))) { $where['duration'] = $ds->prepare("{$duration_operand} ?", $duration); } $count = $log->countList($where); $msg = '%d CLongRequestLog to be removed.'; if ($count == 1) { $msg = 'One CLongRequestLog to be removed.'; } elseif (!$count) { $msg = 'No CLongRequestLog to be removed.';
<?php /** * $Id$ * * @category System * @package Mediboard * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @link http://www.mediboard.org */ CCanDo::checkAdmin(); $start = (int) CValue::get("start", 0); $filter = new CLongRequestLog(); $filter->_date_min = CValue::get("_date_min"); $filter->_date_max = CValue::get("_date_max"); $filter->user_id = CValue::get("user_id"); $duration_operand = CValue::get("duration_operand"); $filter->duration = CValue::get("duration"); $ds = CSQLDataSource::get('std'); $where = array(); if ($filter->user_id) { $where["user_id"] = $ds->prepare("= ?", $filter->user_id); } if ($filter->_date_min) { $where[] = $ds->prepare("`datetime` >= ?", $filter->_date_min); } if ($filter->_date_max) { $where[] = $ds->prepare("`datetime` >= ?", $filter->_date_max); } if ($filter->duration && in_array($duration_operand, array('<', '<=', '=', '>', '>='))) {