| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
require '../include/class.vfs.php'; |
|---|
| 22 |
require '../include/ispcp-lib.php'; |
|---|
| 23 |
|
|---|
| 24 |
check_login(__FILE__); |
|---|
| 25 |
|
|---|
| 26 |
$tpl = new pTemplate(); |
|---|
| 27 |
$tpl->define_dynamic('page', Config::get('CLIENT_TEMPLATE_PATH') . '/error_edit.tpl'); |
|---|
| 28 |
$tpl->define_dynamic('page_message', 'page'); |
|---|
| 29 |
$tpl->define_dynamic('logged_from', 'page'); |
|---|
| 30 |
|
|---|
| 31 |
function gen_error_page_data(&$tpl, &$sql, $user_id, $eid) { |
|---|
| 32 |
$domain = $_SESSION['user_logged']; |
|---|
| 33 |
|
|---|
| 34 |
$vfs = &new vfs($domain, $sql); |
|---|
| 35 |
$error = $vfs->get('/errors/' . $eid . '.html'); |
|---|
| 36 |
if (false !== $error) { |
|---|
| 37 |
|
|---|
| 38 |
$tpl->assign(array('ERROR' => htmlentities($error))); |
|---|
| 39 |
return; |
|---|
| 40 |
} |
|---|
| 41 |
|
|---|
| 42 |
$tpl->assign(array('ERROR' => '')); |
|---|
| 43 |
} |
|---|
| 44 |
|
|---|
| 45 |
|
|---|
| 46 |
|
|---|
| 47 |
$theme_color = Config::get('USER_INITIAL_THEME'); |
|---|
| 48 |
|
|---|
| 49 |
$tpl->assign( |
|---|
| 50 |
array( |
|---|
| 51 |
'TR_CLIENT_ERROR_PAGE_TITLE' => tr('ispCP - Client/Manage Error Custom Pages'), |
|---|
| 52 |
'THEME_COLOR_PATH' => "../themes/$theme_color", |
|---|
| 53 |
'THEME_CHARSET' => tr('encoding'), |
|---|
| 54 |
'ISP_LOGO' => get_logo($_SESSION['user_id']) |
|---|
| 55 |
) |
|---|
| 56 |
); |
|---|
| 57 |
|
|---|
| 58 |
|
|---|
| 59 |
|
|---|
| 60 |
if (!isset($_GET['eid'])) { |
|---|
| 61 |
set_page_message(tr('Server error - please choose error page')); |
|---|
| 62 |
header("Location: error_pages.php"); |
|---|
| 63 |
die(); |
|---|
| 64 |
} else { |
|---|
| 65 |
$eid = intval($_GET['eid']); |
|---|
| 66 |
} |
|---|
| 67 |
|
|---|
| 68 |
if ($eid == 401 || $eid == 403 || $eid == 404 || $eid == 500 || $eid == 503) { |
|---|
| 69 |
gen_error_page_data($tpl, $sql, $_SESSION['user_id'], $_GET['eid']); |
|---|
| 70 |
} else { |
|---|
| 71 |
$tpl->assign( |
|---|
| 72 |
array('ERROR' => tr('Server error - please choose error page'), |
|---|
| 73 |
'EID' => '0' |
|---|
| 74 |
) |
|---|
| 75 |
); |
|---|
| 76 |
} |
|---|
| 77 |
|
|---|
| 78 |
|
|---|
| 79 |
|
|---|
| 80 |
gen_client_mainmenu($tpl, Config::get('CLIENT_TEMPLATE_PATH') . '/main_menu_webtools.tpl'); |
|---|
| 81 |
gen_client_menu($tpl, Config::get('CLIENT_TEMPLATE_PATH') . '/menu_webtools.tpl'); |
|---|
| 82 |
|
|---|
| 83 |
gen_logged_from($tpl); |
|---|
| 84 |
|
|---|
| 85 |
check_permissions($tpl); |
|---|
| 86 |
|
|---|
| 87 |
$tpl->assign( |
|---|
| 88 |
array('TR_ERROR_EDIT_PAGE' => tr('Edit error page'), |
|---|
| 89 |
'TR_SAVE' => tr('Save'), |
|---|
| 90 |
'TR_CANCEL' => tr('Cancel'), |
|---|
| 91 |
'EID' => $eid |
|---|
| 92 |
) |
|---|
| 93 |
); |
|---|
| 94 |
|
|---|
| 95 |
gen_page_message($tpl); |
|---|
| 96 |
|
|---|
| 97 |
$tpl->parse('PAGE', 'page'); |
|---|
| 98 |
$tpl->prnt(); |
|---|
| 99 |
|
|---|
| 100 |
if (Config::get('DUMP_GUI_DEBUG')) |
|---|
| 101 |
dump_gui_debug(); |
|---|
| 102 |
|
|---|
| 103 |
unset_messages(); |
|---|
| 104 |
|
|---|
| 105 |
?> |
|---|