}
}
//
// common page data.
//
// check User sql permision
if (isset($_SESSION['subdomain_support']) && $_SESSION['subdomain_support'] == "no") {
    header("Location: index.php");
}
global $cfg;
$theme_color = $cfg['USER_INITIAL_THEME'];
$tpl->assign(array('TR_CLIENT_ADD_SUBDOMAIN_PAGE_TITLE' => tr('VHCS - Client/Add Subdomain'), 'THEME_COLOR_PATH' => "../themes/{$theme_color}", 'THEME_CHARSET' => tr('encoding'), 'TID' => $_SESSION['layout_id'], 'VHCS_LICENSE' => $cfg['VHCS_LICENSE'], 'ISP_LOGO' => get_logo($_SESSION['user_id'])));
//
// dynamic page data.
//
$dmn_name = check_subdomain_permissions($sql, $_SESSION['user_id']);
gen_user_add_subdomain_data($tpl, $sql, $_SESSION['user_id']);
check_subdomain_data($tpl, $sql, $_SESSION['user_id']);
//
// static page messages.
//
gen_client_menu($tpl);
gen_logged_from($tpl);
check_permissions($tpl);
$tpl->assign(array('TR_ADD_SUBDOMAIN' => tr('Add subdomain'), 'TR_SUBDOMAIN_DATA' => tr('Subdomain data'), 'TR_SUBDOMAIN_NAME' => tr('Subdomain name'), 'TR_DIR_TREE_SUBDOMAIN_MOUNT_POINT' => tr('Directory tree<br>mount point'), 'TR_ADD' => tr('Add')));
gen_page_message($tpl);
$tpl->parse('PAGE', 'page');
$tpl->prnt();
if (isset($cfg['DUMP_GUI_DEBUG'])) {
    dump_gui_debug();
}
Beispiel #2
0
// Dispatch Request
if (isset($_POST['uaction'])) {
    if ($_POST['uaction'] == 'toASCII') {
        // Ajax request
        header('Content-Type: text/plain; charset=utf-8');
        header('Cache-Control: no-cache, private');
        // backward compatibility for HTTP/1.0
        header('Pragma: no-cache');
        header("HTTP/1.0 200 Ok");
        // Todo check return value here before echo...
        echo "/" . encode_idna(strtolower($_POST['subdomain']));
        exit;
    } elseif ($_POST['uaction'] == 'add_subd') {
        $dmn_name = check_subdomain_permissions($_SESSION['user_id']);
        gen_user_add_subdomain_data($tpl, $_SESSION['user_id']);
        check_subdomain_data($err_txt, $_SESSION['user_id'], $dmn_name);
    } else {
        throw new EasySCP_Exception(tr("Error: unknown action!" . " " . $_POST['uaction']));
    }
} else {
    // Default view
    gen_user_add_subdomain_data($tpl, $_SESSION['user_id']);
}
// static page messages.
gen_logged_from($tpl);
check_permissions($tpl);
$tpl->assign(array('TR_PAGE_TITLE' => tr('EasySCP - Client/Add Subdomain'), 'TR_ADD_SUBDOMAIN' => tr('Add subdomain'), 'TR_SUBDOMAIN_DATA' => tr('Subdomain data'), 'TR_SUBDOMAIN_NAME' => tr('Subdomain name'), 'TR_DIR_TREE_SUBDOMAIN_MOUNT_POINT' => tr('Directory tree mount point'), 'TR_SUBDOMAIN_ASSIGNMENT' => tr('Select an available subdomain'), 'TR_FORWARD' => tr('Forward to URL'), 'TR_ADD' => tr('Add'), 'TR_DMN_HELP' => tr("You do not need 'www.' EasySCP will add it on its own."), 'TR_ENABLE_FWD' => tr('Enable Forward'), 'TR_ENABLE' => tr('Enable'), 'TR_DISABLE' => tr('Disable'), 'TR_PREFIX_HTTP' => 'http://', 'TR_PREFIX_HTTPS' => 'https://', 'TR_PREFIX_FTP' => 'ftp://', 'TR_MNT_POINT_HELP' => tr('Path is relativ to your root directory. The mount point will contain a subfolder named htdocs.'), 'TR_SUBDMN_ASSIGN_HELP' => tr('A new alias subdomain has to be assigned to an existing real subdomain.')));
gen_client_mainmenu($tpl, 'client/main_menu_manage_domains.tpl');
gen_client_menu($tpl, 'client/menu_manage_domains.tpl');
gen_page_msg($tpl, $err_txt);
if ($cfg->DUMP_GUI_DEBUG) {