root/trunk/gui/admin/domain_status_change.php

Revision 1283, 1.6 kB (checked in by scitech, 4 months ago)

Cleaning gui/admin/domain_status_change.php

Line 
1 <?php
2 /**
3  *  ispCP (OMEGA) - Virtual Hosting Control System | Omega Version
4  *
5  *  @copyright     2001-2006 by moleSoftware GmbH
6  *  @copyright     2006-2008 by ispCP | http://isp-control.net
7  *  @link         http://isp-control.net
8  *  @author        ispCP Team (2007)
9  *
10  *  @license
11  *  This program is free software; you can redistribute it and/or modify it under
12  *  the terms of the MPL General Public License as published by the Free Software
13  *  Foundation; either version 1.1 of the License, or (at your option) any later
14  *  version.
15  *  You should have received a copy of the MPL Mozilla Public License along with
16  *  this program; if not, write to the Open Source Initiative (OSI)
17  *  http://opensource.org | osi@opensource.org
18  **/
19
20 require '../include/ispcp-lib.php';
21 check_login(__FILE__);
22
23 if (!isset($_GET['domain_id'])) {
24     header( "Location: manage_users.php" );
25     die();
26 }
27
28 if (!is_numeric($_GET['domain_id'])) {
29     header( "Location: manage_users.php" );
30      die();
31 }
32
33 $domain_id = $_GET['domain_id'];
34
35 $query = <<<SQL_QUERY
36     SELECT
37         `domain_name`,
38         `domain_status`
39     FROM
40         `domain`
41     WHERE
42         `domain_id` = ?
43 SQL_QUERY;
44
45 $rs = exec_query($sql, $query, array($domain_id));
46
47 $location = 'admin';
48
49 if ($rs -> fields['domain_status'] ==  Config::get('ITEM_OK_STATUS')) {
50     $action = "disable";
51     change_domain_status(&$sql, $domain_id, $rs -> fields['domain_name'], $action, $location);
52 } else if ($rs -> fields['domain_status'] == Config::get('ITEM_DISABLED_STATUS')) {
53     $action = "enable";
54     change_domain_status(&$sql, $domain_id, $rs -> fields['domain_name'], $action, $location);
55 } else {
56     header( "Location: manage_users.php" );
57     die();
58 }
59 ?>
Note: See TracBrowser for help on using the browser.