$app->log('Template processing key '.$k.' for client '.$clientId,LOGLEVEL_DEBUG);
/* process the numerical limits */
...
...
@@ -160,6 +160,15 @@ class client_templates {
if($limits[$k]<1)$limits[$k]=1;
break;
case'default_mailserver':
case'default_webserver':
case'default_dnsserver':
case'default_slave_dnsserver':
case'default_dbserver':
/* additional templates don't override default server from main template */
if($limits[$k]==0)$limits[$k]=$v;
break;
default:
if($limits[$k]>-1){
if($v==-1){
...
...
@@ -225,7 +234,10 @@ class client_templates {
$update='';
if(!$is_reseller)unset($limits['limit_client']);// Only Resellers may have limit_client set in template to ensure that we do not convert a client to reseller accidently.
* the template has changed. apply the new data to all clients
*/
if($this->dataRecord["template_type"]=='m'){
if($template_type=='m'){
$sql="SELECT client_id FROM client WHERE template_master = ".$this->id;
}else{
$sql="SELECT client_id FROM client WHERE template_additional LIKE '%/".$this->id."/%' OR template_additional LIKE '".$this->id."/%' OR template_additional LIKE '%/".$this->id."' UNION SELECT client_id FROM client_template_assigned WHERE client_template_id = ".$this->id;