Пример #1
0
 /**
  * Show system error
  * 
  * @param string $message
  * @param integer $status
  * @param string $title
  */
 function wasp_error($message, $file = null, $line = null, $status = 500)
 {
     if (is_ajax()) {
         $html = "<div id=\"error-header\" style=\"font-size: 10pt; font-weight: bold;\">" . CORE_NAME . " system error</div><br />" . "<div id=\"error-content\" style=\"font-size: 8pt;\">" . (!empty($file) ? "<div><strong>File:</strong> {$file}</div>" : '') . (!empty($line) ? "<div><strong>Line:</strong> {$line}</div>" : '') . "{$message}</div>";
     } else {
         set_http_status($status);
         $html = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />' . "<meta name=\"generator\" content=\"" . FRAMEWORK . "\" /><meta name=\"description\" content=\"" . CORE_NAME . " system error\" />" . "<title>" . CORE_NAME . " system error</title>\n<style>\nbody { font-family: Tahoma, Arial, sans-serif; fint-size: 8pt; }</style></head><body>" . "<div id=\"error-header\" style=\"font-size: 14pt; color: red;\">" . CORE_NAME . " system error</div><br /><div id=\"error-content\" style=\"font-size: 10pt;\">" . (!empty($file) ? "<div><strong>File:</strong> {$file}</div>" : '') . (!empty($line) ? "<div><strong>Line:</strong> {$line}</div>" : '') . "{$message}</div>" . '<div id="error-footer" style="margin-top: 10px; border-top: 1px solid gray; font-size: 8pt;">' . '<span style="color: gray;">' . FRAMEWORK . ', Copyright &copy; 2014 Tishchenko A., All rights reserved.</span></div></body></html>';
     }
     error_log($message, 3, LOGS_DIR . DIR_SEP . 'app_errors');
     exit($html);
 }
Пример #2
0
 public function anyUnauthorized()
 {
     set_http_status(401);
     return $this->ui->fetch('errors/unauthorized');
 }