leave default-values for adding std-subdomain when adding customer from the parameters-array; do not require ipandports parameter when adding domain but rather default to system.defaultip if no ipandport is given
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -517,19 +517,9 @@ class Customers extends ApiCommand implements ResourceEntity
|
|||||||
'domain' => $_stdsubdomain,
|
'domain' => $_stdsubdomain,
|
||||||
'customerid' => $customerid,
|
'customerid' => $customerid,
|
||||||
'adminid' => $this->getUserDetail('adminid'),
|
'adminid' => $this->getUserDetail('adminid'),
|
||||||
'parentdomainid' => '0',
|
|
||||||
'docroot' => $documentroot,
|
'docroot' => $documentroot,
|
||||||
'adddate' => time(),
|
|
||||||
'phpenabled' => $phpenabled,
|
'phpenabled' => $phpenabled,
|
||||||
'zonefile' => '',
|
'openbasedir' => '1'
|
||||||
'isemaildomain' => '0',
|
|
||||||
'caneditdomain' => '0',
|
|
||||||
'openbasedir' => '1',
|
|
||||||
'speciallogfile' => '0',
|
|
||||||
'dkim_id' => '0',
|
|
||||||
'dkim_privkey' => '',
|
|
||||||
'dkim_pubkey' => '',
|
|
||||||
'ipandport' => explode(',', Settings::Get('system.defaultip'))
|
|
||||||
);
|
);
|
||||||
$domainid = - 1;
|
$domainid = - 1;
|
||||||
try {
|
try {
|
||||||
@@ -759,18 +749,9 @@ class Customers extends ApiCommand implements ResourceEntity
|
|||||||
'domain' => $_stdsubdomain,
|
'domain' => $_stdsubdomain,
|
||||||
'customerid' => $result['customerid'],
|
'customerid' => $result['customerid'],
|
||||||
'adminid' => $this->getUserDetail('adminid'),
|
'adminid' => $this->getUserDetail('adminid'),
|
||||||
'parentdomainid' => '0',
|
|
||||||
'docroot' => $result['documentroot'],
|
'docroot' => $result['documentroot'],
|
||||||
'adddate' => time(),
|
|
||||||
'phpenabled' => $phpenabled,
|
'phpenabled' => $phpenabled,
|
||||||
'zonefile' => '',
|
|
||||||
'isemaildomain' => '0',
|
|
||||||
'caneditdomain' => '0',
|
|
||||||
'openbasedir' => '1',
|
'openbasedir' => '1',
|
||||||
'speciallogfile' => '0',
|
|
||||||
'dkim_id' => '0',
|
|
||||||
'dkim_privkey' => '',
|
|
||||||
'dkim_pubkey' => '',
|
|
||||||
'ipandport' => explode(',', Settings::Get('system.defaultip'))
|
'ipandport' => explode(',', Settings::Get('system.defaultip'))
|
||||||
);
|
);
|
||||||
$domainid = - 1;
|
$domainid = - 1;
|
||||||
|
|||||||
@@ -97,9 +97,9 @@ class Domains extends ApiCommand implements ResourceEntity
|
|||||||
// parameters
|
// parameters
|
||||||
$p_domain = $this->getParam('domain');
|
$p_domain = $this->getParam('domain');
|
||||||
$customerid = intval($this->getParam('customerid'));
|
$customerid = intval($this->getParam('customerid'));
|
||||||
$p_ipandports = $this->getParam('ipandport');
|
|
||||||
|
|
||||||
// optional parameters
|
// optional parameters
|
||||||
|
$p_ipandports = $this->getParam('ipandport', true, explode(',', Settings::Get('system.defaultip')));
|
||||||
$adminid = intval($this->getParam('adminid', true, $this->getUserDetail('adminid')));
|
$adminid = intval($this->getParam('adminid', true, $this->getUserDetail('adminid')));
|
||||||
$subcanemaildomain = $this->getParam('subcanemaildomain', true, 0);
|
$subcanemaildomain = $this->getParam('subcanemaildomain', true, 0);
|
||||||
$isemaildomain = $this->getParam('isemaildomain', true, 0);
|
$isemaildomain = $this->getParam('isemaildomain', true, 0);
|
||||||
@@ -310,7 +310,11 @@ class Domains extends ApiCommand implements ResourceEntity
|
|||||||
$additional_ip_condition = '';
|
$additional_ip_condition = '';
|
||||||
$aip_param = array();
|
$aip_param = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (empty($p_ipandports)) {
|
||||||
|
throw new Exception("No IPs given, unable to add domain (no default IPs set?", 406);
|
||||||
|
}
|
||||||
|
|
||||||
$ipandports = array();
|
$ipandports = array();
|
||||||
if (! empty($p_ipandport) && ! is_array($p_ipandports)) {
|
if (! empty($p_ipandport) && ! is_array($p_ipandports)) {
|
||||||
$p_ipandports = unserialize($p_ipandports);
|
$p_ipandports = unserialize($p_ipandports);
|
||||||
|
|||||||
Reference in New Issue
Block a user