root/tags/omega-1.0.0-rc3/gui/reseller/domainaliasorder.php

Revision 880, 2.8 KB (checked in by raphael, 15 months ago)

Fixed #7: no user set to run awstats cronjobs
Fixed #796: let aliases share the same mount point with a subdomain
Fixed some issues with email forwarders (see #555)
Reduced number of entries in admin's log
Fixed #152: Add webmaster@… and postmaster@…

Line 
1<?php
2/**
3 * ispCP ω (OMEGA) a Virtual Hosting Control System
4 *
5 * @copyright     2001-2006 by moleSoftware GmbH
6 * @copyright     2006-2007 by ispCP | http://isp-control.net
7 * @version     SVN: $ID$
8 * @link         http://isp-control.net
9 * @author         ispCP Team (2007)
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
21require '../include/ispcp-lib.php';
22
23check_login(__FILE__);
24
25$theme_color = $cfg['USER_INITIAL_THEME'];
26
27if(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: domain_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, $cfg['ITEM_ORDERED_STATUS']));
44
45    header("Location: domain_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: domain_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: domain_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    // enable "ordered"/pending email accounts
69    $domain_id = who_owns_this($act_id, 'als_id', true);
70    $query = "UPDATE mail_users SET status=? WHERE sub_id=? AND domain_id = ? AND status=? AND mail_type LIKE 'alias%'";
71    $rs = exec_query($sql, $query, array($cfg['ITEM_ADD_STATUS'], $act_id, $domain_id, $cfg['ITEM_ORDERED_STATUS']));
72
73    send_request();
74
75    $admin_login = $_SESSION['user_logged'];
76
77    write_log("$admin_login: domain alias activated: $alias_name.");
78
79    set_page_message(tr('Alias scheduled for activation!'));
80
81    $_SESSION['orderalact'] = '_yes_';
82    header("Location: domain_alias.php");
83    die();
84
85} else {
86    header("Location: domain_alias.php");
87    die();
88}
89
90?>
Note: See TracBrowser for help on using the browser.