function get_forbid_page() { echo "<div id=\"forbidden\"><p>Forbidden</p></div>"; get_admin_footer(); }
<table id="viewuser"> <tr> <th> اسم </th><th> نام کاربری </th><th> رمز عبور </th><th> ایمیل </th><th> نقش کاربر </th> </tr><br> <?php $index = "viewuser"; $result = request_select($index); if ($result) { get_form($result, $index); } ?> </table> <?php get_admin_sidebar(); get_admin_footer(); ?> <?php } else { if (isset($_POST['login'])) { $login = array("username" => "{$_POST['username']}", "password" => "{$_POST['password']}"); $url = $_SERVER['REQUEST_URI']; $url = ltrim($url, "cms1/admin"); user_login($login, 'login', $url); } // end isset() require_once dirname(dirname(__FILE__)) . '/login_form.php'; }
function msg_handler($errno, $msg_text, $errfile, $errline) { global $auth, $config, $mangareader_root_path, $user; // Do not display notices if we suppress them via @ if (error_reporting() == 0 && $errno != E_USER_ERROR && $errno != E_USER_WARNING && $errno != E_USER_NOTICE) { return; } if (!defined('E_DEPRECATED')) { define('E_DEPRECATED', 8192); } switch ($errno) { case E_NOTICE: case E_WARNING: // Check the error reporting level and return if the error level does not match // If DEBUG is defined the default level is E_ALL if (($errno & (defined('DEBUG') ? E_ALL : error_reporting())) == 0) { return; } $errfile = filter_root_path($errfile); $msg_text = filter_root_path($msg_text); $error_name = $errno === E_WARNING ? 'PHP Warning' : 'PHP Notice'; echo '<b>[MangaReader Debug] ' . $error_name . '</b>: in file <b>' . $errfile . '</b> on line <b>' . $errline . '</b>: <b>' . $msg_text . '</b><br />' . "\n"; return; break; case E_USER_ERROR: if (function_exists('__')) { $msg_text = __($msg_text); $msg_title = !isset($msg_title) ? __('GENERAL_ERROR') : __($msg_title); $l_return_index = sprintf(__('RETURN_INDEX'), '<a href="' . $mangareader_root_path . '">', '</a>'); $l_notify = ''; if (!empty($config['board_contact'])) { $l_notify = '<p>' . sprintf(__('NOTIFY_ADMIL_EMAIL'), $config['board_contact']) . '</p>'; } } else { $msg_title = 'General Error'; $l_return_index = '<a href="' . $mangareader_root_path . '">Return to index page</a>'; $l_notify = ''; if (!empty($config['board_contact'])) { $l_notify = '<p>Please notify the board administrator or webmaster: <a href="mailto:' . $config['board_contact'] . '">' . $config['board_contact'] . '</a></p>'; } } $log_text = $msg_text; /** * @todo backtrace */ /** * @todo to here */ // Do not send 200 OK, but service unavailable on errors send_status_line(503, 'Service Unavailable'); /** * @todo html output */ break; case E_USER_WARNING: case E_USER_NOTICE: if (empty($user->sid)) { $user->session_begin(); } // Re-initialize acl $auth->acl($user->data); if ($msg_text == 'NO_MANGA' || $msg_text == 'NO_CATEGORY' || $msg_text == 'NOT_FOUND') { send_status_line(404, 'Not Found'); } $msg_text = __($msg_text); $msg_title = !isset($msg_title) ? __('INFORMATION') : __($msg_title); /** * @todo Check also if user has permission to reach administration panel */ if (defined('IN_ADMIN')) { /** * @todo set page title as $msg_title */ get_admin_header(); } else { /** * @todo set page title as $msg_title */ get_header(); } /** * @todo Replace these into functions */ $GLOBALS['msg_title'] = $msg_title; $GLOBALS['msg_text'] = $msg_text; $GLOBALS['is_user_warning'] = $errno == E_USER_WARNING; $GLOBALS['is_user_notice'] = $errno == E_USER_NOTICE; /** * @todo Check also if user has permission to reach administration panel */ if (defined('IN_ADMIN')) { locate_admin_template('message_box.php', true); get_admin_footer(); } else { locate_template('message_box.php', true); get_footer(); } exit_handler(); break; } }