root/trunk/gui/client/error_edit.php

Revision 1359, 2.7 kB (checked in by scitech, 2 months ago)

Fixed #1544: Add SQL user has only one option -> useless. Fixed #1545: HTML bug with hint for updates. Fixed #1546: Tiny english typo

Line 
1 <?php
2 /**
3  * ispCP ω (OMEGA) a Virtual Hosting Control System
4  *
5  * @copyright     2001-2006 by moleSoftware GmbH
6  * @copyright     2006-2008 by ispCP | http://isp-control.net
7  * @version     SVN: $Id$
8  * @link         http://isp-control.net
9  * @author         ispCP Team
10  *
11  * @license
12  *   This program is free software; you can redistribute it and/or modify it under
13  *   the terms of the MPL General Public License as published by the Free Software
14  *   Foundation; either version 1.1 of the License, or (at your option) any later
15  *   version.
16  *   You should have received a copy of the MPL Mozilla Public License along with
17  *   this program; if not, write to the Open Source Initiative (OSI)
18  *   http://opensource.org | osi@opensource.org
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     // Check if we already have an error page
34     $vfs = &new vfs($domain, $sql);
35     $error = $vfs->get('/errors/' . $eid . '.html');
36     if (false !== $error) {
37         // We already have an error page, return it
38         $tpl->assign(array('ERROR' => htmlentities($error)));
39         return;
40     }
41     // No error info :'(
42     $tpl->assign(array('ERROR' => ''));
43 }
44
45 // common page data.
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 // dynamic page data.
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 // static page messages.
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 ?>
Note: See TracBrowser for help on using the browser.