/** * Renders the Database Connection web page. * * @param array $params Parameters for controller * @access public */ function missingConnection($params) { extract($params, EXTR_OVERWRITE); $this->controller->header("HTTP/1.0 500 Internal Server Error"); $this->controller->set(array('code' => '500', 'model' => $className, 'title' => __('Missing Database Connection', true))); $this->_outputMessage('missingConnection'); }
/** * Black-hole an invalid request with a 404 error or custom callback. If SecurityComponent::$blackHoleCallback * is specified, it will use this callback by executing the method indicated in $error * * @param Controller $controller Instantiating controller * @param string $error Error method * @return mixed If specified, controller blackHoleCallback's response, or no return otherwise * @see SecurityComponent::$blackHoleCallback * @link http://book.cakephp.org/2.0/en/core-libraries/components/security-component.html#handling-blackhole-callbacks */ public function blackHole($controller, $error = '') { if ($this->blackHoleCallback == null) { $code = 404; if ($error == 'login') { $code = 401; $controller->header($this->loginRequest()); } return $controller->redirect(null, $code, true); } else { return $this->_callback($controller, $this->blackHoleCallback, array($error)); } }