From: cajus Date: Tue, 30 Sep 2008 13:33:43 +0000 (+0000) Subject: Added NBD as a "share" type X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f40bb73bb15e98ba508ab0786db44a6463ed9d2b;p=gosa.git Added NBD as a "share" type git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12567 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto/admin/systems/services/nfs/class_servNfs.inc b/gosa-plugins/goto/admin/systems/services/nfs/class_servNfs.inc index 158f055f6..105d9565d 100644 --- a/gosa-plugins/goto/admin/systems/services/nfs/class_servNfs.inc +++ b/gosa-plugins/goto/admin/systems/services/nfs/class_servNfs.inc @@ -31,10 +31,11 @@ class servnfs extends plugin $dn = $parent->dn; plugin::plugin ($config, $dn); - $this->types = array("CIFS" => "CIFS", "NFS"=>"NFS","samba"=>"samba","netatalk"=>"netatalk","NCP"=>"NCP"); + $this->types = array("NBD" => "NBD", "CIFS" => "CIFS", "NFS"=>"NFS","samba"=>"samba","netatalk"=>"netatalk","NCP"=>"NCP"); if($dn){ $this->host = substr($dn, 3, strpos($dn, ',')-3); } + asort($this->types); $this->charsets = array(); @@ -178,8 +179,14 @@ class servnfs extends plugin $message[]= msgPool::required(_("Path")); } - if(!tests::is_path($this->path)){ - $message[]= _("'Path / Volume' must contain at least one '/'!"); + if($this->type == "NBD") { + if (!preg_match('/^[a-z0-9-]+:[0-9]+$/', $this->path)){ + $message[]= _("'Path / Volume' must be of format 'server:port'!"); + } + } else { + if (!tests::is_path($this->path)){ + $message[]= _("'Path / Volume' must contain at least one '/'!"); + } } if(!in_array($this->type,$this->types)){