root/trunk/gui/admin/database_update.php

Revision 1359, 3.2 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
13  *   modify it under the terms of the GPL General Public License
14  *   as published by the Free Software Foundation; either version 2.0
15  *   of the License, or (at your option) any later version.
16  *
17  *   This program is distributed in the hope that it will be useful,
18  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
19  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  *   GPL General Public License for more details.
21  *
22  *   You may have received a copy of the GPL General Public License
23  *   along with this program.
24  *
25  *   An on-line copy of the GPL General Public License can be found
26  *   http://www.fsf.org/licensing/licenses/gpl.txt
27  **/
28
29 require '../include/ispcp-lib.php';
30
31 check_login(__FILE__);
32
33 $tpl = new pTemplate();
34 $tpl -> define_dynamic('page', Config::get('ADMIN_TEMPLATE_PATH') . '/database_update.tpl');
35 $tpl -> define_dynamic('page_message', 'page');
36 $tpl -> define_dynamic('hosting_plans', 'page');
37 $tpl -> define_dynamic('database_update_message', 'page');
38 $tpl -> define_dynamic('database_update_infos', 'page');
39
40 $tpl -> assign(array(
41     'TR_ADMIN_ISPCP_UPDATES_PAGE_TITLE'    => tr('ispCP - Virtual Hosting Control System'),
42     'THEME_COLOR_PATH'            => "../themes/" . Config::get('USER_INITIAL_THEME'),
43     'THEME_CHARSET'                => tr('encoding'),
44     'ISP_LOGO'                => get_logo($_SESSION['user_id'])
45 ));
46
47 // $execute is false per default
48 $execute = false;
49
50 // If the post variable execute is set to true, $execute
51 // will be set to true, too
52 if(!empty($_POST['execute']) && $_POST['execute'])
53     $execute = true;
54
55 gen_admin_mainmenu($tpl, Config::get('ADMIN_TEMPLATE_PATH') . '/main_menu_system_tools.tpl');
56 gen_admin_menu($tpl, Config::get('ADMIN_TEMPLATE_PATH') . '/menu_system_tools.tpl');
57 gen_page_message($tpl);
58
59 $tpl->assign(array(
60     'TR_UPDATES_TITLE'    => tr('Database updates'),
61     'TR_AVAILABLE_UPDATES'    => tr('Available database updates'),
62     'TR_UPDATE'        => tr('Update'),
63     'TR_INFOS'        => tr('Update details')
64 ));
65
66 if(databaseUpdate::getInstance()->checkUpdateExists()) {
67     $tpl->assign(array(
68         'UPDATE_MESSAGE'        => '',
69         'DATABASE_UPDATE_MESSAGE'    => '',
70         'UPDATE'            => tr('New Database update is now available'),
71         'INFOS'                => tr('Do you want to execute the Updates now?')
72     ));
73     $tpl->parse('DATABASE_UPDATE_INFOS', 'database_update_infos');
74 } else {
75     $tpl->assign(array(
76         'TR_UPDATE_MESSAGE'     => tr('No database updates available'),
77         'DATABASE_UPDATE_INFOS'    => ''
78     ));
79     $tpl->parse('DATABASE_UPDATE_MESSAGE', 'database_update_message');
80 }
81
82 // Execute all available db updates and redirect back to database_update.php
83 if($execute) {
84     databaseUpdate::getInstance()->executeUpdates();
85     if( databaseUpdate::getInstance()->getErrorMessage() != "" )
86         system_message(databaseUpdate::getInstance()->getErrorMessage());
87     header('Location:' . $_SERVER['PHP_SELF']);
88 }
89
90 $tpl->parse('PAGE', 'page');
91 $tpl->prnt();
92
93 if (Config::get('DUMP_GUI_DEBUG'))dump_gui_debug();
94 ?>
Note: See TracBrowser for help on using the browser.