Пример #1
0
     }
     $ns2_ip = "NULL";
     #register_domain($domain, $ns1, $ns2, $ns1_ip, $ns2_ip);
     register_domain($domain);
     break;
 case "confirm_delete_domain":
     if (!isset($_POST['domain'])) {
         echo "Error. No domain specified.";
         die;
     }
     $domain = $_POST['domain'];
     if (!isset($_POST['delete'])) {
         echo "Error. Deletion validation failed.";
         die;
     }
     delete_domain($domain);
     break;
 case "delete_domain":
     $domain = $_POST['domain'];
     frm_delete_domain($domain);
     break;
 case "modify":
     if (!isset($_SESSION['userid'])) {
         die("Domain modification not allowed. You must be logged in.");
     }
     if (!isset($_REQUEST['domain'])) {
         die("Invalid domain request");
     }
     $domain = $_REQUEST['domain'];
     frm_view_domain($domain);
     break;
Пример #2
0
 * @author 		EasySCP Team
 */
require '../../include/easyscp-lib.php';
check_login(__FILE__);
$cfg = EasySCP_Registry::get('Config');
$tpl = EasySCP_TemplateEngine::getInstance();
$template = 'reseller/domain_delete.tpl';
if (isset($_SESSION['ddel']) && $_SESSION['ddel'] == "_yes_") {
    unset($_SESSION["ddel"]);
    user_goto('users.php?psi=last');
}
if (isset($_GET['domain_id']) && is_numeric($_GET['domain_id'])) {
    validate_domain_deletion(intval($_GET['domain_id']));
} else {
    if (isset($_POST['domain_id']) && is_numeric($_POST['domain_id']) && isset($_POST['delete']) && $_POST['delete'] == 1) {
        delete_domain((int) $_POST['domain_id'], 'users.php?psi=last', true);
    } else {
        set_page_message(tr('Wrong domain ID!'), 'error');
        user_goto('users.php?psi=last');
    }
}
// static page messages
gen_logged_from($tpl);
$tpl->assign(array('TR_PAGE_TITLE' => tr('EasySCP - Delete Domain')));
gen_reseller_mainmenu($tpl, 'reseller/main_menu_users_manage.tpl');
gen_reseller_menu($tpl, 'reseller/menu_users_manage.tpl');
gen_page_message($tpl);
if ($cfg->DUMP_GUI_DEBUG) {
    dump_gui_debug($tpl);
}
$tpl->display($template);
Пример #3
0
function delete_user($uid, $zones)
{
    global $db;
    if ($uid != $_SESSION['userid'] && !verify_permission('user_edit_others') || $uid == $_SESSION['userid'] && !verify_permission('user_edit_own')) {
        error(ERR_PERM_DEL_USER);
        return false;
    } else {
        if (is_array($zones)) {
            foreach ($zones as $zone) {
                if ($zone['target'] == "delete") {
                    delete_domain($zone['zid']);
                } elseif ($zone['target'] == "new_owner") {
                    add_owner_to_zone($zone['zid'], $zone['newowner']);
                }
            }
        }
        $query = "DELETE FROM zones WHERE owner = " . $db->quote($uid, 'integer');
        $response = $db->query($query);
        if (PEAR::isError($response)) {
            error($response->getMessage());
            return false;
        }
        $query = "DELETE FROM users WHERE id = " . $db->quote($uid, 'integer');
        $response = $db->query($query);
        if (PEAR::isError($response)) {
            error($response->getMessage());
            return false;
        }
    }
    return true;
}
Пример #4
0
}
$confirm = "-1";
if (isset($_GET['confirm']) && v_num($_GET['confirm'])) {
    $confirm = $_GET['confirm'];
}
$zone_info = get_zone_info_from_id($zone_id);
$zone_owners = get_fullnames_owners_from_domainid($zone_id);
$user_is_zone_owner = verify_user_is_owner_zoneid($zone_id);
if ($zone_id == "-1") {
    error(ERR_INV_INPUT);
    include_once "inc/footer.inc.php";
    exit;
}
echo "     <h2>" . _('Delete zone') . " \"" . $zone_info['name'] . "\"</h2>\n";
if ($confirm == '1') {
    if (delete_domain($zone_id)) {
        success(SUC_ZONE_DEL);
    }
} else {
    if ($perm_edit == "all" || $perm_edit == "own" && $user_is_zone_owner == "1") {
        echo "      " . _('Owner') . ": " . $zone_owners . "<br>\n";
        echo "      " . _('Type') . ": " . $zone_info['type'] . "\n";
        if ($zone_info['type'] == "SLAVE") {
            $slave_master = get_domain_slave_master($zone_id);
            if (supermaster_exists($slave_master)) {
                echo "        <p>         \n";
                printf(_('You are about to delete a slave zone of which the master nameserver, %s, is a supermaster. Deleting the zone now, will result in temporary removal only. Whenever the supermaster sends a notification for this zone, it will be added again!'), $slave_master);
                echo "        </p>\n";
            }
        }
        echo "     <p>" . _('Are you sure?') . "</p>\n";
function process_delete_domain()
{
    // Delete a domain using the post data
    $domain_id = $_POST['domain_id'];
    delete_domain($domain_id);
    wp_redirect(admin_url('admin.php?page=pano_domain_settings'));
}
Пример #6
0
        if (add_domain($domain_name) == 0) {
            $_SESSION['message'] = $lang['text_domain_add_failed'];
        } else {
            $_SESSION['message'] = $lang['text_domain_added'];
        }
    }
} elseif (isset($_POST["delete"]) && isset($_POST['domains'])) {
    // Register the full set of POST variables.
    foreach ($_POST['domains'] as $value) {
        if (ctype_digit($value)) {
            $formVars[] = $value;
        }
    }
    // Don't allow the system default (@.) to be removed
    $select = "SELECT domain, id " . "FROM maia_domains " . "WHERE domain <> '@.' " . "AND id IN (" . implode(',', $formVars) . ")";
    $sth = $dbh->prepare($select);
    $res = $sth->execute();
    if (PEAR::isError($sth)) {
        die($sth->getMessage());
    }
    while ($row = $res->fetchrow()) {
        delete_domain($row["id"]);
        if ($_POST['deleteaddresses']) {
            $result = delete_domain_addresses($row['domain']);
        }
    }
    $sth->free();
}
// Return to the language administration page
header("Location: admindomains.php" . $sid);
exit;
Пример #7
0
}
// are you in the correct group?
if ($_SESSION['role_id'] < 2) {
    errormsg('Your role does not have access to this resource');
} else {
    if (isset($_POST['address_id'])) {
        // set the address_id variable from POST
        $address_id = $_POST['address_id'];
        // check the address_id exists
        if (get_domain_name($address_id, $mysqli)) {
            // set the client_name variable
            $domain_name = get_domain_name($address_id, $mysqli);
            // check if the domain has a transport map
            if (check_transport_map_exists($address_id, $mysqli) == false) {
                // no transport maps, remove domain
                if (delete_domain($address_id, $mysqli)) {
                    echo "\n\t\t\t\t\t<!-- Begin Content Division -->\n\t\t\t\t\t<div id='content'>\n\t\t\t\t\t<h2>Delete Domain</h2>\n\t\t\t\t\t<p>Domain '" . $domain_name . "' has been removed from the database.</p>\n\t\t\t\t\t<!-- End Content Division -->\n\t\t\t\t\t</div>\n\t\t\t\t";
                } else {
                    errormsg("Failed to delete record from the database");
                }
            } else {
                errormsg("There are transport maps for this domain. Can not remove domain.");
            }
        } else {
            errormsg("Not matching domain_name for this address_id. Already deleted?");
        }
    } elseif (!$_POST) {
        if (isset($_GET['id'])) {
            if (get_domain_name($_GET['id'], $mysqli)) {
                $selected_address_id = $_GET['id'];
            }
Пример #8
0
check_login(__FILE__);
$cfg = EasySCP_Registry::get('Config');
$tpl = EasySCP_TemplateEngine::getInstance();
$template = 'admin/user_delete.tpl';
if (isset($_GET['delete_id']) && is_numeric($_GET['delete_id'])) {
    if (validate_user_deletion(intval($_GET['delete_id']))) {
        delete_user(intval($_GET['delete_id']));
    } else {
        user_goto('manage_users.php');
    }
} else {
    if (isset($_GET['domain_id']) && is_numeric($_GET['domain_id'])) {
        validate_domain_deletion($tpl, intval($_GET['domain_id']));
    } else {
        if (isset($_POST['domain_id']) && is_numeric($_POST['domain_id']) && isset($_POST['delete']) && $_POST['delete'] == 1) {
            delete_domain((int) $_POST['domain_id'], 'manage_users.php');
        } else {
            if (isset($_POST['domain_id']) && is_numeric($_POST['domain_id'])) {
                set_page_message(tr('Domain deletion was aborted.'), 'info');
            } else {
                set_page_message(tr('Invlaid domain ID!'), 'error');
            }
            user_goto('manage_users.php');
        }
    }
}
// static page messages
$tpl->assign(array('TR_PAGE_TITLE' => tr('EasySCP - Delete Domain')));
gen_admin_mainmenu($tpl, 'admin/main_menu_users_manage.tpl');
gen_admin_menu($tpl, 'admin/menu_users_manage.tpl');
gen_page_message($tpl);