diff --git a/interface/web/sites/web_domain_edit.php b/interface/web/sites/web_domain_edit.php index 7b1bc6df0d3d698c4c925156948d9aabcaef0ad0..6790f3ccbe71d147441735b4ef075e1ae39a9f25 100644 --- a/interface/web/sites/web_domain_edit.php +++ b/interface/web/sites/web_domain_edit.php @@ -199,8 +199,8 @@ class page_action extends tform_actions { $client = $app->db->queryOneRecord("SELECT client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); $client_id = intval($client["client_id"]); } else { - $client_id = intval($this->dataRecord["client_group_id"]); - $client = $app->db->queryOneRecord("SELECT client_id FROM sys_group WHERE sys_group.groupid = ".intval($this->dataRecord["client_group_id"])); + //$client_id = intval($this->dataRecord["client_group_id"]); + $client = $app->db->queryOneRecord("SELECT client_id FROM sys_group WHERE sys_group.groupid = ".intval($this->dataRecord["sys_groupid"])); $client_id = intval($client["client_id"]); } @@ -235,8 +235,8 @@ class page_action extends tform_actions { $client = $app->db->queryOneRecord("SELECT client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); $client_id = intval($client["client_id"]); } else { - $client_id = intval(@$web_rec["client_group_id"]); - $client = $app->db->queryOneRecord("SELECT client_id FROM sys_group WHERE sys_group.groupid = ".intval(@$this->dataRecord["client_group_id"])); + //$client_id = intval(@$web_rec["client_group_id"]); + $client = $app->db->queryOneRecord("SELECT client_id FROM sys_group WHERE sys_group.groupid = ".intval(@$this->dataRecord["sys_groupid"])); $client_id = intval($client["client_id"]); } diff --git a/server/mods-enabled/web_module.inc.php b/server/mods-enabled/web_module.inc.php index 5377911076c1686e33432bb24209206a957e1429..1b4c8b8b0d6b0d2fac79cd15b2baf0c69fa25a7a 100644 --- a/server/mods-enabled/web_module.inc.php +++ b/server/mods-enabled/web_module.inc.php @@ -34,7 +34,13 @@ class web_module { var $class_name = 'web_module'; var $actions_available = array( 'web_domain_insert', 'web_domain_update', - 'web_domain_delete'); + 'web_domain_delete', + 'ftp_user_insert', + 'ftp_user_update', + 'ftp_user_delete', + 'shell_user_insert', + 'shell_user_update', + 'shell_user_delete'); /* This function is called when the module is loaded @@ -81,6 +87,16 @@ class web_module { if($action == 'u') $app->plugins->raiseEvent('web_domain_update',$data); if($action == 'd') $app->plugins->raiseEvent('web_domain_delete',$data); break; + case 'ftp_user': + if($action == 'i') $app->plugins->raiseEvent('ftp_user_insert',$data); + if($action == 'u') $app->plugins->raiseEvent('ftp_user_update',$data); + if($action == 'd') $app->plugins->raiseEvent('ftp_user_delete',$data); + break; + case 'shell_user': + if($action == 'i') $app->plugins->raiseEvent('shell_user_insert',$data); + if($action == 'u') $app->plugins->raiseEvent('shell_user_update',$data); + if($action == 'd') $app->plugins->raiseEvent('shell_user_delete',$data); + break; } // end switch } // end function diff --git a/server/plugins-enabled/apache2_plugin.inc.php b/server/plugins-enabled/apache2_plugin.inc.php index dc8dc38a93bf1d9381b40b0093098c778cd8cbed..520bcb70c4500107070e31190299c6c516fb7321 100644 --- a/server/plugins-enabled/apache2_plugin.inc.php +++ b/server/plugins-enabled/apache2_plugin.inc.php @@ -104,7 +104,19 @@ class apache2_plugin { if(!is_dir('/var/log/ispconfig/httpd/'.$data["new"]["domain"])) exec('mkdir -p /var/log/ispconfig/httpd/'.$data["new"]["domain"]); if(!is_link($data["new"]["document_root"]."/log")) exec("ln -s /var/log/ispconfig/httpd/".$data["new"]["domain"]." ".$data["new"]["document_root"]."/log"); - // TODO: Create the symlinks + // Create the symlinks for the sites + $client = $app->db->queryOneRecord("SELECT client_id FROM sys_group WHERE sys_group.groupid = ".intval($data["new"]["sys_groupid"])); + $client_id = intval($client["client_id"]); + unset($client); + $tmp_symlinks_array = explode(':',$web_config["website_symlinks"]); + foreach($tmp_symlinks_array as $tmp_symlink) { + $tmp_symlink = str_replace("[client_id]",$client_id,$tmp_symlink); + $tmp_symlink = str_replace("[website_domain]",$data["new"]["domain"],$tmp_symlink); + if(!is_link($tmp_symlink)) { + exec("ln -s ".escapeshellcmd($data["new"]["document_root"])."/ ".escapeshellcmd($tmp_symlink)); + $app->log("Creating Symlink: ln -s ".$data["new"]["document_root"]."/ ".$tmp_symlink,LOGLEVEL_DEBUG); + } + } // Copy the error pages $error_page_path = escapeshellcmd($data["new"]["web_document_root"])."/web/error/";