@@ -119,7 +119,7 @@ function onSubmit() {
119119 $ this ->oldTemplatesAssigned = array ();
120120 }
121121
122- $ this ->_template_additional = explode ('/ ' , $ this ->dataRecord ['template_additional ' ]);
122+ $ this ->_template_additional = ( isset ( $ this -> dataRecord [ ' template_additional ' ]) && $ this -> dataRecord [ ' template_additional ' ] != '' )? explode ('/ ' , $ this ->dataRecord ['template_additional ' ]): array ( );
123123 $ this ->dataRecord ['template_additional ' ] = '' ;
124124
125125 parent ::onSubmit ();
@@ -169,7 +169,7 @@ function onShowEnd() {
169169 // old style
170170 $ sql = "SELECT template_additional FROM client WHERE client_id = ? " ;
171171 $ result = $ app ->db ->queryOneRecord ($ sql , $ this ->id );
172- $ tplAdd = explode ("/ " , $ result ['template_additional ' ]);
172+ $ tplAdd = ( isset ( $ result [ ' template_additional ' ]) && $ result [ ' template_additional ' ] != '' )? explode ("/ " , $ result ['template_additional ' ]): array ( );
173173 $ text = '' ;
174174 foreach ($ tplAdd as $ item ){
175175 if (trim ($ item ) != '' ){
@@ -293,7 +293,7 @@ function onAfterInsert() {
293293 $ app ->auth ->add_group_to_user ($ _SESSION ['s ' ]['user ' ]['userid ' ], $ groupid );
294294 $ app ->db ->query ("UPDATE client SET parent_client_id = ? WHERE client_id = ? " , $ _SESSION ['s ' ]['user ' ]['client_id ' ], $ this ->id );
295295 } else {
296- if ($ this ->dataRecord ['parent_client_id ' ] > 0 ) {
296+ if (isset ( $ this -> dataRecord [ ' parent_client_id ' ]) && $ this ->dataRecord ['parent_client_id ' ] > 0 ) {
297297 //* get userid of the reseller and add it to the group of the client
298298 $ tmp = $ app ->db ->queryOneRecord ("SELECT sys_user.userid FROM sys_user,sys_group WHERE sys_user.default_group = sys_group.groupid AND sys_group.client_id = ? " , $ this ->dataRecord ['parent_client_id ' ]);
299299 $ app ->auth ->add_group_to_user ($ tmp ['userid ' ], $ groupid );
@@ -304,14 +304,14 @@ function onAfterInsert() {
304304
305305 //* Set the default servers
306306 $ tmp = $ app ->getconf ->get_global_config ('mail ' );
307- $ default_mailserver = $ app ->functions ->intval ($ tmp ['default_mailserver ' ]);
307+ $ default_mailserver = ( isset ( $ tmp [ ' default_mailserver ' ]))? $ app ->functions ->intval ($ tmp ['default_mailserver ' ]): 0 ;
308308 if (!$ default_mailserver ) {
309309 $ tmp = $ app ->db ->queryOneRecord ('SELECT server_id FROM server WHERE mail_server = 1 AND mirror_server_id = 0 LIMIT 0,1 ' );
310310 $ default_mailserver = $ app ->functions ->intval ($ tmp ['server_id ' ]);
311311 }
312312 $ tmp = $ app ->getconf ->get_global_config ('sites ' );
313- $ default_webserver = $ app ->functions ->intval ($ tmp ['default_webserver ' ]);
314- $ default_dbserver = $ app ->functions ->intval ($ tmp ['default_dbserver ' ]);
313+ $ default_webserver = ( isset ( $ tmp [ ' default_webserver ' ]))? $ app ->functions ->intval ($ tmp ['default_webserver ' ]): 0 ;
314+ $ default_dbserver = ( isset ( $ tmp [ ' default_dbserver ' ]))? $ app ->functions ->intval ($ tmp ['default_dbserver ' ]): 0 ;
315315 if (!$ default_webserver ) {
316316 $ tmp = $ app ->db ->queryOneRecord ('SELECT server_id FROM server WHERE web_server = 1 AND mirror_server_id = 0 LIMIT 0,1 ' );
317317 $ default_webserver = $ app ->functions ->intval ($ tmp ['server_id ' ]);
@@ -321,7 +321,7 @@ function onAfterInsert() {
321321 $ default_dbserver = $ app ->functions ->intval ($ tmp ['server_id ' ]);
322322 }
323323 $ tmp = $ app ->getconf ->get_global_config ('dns ' );
324- $ default_dnsserver = $ app ->functions ->intval ($ tmp ['default_dnsserver ' ]);
324+ $ default_dnsserver = ( isset ( $ tmp [ ' default_dnsserver ' ]))? $ app ->functions ->intval ($ tmp ['default_dnsserver ' ]): 0 ;
325325 if (!$ default_dnsserver ) {
326326 $ tmp = $ app ->db ->queryOneRecord ('SELECT server_id FROM server WHERE dns_server = 1 AND mirror_server_id = 0 LIMIT 0,1 ' );
327327 $ default_dnsserver = $ app ->functions ->intval ($ tmp ['server_id ' ]);
0 commit comments