Enable wildcard domain in IspCP

Posted: เมษายน 22, 2010 in ไม่มีหมวดหมู่
IspCp not support for wildcard domain.
when you try to Add DNS zone’s record name *.yourdomain.com

Cannot validate A record. Reason ‘Use of disallowed char("*") in NAME’.

To Solve this, we need to
Edit function validate_NAME :

vi /var/www/ispcp/gui/client/dns_edit.php

add this :

function validate_NAME($domain, &$err) {
        if($domain[‘name’]=="*"){
                return true;
        }
        if (preg_match(‘~([^-a-z,A-Z,0-9.])~u’, $domain[‘name’], $e)) {
                $err .= sprintf(tr(‘Use of disallowed char("%s") in NAME’), $e[1]);
                return false;
        }
        if (preg_match(‘/\.$/’, $domain[‘name’])) {
                if (!preg_match(‘/’.str_replace(‘.’, ‘\.’, $domain[‘domain’]).’\.$/’, $domain[‘name’])) {
                        $err .= sprintf(tr(‘Record "%s" is not part of domain "%s".’, $domain[‘name’], $domain[‘domain’]));
                        return false;
                }
        }
        return true;
}

Now you can add wildcard domain.

Advertisements

ใส่ความเห็น

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / เปลี่ยนแปลง )

Twitter picture

You are commenting using your Twitter account. Log Out / เปลี่ยนแปลง )

Facebook photo

You are commenting using your Facebook account. Log Out / เปลี่ยนแปลง )

Google+ photo

You are commenting using your Google+ account. Log Out / เปลี่ยนแปลง )

Connecting to %s