function beforeFilter() { //This is used only for logging the invoked javascript method $action = $this->action; $id = $this->Session->read('id'); $this->params['user_agent'] = $_SERVER['HTTP_USER_AGENT']; if ($action == 'checkuser') { // a really bad hack... we don't want to log the pwd of course! $tmp = $this->params['form']['password']; $this->params['form']['password'] = '******'; $log = $action . ': ' . $id . ': ' . serialize($this->params); $this->params['form']['password'] = $tmp; } else { $log = $action . ': ' . $id . ': ' . serialize($this->params); } App::import('Controller', 'Logs'); $logContr = new LogsController(); $logContr->constructClasses(); $logContr->write($log); $log = str_replace("\n", " ", $log); $this->log($log, 'stat'); //set json view as default $this->view = 'Json'; //initialize auth component $this->Conf->startup(&$this); //start Conf component $auth_comp = $this->Conf->get('Auth.method') . 'auth'; App::import('Component', $auth_comp); $cn = $auth_comp . 'Component'; $this->AuthComponent = new $cn(); $this->AuthComponent->startup(&$this); //start AuthComponent component }
function beforeFilter() { $action = $this->action; $id = $this->Session->read('id'); $this->params['user_agent'] = $_SERVER['HTTP_USER_AGENT']; $log = $action . ': ' . $id . ': ' . serialize($this->params); App::import('Controller', 'Logs'); $logContr = new LogsController(); $logContr->constructClasses(); $logContr->write($log); $log = str_replace("\n", " ", $log); $this->log($log, 'stat'); //set json view as default $this->view = 'Json'; //workaround to pass variables to the pages_controller $this->Conf->startup($this); Configure::write('App.name', $this->Conf->get('Site.name')); Configure::write('App.contactus', $this->Conf->get('Site.admin')); }
<?php include '../../../../Conf/Include.php'; set_dependencies(array("LogsController")); $dir = FunctionsController::GetRootUrl("task"); echo $dir . "<br>"; if ($dir) { echo "existe"; } else { echo "no existe"; } $log = new LogsController("../../task/"); $log->SetLog("prueba"); $log->CloseLog();
$session_user = UserCache::getInstance()->getUser($_SESSION['userid']); if ($session_user->isTeamMember(Config::getInstance()->getValue(Config::id_adminTeamId))) { if (NULL != Constants::$codevtt_logfile && file_exists(Constants::$codevtt_logfile)) { $nbLinesToDisplay = 1500; $lines = file(Constants::$codevtt_logfile); if (count($lines) > $nbLinesToDisplay) { $offset = count($lines) - $nbLinesToDisplay; } else { $offset = 0; } $logs = array(); for ($i = $offset; $i <= $offset + $nbLinesToDisplay, $i < count($lines); $i++) { $logs[$i + 1] = htmlspecialchars($lines[$i], ENT_QUOTES, "UTF-8"); #echo "DEBUG $line_num - ".$logs[$line_num]."<br>"; } $this->smartyHelper->assign('logs', $logs); } else { $this->smartyHelper->assign('error', T_('Sorry, logfile not found:') . ' [' . Constants::$codevtt_logfile . ']'); } } else { $this->smartyHelper->assign('error', T_('Sorry, you need to be in the admin-team to access this page.')); } } else { $this->smartyHelper->assign('error', T_('Sorry, you need to be in the admin-team to access this page.')); } } } // ========== MAIN =========== LogsController::staticInit(); $controller = new LogsController('../', 'CodevTT Logs', 'Admin'); $controller->execute();
$encript = new \SivarApi\Tools\Encriptacion\Encriptacion(); $id_mt = $encript->Md5Encrypt(mt_rand(0, 1000) . mt_rand(100, 500) . $id_user . $_REQUEST['title']); $box_files = $_REQUEST['box_nodes'] ?: ""; $mensaje = htmlspecialchars("<b>La tarea Consiste en :</b><br> " . $_REQUEST['client_description'] . "<div align='center'><a target='_blank' class='btn btn-circle green-haze btn-sm ' href='" . FunctionsController::GetUrl("task/show_task.php?id={$id_mt}") . "'>Ver tarea ...</a></div>", ENT_QUOTES); $asunto = " Tarea :" . $_REQUEST['title']; $msj = new MessageController(); $id_msj = $msj->SetmessageLastId($_REQUEST['id_user'], $id_user, $mensaje, $asunto); $val = $task->SaveTask(array("id_multitask" => $id_mt, "id_client" => $_REQUEST['id_client'], "id_user_from" => $id_user, "description" => $_REQUEST['client_description'] ?: "ERROR", "title" => $_REQUEST['title'], "status" => 1), array("id_multitask" => $id_mt, "id_type" => 1, "id_user_from" => $id_user, "id_user_to" => $_REQUEST['id_user'], "id_message" => $id_msj[0]['id'], "date_asign" => FunctionsController::get_date(), "time_asign" => FunctionsController::get_time(), "box_files" => $box_files, "files" => $_REQUEST['other_docs'] ?: "", "comments" => $_REQUEST['user_comment'], "date_deadline" => FunctionsController::ReWriteDate($_REQUEST['deadline']), "time_deadline" => $_REQUEST['hourdead'], "status" => $_REQUEST['user_activate'])); if (!$val) { echo 0; } else { echo $id_mt; } } catch (Exception $ex) { $error = "(" . FunctionsController::get_date() . ")"; $error .= "(" . FunctionsController::get_time() . ")"; $error .= "(ERROR==>" . $ex->getMessage() . ")"; $dir = "../../task/logs/"; $log = new LogsController($dir); $log->SetLog($error); $log->CloseLog(); } catch (PDOException $ex) { $error = "(" . FunctionsController::get_date() . ")"; $error .= "(" . FunctionsController::get_time() . ")"; $error .= "(ERROR==>" . $ex->getMessage() . ")"; $dir = "../../task/logs/"; $log = new LogsController($dir); $log->SetLog($error); $log->CloseLog(); } unset($task);