X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=plugins%2Fadmin%2Fsystems%2Fclass_servNfs.inc;h=fbda973248ad639c51ae553444f6d94f1c2d8876;hb=a83032a4d10878c03c61e43882baa01a2211b22d;hp=9e339ca318222004415ba31087a6535a91d02281;hpb=2a869f61a7e54b6e79b9b724417436d97dfed4ea;p=gosa.git diff --git a/plugins/admin/systems/class_servNfs.inc b/plugins/admin/systems/class_servNfs.inc index 9e339ca31..fbda97324 100644 --- a/plugins/admin/systems/class_servNfs.inc +++ b/plugins/admin/systems/class_servNfs.inc @@ -9,7 +9,7 @@ class servnfs extends plugin /* attribute list for save action */ var $ignore_account = TRUE; - var $attributes = array("description","type","charset","path","option"); + var $attributes = array("description","type","charset","path","option", "volume"); var $objectclasses = array("whatever"); var $is_account = true; @@ -21,6 +21,7 @@ class servnfs extends plugin var $types =array(); // Array Types NFS/Samba/NCP/netatalk var $charsets =array(); // Array with charsets var $path =""; // Path + var $volume =""; // Volume var $option =""; // Options var $is_edit =false; var $allow_mounts = false; //do we allow mount entries? @@ -31,7 +32,7 @@ class servnfs extends plugin { plugin::plugin ($config, $dn); - $this->types = array("NFS"=>"NFS","samba"=>"samba","netatalk"=>"netatalk","NCP"=>"NCP"); + $this->types = array("CIFS" => "CIFS", "NFS"=>"NFS","samba"=>"samba","netatalk"=>"netatalk","NCP"=>"NCP"); if($dn){ $this->host = substr($dn, 3, strpos($dn, ',')-3); } @@ -67,18 +68,14 @@ class servnfs extends plugin } if($entry){ - $tmp = split("\|",$entry); - $this->name = $tmp[0]; // Name of NFS - $this->description = $tmp[1]; // description - $this->type = $tmp[2]; // Type NFS/Samba/NCP/netatalk - $this->charset = $tmp[3]; // charset - $this->path = $tmp[4]; // Path - $this->option = $tmp[5]; // Options + list($this->name, $this->description, $this->type, $this->charset, + $this->path, $this->option, $this->volume)= split("\|",$entry."|"); $this->is_edit = true; - + }else{ $this->attributes[] = "name"; } + $this->create_mount_init = $mount; } @@ -136,7 +133,7 @@ class servnfs extends plugin } } $ldap = $this->config->get_ldap_link(); - $ldap->cat($mountdn); + $ldap->cat($mountdn, array('dn')); $attrs = $ldap->fetch(); if (count($attrs) > 0) { $smarty->assign("mount_checked", "checked"); @@ -185,23 +182,27 @@ class servnfs extends plugin // only 0-9a-z if(!$this->is_edit){ - if(preg_match("/[^a-z0-9\.\-_]/i",$this->name)){ - $message[]=_("Please specify a valid name for your setup."); + if(!preg_match("/^[a-z0-9\.\-_]+$/i",$this->name)){ + $message[]=_("Please specify a valid name for your share."); } if(empty($this->name)){ - $message[]=_("Please specify a name for your setup."); + $message[]=_("Please specify a name for your share."); } } - if(preg_match("/\|/",$this->description)){ + if(preg_match("/[^a-z0-9._+ \|-]+/i",$this->description)){ $message[]=_("Description contains invalid characters."); } + + if(preg_match("/[^a-z0-9._+ |-]/i",$this->volume)){ + $message[]=_("Volume contains invalid characters."); + } if(preg_match("/\|/",$this->path)){ $message[]=_("Path contains invalid characters."); } - if(preg_match("/\|/",$this->option)){ + if(preg_match("/[^a-z0-9._+ \|-]/i",$this->option)){ $message[]=_("Option contains invalid characters."); } @@ -245,7 +246,8 @@ class servnfs extends plugin $s_return.= $this->type."|"; $s_return.= $this->charset."|"; $s_return.= $this->path."|"; - $s_return.= $this->option; + $s_return.= $this->option."|"; + $s_return.= $this->volume; return(array($this->name=>$s_return)); } @@ -254,6 +256,27 @@ class servnfs extends plugin return $this->create_mount; } + /* Return plugin informations for acl handling */ + function plInfo() + { + return (array( + "plShortName" => _("NFS"), + "plDescription" => _("NFS service"), + "plSelfModify" => FALSE, + "plDepends" => array(), + "plPriority" => 0, + "plSection" => array("administration"), + "plCategory" => array("server"), + + "plProvidedAcls"=> array( + "description" => _("Description"), + "type" => _("Type"), + "charset" => _("Charset"), + "path" => _("Path"), + "option" => _("Option"), + "volume" => _("Volume")) + )); + } } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: