Exemplo n.º 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);
}
Exemplo n.º 2
0
function gen_edituser_page(&$tpl)
{
    global $dmn_user_name;
    global $user_email, $customer_id, $first_name;
    global $last_name, $firm, $zip;
    global $city, $country, $street_one;
    global $street_two, $mail, $phone;
    global $fax;
    if ($customer_id == NULL) {
        $customer_id = '';
    }
    // Fill in the fileds
    $tpl->assign(array('VL_USERNAME' => $dmn_user_name, 'VL_USR_PASS' => '', 'VL_USR_PASS_REP' => '', 'VL_MAIL' => $user_email, 'VL_USR_ID' => $customer_id, 'VL_USR_NAME' => $first_name, 'VL_LAST_USRNAME' => $last_name, 'VL_USR_FIRM' => $firm, 'VL_USR_POSTCODE' => $zip, 'VL_USRCITY' => $city, 'VL_COUNTRY' => $country, 'VL_STREET1' => $street_one, 'VL_STREET2' => $street_two, 'VL_MAIL' => $mail, 'VL_PHONE' => $phone, 'VL_FAX' => $fax));
    generate_ip_list($tpl, $_SESSION['user_id']);
}
Exemplo n.º 3
0
function gen_order_details(&$tpl, &$sql, $user_id, $order_id)
{
    $query = <<<SQL_QUERY
        select
            *
        from
            orders
        where
           id = ?
\t\tand
\t\t\tuser_id = ?
\t\t\t
SQL_QUERY;
    $rs = exec_query($sql, $query, array($order_id, $user_id));
    if ($rs->RecordCount() == 0) {
        set_page_message(tr('Permission deny!'));
        Header("Location: orders.php");
        die;
    }
    $plan_id = $rs->fields['plan_id'];
    global $cfg;
    $date_formt = $cfg['DATE_FORMAT'];
    $date = date($date_formt, $rs->fields['date']);
    if (isset($_POST['uaction'])) {
        $domain_name = $_POST['domain'];
        $customer_id = $_POST['customer_id'];
        $fname = $_POST['fname'];
        $lname = $_POST['lname'];
        $firm = $_POST['firm'];
        $zip = $_POST['zip'];
        $city = $_POST['city'];
        $country = $_POST['country'];
        $street1 = $_POST['street1'];
        $street2 = $_POST['street2'];
        $email = $_POST['email'];
        $phone = $_POST['phone'];
        $fax = $_POST['fax'];
    } else {
        $domain_name = $rs->fields['domain_name'];
        $customer_id = $rs->fields['customer_id'];
        $fname = $rs->fields['fname'];
        $lname = $rs->fields['lname'];
        $firm = $rs->fields['firm'];
        $zip = $rs->fields['zip'];
        $city = $rs->fields['city'];
        $country = $rs->fields['country'];
        $email = $rs->fields['email'];
        $phone = $rs->fields['phone'];
        $fax = $rs->fields['fax'];
        $street1 = $rs->fields['street1'];
        $street2 = $rs->fields['street2'];
    }
    $query = <<<SQL_QUERY
        select
            name, description
        from
            hosting_plans
        where
           id = ?
\t\t\t
SQL_QUERY;
    $rs = exec_query($sql, $query, array($plan_id));
    $plan_name = $rs->fields['name'] . "<br>" . $rs->fields['description'];
    generate_ip_list($tpl, $_SESSION['user_id']);
    if ($customer_id === NULL) {
        $customer_id = '';
    }
    $tpl->assign(array('ID' => $order_id, 'DATE' => $date, 'HP' => $plan_name, 'DOMAINNAME' => $domain_name, 'CUSTOMER_ID' => $customer_id, 'FNAME' => $fname, 'LNAME' => $lname, 'FIRM' => $firm, 'ZIP' => $zip, 'CITY' => $city, 'COUNTRY' => $country, 'EMAIL' => $email, 'PHONE' => $phone, 'FAX' => $fax, 'STREET1' => $street1, 'STREET2' => $street2));
}
Exemplo n.º 4
0
/**
 * Show user data
 * @param EasySCP_TemplateEngine $tpl
 */
function gen_editdomain_page($tpl)
{
    global $domain_name, $domain_expires, $domain_ip, $php_sup, $phpe_sup;
    global $cgi_supp, $ssl_supp, $sub, $als;
    global $mail, $ftp, $sql_db;
    global $sql_user, $traff, $disk;
    global $username, $allowbackup, $countbackup;
    global $dns_supp;
    $cfg = EasySCP_Registry::get('Config');
    // Fill in the fields
    $domain_name = decode_idna($domain_name);
    $username = decode_idna($username);
    generate_ip_list($tpl, $_SESSION['user_id']);
    if ($allowbackup === 'dmn') {
        $tpl->assign(array('BACKUP_DOMAIN' => $cfg->HTML_SELECTED, 'BACKUP_SQL' => '', 'BACKUP_FULL' => '', 'BACKUP_NO' => ''));
    } else {
        if ($allowbackup === 'sql') {
            $tpl->assign(array('BACKUP_DOMAIN' => '', 'BACKUP_SQL' => $cfg->HTML_SELECTED, 'BACKUP_FULL' => '', 'BACKUP_NO' => ''));
        } else {
            if ($allowbackup === 'full') {
                $tpl->assign(array('BACKUP_DOMAIN' => '', 'BACKUP_SQL' => '', 'BACKUP_FULL' => $cfg->HTML_SELECTED, 'BACKUP_NO' => ''));
            } else {
                if ($allowbackup === 'no') {
                    $tpl->assign(array('BACKUP_DOMAIN' => '', 'BACKUP_SQL' => '', 'BACKUP_FULL' => '', 'BACKUP_NO' => $cfg->HTML_SELECTED));
                }
            }
        }
    }
    list($rsub_max, $rals_max, $rmail_max, $rftp_max, $rsql_db_max, $rsql_user_max) = check_reseller_permissions($_SESSION['user_id'], 'all_permissions');
    if ($rsub_max == "-1") {
        $tpl->assign('ALIAS_EDIT', '');
    }
    if ($rals_max == "-1") {
        $tpl->assign('SUBDOMAIN_EDIT', '');
    }
    if ($rmail_max == "-1") {
        $tpl->assign('MAIL_EDIT', '');
    }
    if ($rftp_max == "-1") {
        $tpl->assign('FTP_EDIT', '');
    }
    if ($rsql_db_max == "-1") {
        $tpl->assign('SQL_DB_EDIT', '');
    }
    if ($rsql_user_max == "-1") {
        $tpl->assign('SQL_USER_EDIT', '');
    }
    $tpl->assign(array('PHP_YES' => $php_sup == 'yes' ? $cfg->HTML_SELECTED : '', 'PHP_NO' => $php_sup != 'yes' ? $cfg->HTML_SELECTED : '', 'PHP_EDIT_YES' => $phpe_sup == 'yes' ? $cfg->HTML_SELECTED : '', 'PHP_EDIT_NO' => $phpe_sup != 'yes' ? $cfg->HTML_SELECTED : '', 'CGI_YES' => $cgi_supp == 'yes' ? $cfg->HTML_SELECTED : '', 'CGI_NO' => $cgi_supp != 'yes' ? $cfg->HTML_SELECTED : '', 'SSL_YES' => $ssl_supp == 'yes' ? $cfg->HTML_SELECTED : '', 'SSL_NO' => $ssl_supp != 'yes' ? $cfg->HTML_SELECTED : '', 'DNS_YES' => $dns_supp == 'yes' ? $cfg->HTML_SELECTED : '', 'DNS_NO' => $dns_supp != 'yes' ? $cfg->HTML_SELECTED : '', 'BACKUPCOUNT_YES' => $countbackup == 'yes' ? $cfg->HTML_CHECKED : '', 'BACKUPCOUNT_NO' => $countbackup != 'yes' ? $cfg->HTML_CHECKED : '', 'VL_EXPIRE_DATE_DISABLED' => $domain_expires == 0 ? $cfg->HTML_DISABLED : '', 'VL_EXPIRE_NEVER_SELECTED' => $domain_expires == 0 ? $cfg->HTML_CHECKED : '', 'VL_DOMAIN_NAME' => tohtml($domain_name), 'VL_DOMAIN_EXPIRE' => $domain_expires, 'VL_DOMAIN_IP' => $domain_ip, 'VL_DOM_SUB' => $sub, 'VL_DOM_ALIAS' => $als, 'VL_DOM_MAIL_ACCOUNT' => $mail, 'VL_FTP_ACCOUNTS' => $ftp, 'VL_SQL_DB' => $sql_db, 'VL_SQL_USERS' => $sql_user, 'VL_TRAFFIC' => $traff, 'VL_DOM_DISK' => $disk, 'VL_USER_NAME' => tohtml($username)));
}
Exemplo n.º 5
0
/**
 * Show user data
 * @param EasySCP_TemplateEngine $tpl
 */
function gen_edituser_page($tpl)
{
    global $dmn_user_name, $user_email, $customer_id, $first_name, $last_name, $firm, $zip, $gender, $city, $state, $country, $street_one, $street_two, $phone, $fax;
    $cfg = EasySCP_Registry::get('Config');
    if ($customer_id == NULL) {
        $customer_id = '';
    }
    // Fill in the fields
    $tpl->assign(array('VL_USERNAME' => tohtml(decode_idna($dmn_user_name)), 'VL_MAIL' => empty($user_email) ? '' : tohtml($user_email), 'VL_USR_ID' => empty($customer_id) ? '' : tohtml($customer_id), 'VL_USR_NAME' => empty($first_name) ? '' : tohtml($first_name), 'VL_LAST_USRNAME' => empty($last_name) ? '' : tohtml($last_name), 'VL_USR_FIRM' => empty($firm) ? '' : tohtml($firm), 'VL_USR_POSTCODE' => empty($zip) ? '' : tohtml($zip), 'VL_USRCITY' => empty($city) ? '' : tohtml($city), 'VL_USRSTATE' => empty($state) ? '' : tohtml($state), 'VL_COUNTRY' => empty($country) ? '' : tohtml($country), 'VL_STREET1' => empty($street_one) ? '' : tohtml($street_one), 'VL_STREET2' => empty($street_two) ? '' : tohtml($street_two), 'VL_MALE' => $gender == 'M' ? $cfg->HTML_SELECTED : '', 'VL_FEMALE' => $gender == 'F' ? $cfg->HTML_SELECTED : '', 'VL_UNKNOWN' => $gender == 'U' ? $cfg->HTML_SELECTED : '', 'VL_PHONE' => empty($phone) ? '' : tohtml($phone), 'VL_FAX' => empty($fax) ? '' : tohtml($fax)));
    generate_ip_list($tpl, $_SESSION['user_id']);
}
Exemplo n.º 6
0
function gen_au3_page(&$tpl)
{
    global $dmn_name, $hpid, $dmn_user_name;
    global $user_email, $customer_id, $first_name;
    global $last_name, $firm, $zip;
    global $city, $country, $street_one;
    global $street_two, $mail, $phone;
    global $fax;
    $timestamp = time();
    $genpas = substr(md5($timestamp), 0, 6);
    $dmn_user_name = decode_idna($dmn_user_name);
    // Fill in the fileds
    $tpl->assign(array('VL_USERNAME' => $dmn_user_name, 'VL_USR_PASS' => $genpas, 'VL_USR_PASS_REP' => $genpas, 'VL_MAIL' => $user_email, 'VL_USR_ID' => $customer_id, 'VL_USR_NAME' => $first_name, 'VL_LAST_USRNAME' => $last_name, 'VL_USR_FIRM' => $firm, 'VL_USR_POSTCODE' => $zip, 'VL_USRCITY' => $city, 'VL_COUNTRY' => $country, 'VL_STREET1' => $street_one, 'VL_STREET2' => $street_two, 'VL_MAIL' => $mail, 'VL_PHONE' => $phone, 'VL_FAX' => $fax));
    generate_ip_list($tpl, $_SESSION['user_id']);
    $_SESSION['local_data'] = "{$dmn_name};{$hpid}";
}
Exemplo n.º 7
0
/**
 * generate page add user 3
 * @param EasySCP_TemplateEngine $tpl
 */
function gen_user_add3_page($tpl)
{
    global $dmn_name, $hpid, $dmn_user_name, $user_email, $customer_id, $first_name, $last_name, $gender, $firm, $zip, $city, $state, $country, $street_one, $street_two, $phone, $fax;
    $cfg = EasySCP_Registry::get('Config');
    $dmn_user_name = decode_idna($dmn_user_name);
    // Fill in the fields
    $tpl->assign(array('VL_USERNAME' => tohtml($dmn_user_name), 'VL_USR_PASS' => passgen(), 'VL_MAIL' => tohtml($user_email), 'VL_USR_ID' => $customer_id, 'VL_USR_NAME' => tohtml($first_name), 'VL_LAST_USRNAME' => tohtml($last_name), 'VL_USR_FIRM' => tohtml($firm), 'VL_USR_POSTCODE' => tohtml($zip), 'VL_USRCITY' => tohtml($city), 'VL_USRSTATE' => tohtml($state), 'VL_MALE' => $gender == 'M' ? $cfg->HTML_SELECTED : '', 'VL_FEMALE' => $gender == 'F' ? $cfg->HTML_SELECTED : '', 'VL_UNKNOWN' => $gender == 'U' ? $cfg->HTML_SELECTED : '', 'VL_COUNTRY' => tohtml($country), 'VL_STREET1' => tohtml($street_one), 'VL_STREET2' => tohtml($street_two), 'VL_PHONE' => tohtml($phone), 'VL_FAX' => tohtml($fax)));
    generate_ip_list($tpl, $_SESSION['user_id']);
    $_SESSION['local_data'] = "{$dmn_name};{$hpid}";
}
Exemplo n.º 8
0
function gen_editdomain_page(&$tpl)
{
    global $domain_name, $domain_ip, $php_sup;
    global $cgi_supp, $sub, $als;
    global $mail, $ftp, $sql_db;
    global $sql_user, $traff, $disk;
    global $username;
    // Fill in the fileds
    $domain_name = decode_idna($domain_name);
    $username = decode_idna($username);
    generate_ip_list($tpl, $_SESSION['user_id']);
    if ($php_sup === 'yes') {
        $tpl->assign(array('PHP_YES' => 'selected', 'PHP_NO' => ''));
    } else {
        $tpl->assign(array('PHP_YES' => '', 'PHP_NO' => 'selected'));
    }
    if ($cgi_supp === 'yes') {
        $tpl->assign(array('CGI_YES' => 'selected', 'CGI_NO' => ''));
    } else {
        $tpl->assign(array('CGI_YES' => '', 'CGI_NO' => 'selected'));
    }
    $tpl->assign(array('VL_DOMAIN_NAME' => $domain_name, 'VL_DOMAIN_IP' => $domain_ip, 'VL_DOM_SUB' => $sub, 'VL_DOM_ALIAS' => $als, 'VL_DOM_MAIL_ACCOUNT' => $mail, 'VL_FTP_ACCOUNTS' => $ftp, 'VL_SQL_DB' => $sql_db, 'VL_SQL_USERS' => $sql_user, 'VL_TRAFFIC' => $traff, 'VL_DOM_DISK' => $disk, 'VL_USER_NAME' => $username));
}
Exemplo n.º 9
0
/**
 * 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);
}