summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7d061eb)
raw | patch | inline | side by side (parent: 7d061eb)
author | opensides <opensides@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Sun, 4 Nov 2007 18:01:22 +0000 (18:01 +0000) | ||
committer | opensides <opensides@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Sun, 4 Nov 2007 18:01:22 +0000 (18:01 +0000) |
- Added function to check valid hostname
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5-plugins@7728 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5-plugins@7728 594d385d-05f5-0310-b6e9-bd551577e9d8
vhost-apache2/src/class_servApacheEditVhost.inc | patch | blob | history | |
vhost-apache2/src/class_servApacheVhost.inc | patch | blob | history | |
vhost-apache2/src/functions_apache.inc | patch | blob | history |
diff --git a/vhost-apache2/src/class_servApacheEditVhost.inc b/vhost-apache2/src/class_servApacheEditVhost.inc
index 0f8672c5db5ec97c78cecbf651eaf5a57c9d0dba..1b0b61725d81536553b024d773ef41923e661077 100644 (file)
*/
}
- if(is_domain($this->apacheServerName) || empty($this->apacheServerName)){
+ if(!GetVhostsDomain($this->apacheServerName) || empty($this->apacheServerName)){
$message[] =sprintf(_("Please choose a valid Virtual Host Name."));
}
diff --git a/vhost-apache2/src/class_servApacheVhost.inc b/vhost-apache2/src/class_servApacheVhost.inc
index 495da74853eb498bca6c0e01beccad723f3f4fb5..4b97104b33b865a7c9a64b5571f958fa3630246d 100644 (file)
/* Initiate deletion
*/
- $this->RemoveVhost($tmp);
+ $this->RemoveVhost($tmp);
}
}
$smarty->assign("servapacheACL",chkacl($this->acl,"servapache"));
- /* Display tempalte
+ /* Display template
*/
$smarty->assign("VhostList",$VhostList->DrawList());
$display.= $smarty->fetch(get_template_path('servApacheVhost.tpl', TRUE));
/* Delete specified vhost
- */
+ */
function RemoveVhost($id)
{
- $vhosts = $this->getUsedServerNames();
-
- $vhostname = "";
- if(isset($this->Vhosts[$id]['InitialApacheServerName'])){
- $vhostname= $this->Vhosts[$id]['InitialApacheServerName'];
- }
-
- $used = array();
-
- /* Add Records which use this apacheServerName
- */
- if(isset($vhosts[$vhostname])){
- $used = array_merge($used,$vhosts[$vhostname]);
- }
-
-
- /* There are still entries using this configuration
- * Abort deletion
- */
- if(count($used)){
- $i = 2;
- $str ="";
- foreach($used as $dn){
- if($i > 0 ){
- $i --;
- $str.=$dn." ";
- }
- }
-
- /* Only show 2 apache in the error message
- */
- if(count($used)> 2) {
- $str .=" ... ";
- }
- print_red(sprintf(_("Can't delete the selected vhost, because it is still in use by these entry/entries '%s'"),trim($str)));
-
- }else{
unset($this->Vhosts[$id]);
return(true);
- }
- return(false);
- }
+ }
/* This function returns all used Vhostnames
index be0b3f026d47f552e3a4e9f63dd130383716ef6f..edaa39d2e346b19e24aa9a099d3bfbd6793f510b 100644 (file)
return($zones);
}
+/* Simple is domain check, it checks if the given string looks like "string.string.string"
+ or string.string */
+function GetVhostsDomain($str)
+{
+ return(preg_match("/[^\.\/]+\.[^\.\/]+$/",$str));
+}
+
?>