@@ -450,6 +450,75 @@ public function sites_web_domain_delete($session_id, $primary_id)
450450
451451 // ----------------------------------------------------------------------------------------------------------
452452
453+ //* Get record details
454+ public function sites_web_vhost_aliasdomain_get ($ session_id , $ primary_id )
455+ {
456+ global $ app ;
457+
458+ if (!$ this ->checkPerm ($ session_id , 'sites_web_aliasdomain_get ' )) {
459+ throw new SoapFault ('permission_denied ' , 'You do not have the permissions to access this function. ' );
460+ return false ;
461+ }
462+ $ app ->uses ('remoting_lib ' );
463+ $ app ->remoting_lib ->loadFormDef ('../sites/form/web_vhost_aliasdomain.tform.php ' );
464+ return $ app ->remoting_lib ->getDataRecord ($ primary_id );
465+ }
466+
467+ //* Add a record
468+ public function sites_web_vhost_aliasdomain_add ($ session_id , $ client_id , $ params )
469+ {
470+ global $ app ;
471+ if (!$ this ->checkPerm ($ session_id , 'sites_web_aliasdomain_add ' )) {
472+ throw new SoapFault ('permission_denied ' , 'You do not have the permissions to access this function. ' );
473+ return false ;
474+ }
475+
476+ //* Set a few params to "not empty" values which get overwritten by the sites_web_domain_plugin
477+ if ($ params ['document_root ' ] == '' ) $ params ['document_root ' ] = '- ' ;
478+ if ($ params ['system_user ' ] == '' ) $ params ['system_user ' ] = '- ' ;
479+ if ($ params ['system_group ' ] == '' ) $ params ['system_group ' ] = '- ' ;
480+
481+ //* Set a few defaults for nginx servers
482+ if ($ params ['pm_max_children ' ] == '' ) $ params ['pm_max_children ' ] = 1 ;
483+ if ($ params ['pm_start_servers ' ] == '' ) $ params ['pm_start_servers ' ] = 1 ;
484+ if ($ params ['pm_min_spare_servers ' ] == '' ) $ params ['pm_min_spare_servers ' ] = 1 ;
485+ if ($ params ['pm_max_spare_servers ' ] == '' ) $ params ['pm_max_spare_servers ' ] = 1 ;
486+
487+ $ domain_id = $ this ->insertQuery ('../sites/form/web_vhost_aliasdomain.tform.php ' , $ client_id , $ params , 'sites:web_vhost_aliasdomain:on_after_insert ' );
488+ return $ domain_id ;
489+ }
490+
491+ //* Update a record
492+ public function sites_web_vhost_aliasdomain_update ($ session_id , $ client_id , $ primary_id , $ params )
493+ {
494+ if (!$ this ->checkPerm ($ session_id , 'sites_web_aliasdomain_update ' )) {
495+ throw new SoapFault ('permission_denied ' , 'You do not have the permissions to access this function. ' );
496+ return false ;
497+ }
498+
499+ //* Set a few defaults for nginx servers
500+ if ($ params ['pm_max_children ' ] == '' ) $ params ['pm_max_children ' ] = 1 ;
501+ if ($ params ['pm_start_servers ' ] == '' ) $ params ['pm_start_servers ' ] = 1 ;
502+ if ($ params ['pm_min_spare_servers ' ] == '' ) $ params ['pm_min_spare_servers ' ] = 1 ;
503+ if ($ params ['pm_max_spare_servers ' ] == '' ) $ params ['pm_max_spare_servers ' ] = 1 ;
504+
505+ $ affected_rows = $ this ->updateQuery ('../sites/form/web_vhost_aliasdomain.tform.php ' , $ client_id , $ primary_id , $ params , 'sites:web_vhost_aliasdomain:on_after_insert ' );
506+ return $ affected_rows ;
507+ }
508+
509+ //* Delete a record
510+ public function sites_web_vhost_aliasdomain_delete ($ session_id , $ primary_id )
511+ {
512+ if (!$ this ->checkPerm ($ session_id , 'sites_web_aliasdomain_delete ' )) {
513+ throw new SoapFault ('permission_denied ' , 'You do not have the permissions to access this function. ' );
514+ return false ;
515+ }
516+ $ affected_rows = $ this ->deleteQuery ('../sites/form/web_vhost_aliasdomain.tform.php ' , $ primary_id );
517+ return $ affected_rows ;
518+ }
519+
520+ // ----------------------------------------------------------------------------------------------------------
521+
453522 //* Get record details
454523 public function sites_web_vhost_subdomain_get ($ session_id , $ primary_id )
455524 {
0 commit comments