root/trunk/gui/admin/language_delete.php

Revision 1327, 1.9 kB (checked in by rats, 4 months ago)

* Fixed: --scan-knownbad-files and --check-deleted are no longer supported by rkhunter
* Fixed #1471: chkrootkit should be in lenny / hardy
* Updated Chinese (simplified)
* Updated German
* Fixed #1475: typo on installation (ispcp-setup)
* Fixed: default user for rkhunter.log

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/ispcp-lib.php';
22
23 check_login(__FILE__);
24
25 /* do we have a proper delete_id ? */
26
27 if (!isset($_GET['delete_lang'])) {
28
29     header( "Location: multilanguage.php" );
30
31     die();
32 }
33
34 $delete_lang = $_GET['delete_lang'];
35
36 if ($delete_lang == Config::get('USER_INITIAL_LANG')) {
37     /* ERR - we have domain that use this ip */
38
39     set_page_message('Error we can\'t delete system default language!');
40
41     header( "Location: multilanguage.php" );
42     die();
43 }
44
45 /* check if some one still use that lang */
46
47 $query = <<<SQL_QUERY
48     select
49         *
50     from
51          user_gui_props
52     where
53         lang = ?
54 SQL_QUERY;
55
56 $rs = exec_query($sql, $query, array($delete_lang));
57
58 if ($rs -> RecordCount () > 0) {
59     /* ERR - we have domain that use this ip */
60
61     set_page_message('Error we have user that uses that language!');
62
63     header( "Location: multilanguage.php" );
64     die();
65 }
66
67
68 $query = <<<SQL_QUERY
69     drop table $delete_lang
70 SQL_QUERY;
71
72 $rs = exec_query($sql, $query, array());
73
74 write_log(sprintf("%s removed language: %s", $_SESSION['user_logged'], $delete_lang));
75
76 set_page_message('Language was removed!');
77
78 header( "Location: multilanguage.php" );
79 die();
80
81 ?>
Note: See TracBrowser for help on using the browser.