summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 023631c)
raw | patch | inline | side by side (parent: 023631c)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 26 Sep 2006 04:44:12 +0000 (04:44 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 26 Sep 2006 04:44:12 +0000 (04:44 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4768 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/plugins/admin/systems/class_goShareServer.inc b/plugins/admin/systems/class_goShareServer.inc
index 5bfe63424829bfb9c29cbc9ed582b80543dbf893..0eab8bf07f1bbd5504b65091f6b0af6f9d4dc710 100644 (file)
$smarty = get_smarty();
- if((isset($_POST['DelNfsEnt']))&&(isset($_POST['goExportEntryList']))){
+ if((isset($_POST['DelNfsEnt']))&&(isset($_POST['goExportEntryList'])) && ($this->acl_is_writeable("name"))){
if($this->allow_mounts){
foreach($_POST['goExportEntryList'] as $entry){
$this->deleteFromMountList($this->goExportEntryList[$entry]);
}
}
- if(isset($_POST['NewNfsAdd'])){
+ if(isset($_POST['NewNfsAdd']) && ($this->acl_is_writeable("name"))){
$this->oldone = NULL;
$this->o_subWindow = new servnfs($this->config, $this);
$this->o_subWindow->set_acl_category("server");
}else{
$this->o_subWindow->save_object();
$newone = $this->o_subWindow->save();
+
$this->addToList($newone);
if($this->allow_mounts){
if($this->oldone) {
/* Set acls */
$tmp = $this->plInfo();
- $acl = "";
foreach($tmp['plProvidedAcls'] as $name => $translated){
- $acl .= $this->getacl($name);
+ $smarty->assign($name."ACL",$this->getacl($name));
}
- $smarty->assign("goExportEntryACL",$acl);
$smarty->assign("createable",$this->acl_is_createable());
$smarty->assign("removeable",$this->acl_is_removeable());
function addToMountList($entry)
{
- $key = key($entry);
- $type = $this->get_share_type($entry[$key]);
- if (($type == "netatalk") || ($type == "NFS")) {
- $this->mounts_to_add[$entry[$key]] = $entry[$key];
- unset($this->mounts_to_remove[$entry[$key]]);
+ if($this->acl_is_writeable("name")){
+ $key = key($entry);
+ $type = $this->get_share_type($entry[$key]);
+ if (($type == "netatalk") || ($type == "NFS")) {
+ $this->mounts_to_add[$entry[$key]] = $entry[$key];
+ unset($this->mounts_to_remove[$entry[$key]]);
+ }
}
}
function deleteFromMountList($entry)
{
- $type = $this->get_share_type($entry);
- if (($type == "netatalk") || ($type == "NFS")) {
- $this->mounts_to_remove[$entry] = $entry;
- unset($this->mounts_to_add[$entry]);
+ if($this->acl_is_writeable("name")){
+ $type = $this->get_share_type($entry);
+ if (($type == "netatalk") || ($type == "NFS")) {
+ $this->mounts_to_remove[$entry] = $entry;
+ unset($this->mounts_to_add[$entry]);
+ }
}
}
index 928f0052f898ad5acd108f84d29d7c3aa6bf84f5..7569e80d3db65cc3857d6b805b157f3182eef7ee 100644 (file)
$this->parent = $parent;
$dn = $parent->dn;
plugin::plugin ($config, $dn);
-
+
$this->types = array("CIFS" => "CIFS", "NFS"=>"NFS","samba"=>"samba","netatalk"=>"netatalk","NCP"=>"NCP");
if($dn){
$this->host = substr($dn, 3, strpos($dn, ',')-3);
}
-
+
$this->charsets = array();
if(!file_exists("/etc/gosa/encodings")){
while(!feof($fp)&&$i){
$i -- ;
$str = trim(fgets($fp,256));
-
+
/* Skip comments */
if(!preg_match("/^#/",$str)){
$arr = split("\=",$str);
}
}
}
-
-
}
}
if($entry){
list($this->name, $this->description, $this->type, $this->charset,
- $this->path, $this->option, $this->volume)= split("\|",$entry."|");
+ $this->path, $this->option, $this->volume)= split("\|",$entry."|");
$this->is_edit = true;
}else{
$this->attributes[] = "name";
}
-
+
$this->create_mount_init = $mount;
}
$smarty->assign("name",$this->name);
if($this->is_edit){
- $smarty->assign("nameACL", preg_replace("/w/",$this->getacl("name")));
- }
-
+ $smarty->assign("nameACL", preg_replace("/w/","",$this->parent->getacl("name")));
+ }
$smarty->assign("allow_mounts", $this->parent->allow_mounts);
$smarty->assign("mount_checked", "");
-
+
$smarty->assign("appleMountsACL", $this->getacl("appleMounts"));
-
+
if (($this->type == "netatalk") || ($this->type == "NFS")) {
- if ($this->create_mount_init) {
- $smarty->assign("mount_checked", "checked");
- } else {
+ if ($this->create_mount_init) {
+ $smarty->assign("mount_checked", "checked");
+ } else {
$tmp = split(",", $this->dn);
$clip = $tmp[0] . ",ou=servers,ou=systems,";
$mountsdn = "cn=mounts," . substr($this->dn, strlen($clip));
- switch ($this->type) {
- case "netatalk" : {
- $mountdn = "cn=".$this->host.":/".$this->name.",".$mountsdn;
- break;
- }
- case "NFS" : {
- $mountdn = "cn=".$this->host.":".$this->path.",".$mountsdn;
- break;
- }
- default : {
- continue;
- }
+ switch ($this->type) {
+ case "netatalk" : {
+ $mountdn = "cn=".$this->host.":/".$this->name.",".$mountsdn;
+ break;
+ }
+ case "NFS" : {
+ $mountdn = "cn=".$this->host.":".$this->path.",".$mountsdn;
+ break;
}
+ default : {
+ continue;
+ }
+ }
$ldap = $this->config->get_ldap_link();
$ldap->cat($mountdn, array('dn'));
$attrs = $ldap->fetch();
if (count($attrs) > 0) {
- $smarty->assign("mount_checked", "checked");
+ $smarty->assign("mount_checked", "checked");
}
- }
+ }
}
$display= $smarty->fetch(get_template_path('servnfs.tpl', TRUE));
/* Save data to object */
function save_object()
{
- if(isset($_POST['path'])){
+ if(isset($_POST['servnfs_posted'])){
foreach($this->attributes as $name){
if($this->parent->acl_is_writeable($name) && isset($_POST[$name])){
if(preg_match("/[^a-z0-9._+ |-]/i",$this->volume)){
$message[]=_("Volume contains invalid characters.");
}
-
+
if(preg_match("/\|/",$this->path)){
$message[]=_("Path contains invalid characters.");
}
$message[]=_("Option contains invalid characters.");
}
- /* remove a / at the end of the path, we neither need it there nor
- * do we want to check for it later.
- */
- if(substr($this->path, -1, 1) == '/') {
- $this->path=substr($this->path, 0, -1);
- }
-
+ /* remove a / at the end of the path, we neither need it there nor
+ * do we want to check for it later.
+ */
+ if(substr($this->path, -1, 1) == '/') {
+ $this->path=substr($this->path, 0, -1);
+ }
+
$ldap= $this->config->get_ldap_link();
$ldap->cd($this->config->current['BASE']);
$ldap->search("(objectClass=goShareServer)", array("goExportEntry"));
return(array($this->name=>$s_return));
}
-
+
function should_create_mount() {
return $this->create_mount;
}
index 6cb4c45a651d33bb309887831944674f0bae4399..4169f3706927a68149884c09269bbbeb35bfea44 100644 (file)
<table summary="" style="width:100%">
<tr>
<td>
-{render acl=$goExportEntryACL}
+{render acl=$nameACL mode=read_active}
<select style="width:100%" id="goExportEntry" name="goExportEntryList[]" size=12 multiple >
{html_options values=$goExportEntry output=$goExportEntryKeys}
<option disabled> </option>
{/render}
<br>
+{render acl=$nameACL}
<input type="submit" value="{t}Add{/t}" name="NewNfsAdd" id="NewNfsAddId" {if !$createable} disabled {/if}>
-{render acl=$goExportEntryACL}
+{/render}
+{render acl=$nameACL mode=read_active}
<input type="submit" value="{t}Edit{/t}" name="NewNfsEdit" id="NewNfsEditId">
{/render}
+{render acl=$nameACL}
<input type="submit" value="{t}Delete{/t}" name="DelNfsEnt" id="DelNfsEntId" {if !$removeable} disabled {/if}>
+{/render}
</td>
</tr>
</table>
index 006f5d9c4a164ebdc45871487d836af831bb7772..c749639ddd8a70a87f3e0f2bdbbdb7bb909b595f 100644 (file)
</td>
</tr>
</table>
+<input type='hidden' name='servnfs_posted' value='1'>