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')); }