コード例 #1
0
function gen_al_page(&$tpl, $reseller_id)
{
    global $cr_user_id, $alias_name, $domain_ip, $forward, $mount_point;
    if (isset($_POST['forward'])) {
        $forward = $_POST['forward'];
    } else {
        $forward = 'no';
    }
    $tpl->assign(array('DOMAIN' => $alias_name, 'MP' => $mount_point, 'FORWARD' => $forward));
    generate_ip_list($tpl, $reseller_id);
    gen_users_list($tpl, $reseller_id);
}
コード例 #2
0
ファイル: alias_add.php プロジェクト: gOOvER/EasySCP
/**
 * Show data fields
 *
 * @global string $alias_name
 * @global string $forward
 * @global string $forward_prefix
 * @global string $mount_point
 * @param EasySCP_TemplateEngine $tpl
 * @param int $reseller_id
 */
function gen_al_page($tpl, $reseller_id)
{
    global $alias_name, $forward, $forward_prefix, $mount_point;
    $sql = EasySCP_Registry::get('Db');
    $cfg = EasySCP_Registry::get('Config');
    list(, , , , , , $uals_current) = generate_reseller_user_props($reseller_id);
    list(, , , , , $rals_max) = get_reseller_default_props($sql, $reseller_id);
    if ($uals_current >= $rals_max && $rals_max != "0") {
        $_SESSION['almax'] = '_yes_';
        user_goto('alias.php');
    }
    if (isset($_POST['status']) && $_POST['status'] == 1) {
        $forward_prefix = clean_input($_POST['forward_prefix']);
        if ($_POST['status'] == 1) {
            $check_en = $cfg->HTML_CHECKED;
            $check_dis = '';
            $forward = encode_idna(strtolower(clean_input($_POST['forward'])));
            $tpl->assign(array('READONLY_FORWARD' => '', 'DISABLE_FORWARD' => ''));
        } else {
            $check_en = '';
            $check_dis = $cfg->HTML_CHECKED;
            $forward = '';
            $tpl->assign(array('READONLY_FORWARD' => $cfg->HTML_READONLY, 'DISABLE_FORWARD' => $cfg->HTML_DISABLED));
        }
        $tpl->assign(array('HTTP_YES' => $forward_prefix === 'http://' ? $cfg->HTML_SELECTED : '', 'HTTPS_YES' => $forward_prefix === 'https://' ? $cfg->HTML_SELECTED : '', 'FTP_YES' => $forward_prefix === 'ftp://' ? $cfg->HTML_SELECTED : ''));
    } else {
        $check_en = '';
        $check_dis = $cfg->HTML_CHECKED;
        $forward = '';
        $tpl->assign(array('READONLY_FORWARD' => $cfg->HTML_READONLY, 'DISABLE_FORWARD' => $cfg->HTML_DISABLED, 'HTTP_YES' => '', 'HTTPS_YES' => '', 'FTP_YES' => ''));
    }
    $tpl->assign(array('DOMAIN' => tohtml(decode_idna($alias_name)), 'MP' => tohtml($mount_point), 'FORWARD' => tohtml(encode_idna($forward)), 'CHECK_EN' => $check_en, 'CHECK_DIS' => $check_dis));
    generate_ip_list($tpl, $reseller_id);
    gen_users_list($tpl, $reseller_id);
}