/** * logs attempts * @param bool errorsOnly (only if error occured, otherwise always) * @returns null if not logged, true otherwise * 2009-12-18 ms */ protected function _logAttempt($errorsOnly = true) { if ($errorsOnly === true && empty($this->error) && empty($this->internalError)) { return null; } if (!$this->settings[$this->Model->alias]['log']) { return null; } //App::import('Component', 'RequestHandler'); $msg = 'IP \'' . CakeRequest::clientIP() . '\', Agent \'' . env('HTTP_USER_AGENT') . '\', Referer \'' . env('HTTP_REFERER') . '\', Host-Referer \'' . CommonComponent::getReferer() . '\''; if (!empty($this->error)) { $msg .= ', ' . $this->error; } if (!empty($this->internalError)) { $msg .= ' (' . $this->internalError . ')'; } $this->log($msg, 'captcha'); return true; }