From cfa9da8cae6cc75052cb6fbce432033fc9c3b87b Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Sat, 27 Dec 2008 11:20:15 -0500
Subject: [PATCH] Fixed a bug in username and database name prefix.

---
 server/plugins-available/apache2_plugin.inc.php |   31 +++++++++++++++++++++++++++++--
 1 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/server/plugins-available/apache2_plugin.inc.php b/server/plugins-available/apache2_plugin.inc.php
index ab01000..530c669 100644
--- a/server/plugins-available/apache2_plugin.inc.php
+++ b/server/plugins-available/apache2_plugin.inc.php
@@ -330,7 +330,7 @@
 						exec("cp /usr/local/ispconfig/server/conf/error/".substr(escapeshellcmd($conf["language"]),0,2)."/* ".$error_page_path);
 					}
 				}
-				exec("chmod -R +r ".$error_page_path);
+				exec("chmod -R a+r ".$error_page_path);
 			}
 
 			// copy the standard index page
@@ -348,7 +348,7 @@
 					exec("cp /usr/local/ispconfig/server/conf/index/.htaccess ".escapeshellcmd($data["new"]["document_root"])."/web/");
 				}
 			}
-			exec("chmod +r ".escapeshellcmd($data["new"]["document_root"])."/web");
+			exec("chmod -R a+r ".escapeshellcmd($data["new"]["document_root"])."/web/");
 		}
 		
 		// Create group and user, if not exist
@@ -423,6 +423,20 @@
 			$rewrite_rules[] = array(	'rewrite_domain' 	=> $data["new"]["domain"],
 										'rewrite_type' 		=> $data["new"]["redirect_type"],
 										'rewrite_target' 	=> $data["new"]["redirect_path"]);
+            
+            switch($data["new"]["subdomain"]) {
+            case 'www':
+    			$rewrite_rules[] = array(	'rewrite_domain' 	=> 'www.'.$data["new"]["domain"],
+    										'rewrite_type' 		=> $data["new"]["redirect_type"],
+    										'rewrite_target' 	=> $data["new"]["redirect_path"]);
+                break;
+            case '*':
+                // TODO
+    			//$rewrite_rules[] = array(	'rewrite_domain' 	=> '*'.$alias["domain"],
+    			//							'rewrite_type' 		=> $alias["redirect_type"],
+    			//							'rewrite_target' 	=> $alias["redirect_path"]);
+                break;
+            }
 		}
 		
 		// get alias domains (co-domains and subdomains)
@@ -454,6 +468,19 @@
 					$rewrite_rules[] = array(	'rewrite_domain' 	=> $alias["domain"],
 												'rewrite_type' 		=> $alias["redirect_type"],
 												'rewrite_target' 	=> $alias["redirect_path"]);
+                    switch($alias["subdomain"]) {
+                    case 'www':
+            			$rewrite_rules[] = array(	'rewrite_domain' 	=> 'www.'.$alias["domain"],
+            										'rewrite_type' 		=> $alias["redirect_type"],
+            										'rewrite_target' 	=> $alias["redirect_path"]);
+                        break;
+                    case '*':
+                        // TODO
+            			//$rewrite_rules[] = array(	'rewrite_domain' 	=> '*'.$alias["domain"],
+            			//							'rewrite_type' 		=> $alias["redirect_type"],
+            			//							'rewrite_target' 	=> $alias["redirect_path"]);
+                        break;
+                    }
 				}
 			}
 		}

--
Gitblit v1.9.1