root/trunk/gui/reseller/alias_order.php

Revision 1327, 3.2 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 $theme_color = Config::get('USER_INITIAL_THEME');
26
27 if(isset($_GET['action']) && $_GET['action'] === "delete") {
28
29     if(isset($_GET['del_id']) && !empty($_GET['del_id']))
30         $del_id = $_GET['del_id'];
31     else{
32         $_SESSION['orderaldel'] = '_no_';
33         header("Location: alias.php");
34         die();
35     }
36
37     $query = "DELETE FROM domain_aliasses WHERE alias_id=?";
38     $rs = exec_query($sql, $query, $del_id);
39
40     // delete "ordered"/pending email accounts
41     $domain_id = who_owns_this($del_id, 'als_id', true);
42     $query = "DELETE FROM mail_users WHERE sub_id=? AND domain_id = ? AND status=? AND mail_type LIKE 'alias%'";
43     $rs = exec_query($sql, $query, array($del_id, $domain_id, Config::get('ITEM_ORDERED_STATUS')));
44
45     header("Location: alias.php");
46     die();
47
48 } else if (isset($_GET['action']) && $_GET['action'] === "activate") {
49
50     if(isset($_GET['act_id']) && !empty($_GET['act_id']))
51         $act_id = $_GET['act_id'];
52     else{
53         $_SESSION['orderalact'] = '_no_';
54         header("Location: alias.php");
55         die();
56     }
57     $query = "SELECT alias_name FROM domain_aliasses WHERE alias_id=?";
58     $rs = exec_query($sql, $query, $act_id);
59     if ($rs -> RecordCount() == 0) {
60         header('Location: alias.php');
61         die();
62     }
63     $alias_name = $rs -> fields['alias_name'];
64
65     $query = "UPDATE domain_aliasses SET alias_status='toadd' WHERE alias_id=?";
66     $rs = exec_query($sql, $query, $act_id);
67
68     $domain_id = who_owns_this($act_id, 'als_id', true);
69     $query = 'SELECT `email` FROM `admin`, `domain` WHERE `admin`.`admin_id` = `domain`.`domain_admin_id` AND `domain`.`domain_id`= ?';
70     $rs = exec_query($sql, $query, $domain_id);
71     if ($rs -> RecordCount() == 0) {
72         header('Location: alias.php');
73         die();
74     }
75     $user_email = $rs -> fields['email'];
76     // Create the 3 default addresses if wanted
77     if (Config::get('CREATE_DEFAULT_EMAIL_ADDRESSES')) client_mail_add_default_accounts($domain_id, $user_email, $alias_name, 'alias', $act_id);
78
79     // enable "ordered"/pending email accounts
80 // ??? are there pending mail_adresses ???, joximu
81     $query = "UPDATE mail_users SET status=? WHERE sub_id=? AND domain_id = ? AND status=? AND mail_type LIKE 'alias%'";
82     $rs = exec_query($sql, $query, array(Config::get('ITEM_ADD_STATUS'), $act_id, $domain_id, Config::get('ITEM_ORDERED_STATUS')));
83
84     send_request();
85
86     $admin_login = $_SESSION['user_logged'];
87
88     write_log("$admin_login: domain alias activated: $alias_name.");
89
90     set_page_message(tr('Alias scheduled for activation!'));
91
92     $_SESSION['orderalact'] = '_yes_';
93     header("Location: alias.php");
94     die();
95
96 } else {
97     header("Location: alias.php");
98     die();
99 }
100
101 ?>
Note: See TracBrowser for help on using the browser.