header("Location: manage_users.php"); die; } // so we have domain id and lets disable or enable it $domain_id = $_GET['domain_id']; // hopa tropa - check statsu to know if have to disable or enable it $query = <<<SQL_QUERY select domain_name, domain_status from domain where domain_id = ? SQL_QUERY; $rs = exec_query($sql, $query, array($domain_id)); $location = 'admin'; if ($rs->fields['domain_status'] == $cfg['ITEM_OK_STATUS']) { //disable_domain ($sql, $domain_id, $rs -> fields['domain_name']); $action = "disable"; change_domain_status(&$sql, $domain_id, $rs->fields['domain_name'], $action, $location); } else { if ($rs->fields['domain_status'] == $cfg['ITEM_DISABLED_STATUS']) { //enable_domain ($sql, $domain_id, $rs -> fields['domain_name']); $action = "enable"; change_domain_status(&$sql, $domain_id, $rs->fields['domain_name'], $action, $location); } else { header("Location: manage_users.php"); die; } }
* EasySCP a Virtual Hosting Control Panel * Copyright (C) 2010-2016 by Easy Server Control Panel - http://www.easyscp.net * * This work is licensed under the Creative Commons Attribution-NoDerivs 3.0 Unported License. * To view a copy of this license, visit http://creativecommons.org/licenses/by-nd/3.0/. * * @link http://www.easyscp.net * @author EasySCP Team */ require '../../include/easyscp-lib.php'; check_login(__FILE__); $cfg = EasySCP_Registry::get('Config'); if (!isset($_GET['domain_id'])) { user_goto('manage_users.php'); } if (!is_numeric($_GET['domain_id'])) { user_goto('manage_users.php'); } $sql_param = array(':domain_id' => $_GET['domain_id']); $sql_query = "\n\tSELECT\n\t\tdomain_name, status\n\tFROM\n\t\tdomain\n\tWHERE\n\t\tdomain_id = :domain_id\n"; DB::prepare($sql_query); $row = DB::execute($sql_param, true); if ($row['status'] == $cfg->ITEM_OK_STATUS) { change_domain_status($_GET['domain_id'], $row['domain_name'], 'disable', 'admin'); } else { if ($row['status'] == $cfg->ITEM_DISABLED_STATUS) { change_domain_status($_GET['domain_id'], $row['domain_name'], 'enable', 'admin'); } else { user_goto('manage_users.php'); } }
* by moleSoftware GmbH. All Rights Reserved. * * Portions created by the ispCP Team are Copyright (C) 2006-2010 by * isp Control Panel. All Rights Reserved. * * Portions created by the i-MSCP Team are Copyright (C) 2010-2015 by * i-MSCP - internet Multi Server Control Panel. All Rights Reserved. */ /*********************************************************************************************************************** * Main */ // Include core library require 'imscp-lib.php'; iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onAdminScriptStart); check_login('admin'); if (isset($_GET['domain_id'])) { $domainId = intval($_GET['domain_id']); $stmt = exec_query('SELECT domain_admin_id, domain_status FROM domain WHERE domain_id = ?', $domainId); if ($stmt->rowCount()) { $row = $stmt->fetchRow(PDO::FETCH_ASSOC); if ($row['domain_status'] == 'ok') { change_domain_status($row['domain_admin_id'], 'deactivate'); } elseif ($row['domain_status'] == 'disabled') { change_domain_status($row['domain_admin_id'], 'activate'); } else { showBadRequestErrorPage(); } redirectTo('manage_users.php'); } } showBadRequestErrorPage();
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nd/3.0/. * * @link http://www.easyscp.net * @author EasySCP Team */ require '../../include/easyscp-lib.php'; check_login(__FILE__); $cfg = EasySCP_Registry::get('Config'); if (!isset($_GET['domain_id'])) { user_goto('users.php?psi=last'); } if (!is_numeric($_GET['domain_id'])) { user_goto('users.php?psi=last'); } $sql_param = array(':domain_id' => $_GET['domain_id']); $sql_query = "\n\tSELECT\n\t\tdomain_name, status, domain_created_id\n\tFROM\n\t\tdomain\n\tWHERE\n\t\tdomain_id = :domain_id\n"; DB::prepare($sql_query); $row = DB::execute($sql_param, true); // let's check if this reseller has rights to disable/enable this domain if ($row['domain_created_id'] != $_SESSION['user_id']) { user_goto('users.php?psi=last'); } if ($row['status'] == $cfg->ITEM_OK_STATUS) { change_domain_status($_GET['domain_id'], $row['domain_name'], 'disable', 'reseller'); } else { if ($row['status'] == $cfg->ITEM_DISABLED_STATUS) { change_domain_status($_GET['domain_id'], $row['domain_name'], 'enable', 'reseller'); } else { user_goto('users.php?psi=last'); } }