diff --git a/plugins/admin/systems/class_servService.inc b/plugins/admin/systems/class_servService.inc
index afc35e42b5e5d2e4c2db9be4209a05db3d7d15e6..2c9f9381e69b60425fc4b0ffd0f32928c1957888 100644 (file)
var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
var $goExportEntry = array();
+ var $goExportEntryList= array();
var $goTimeSource = array();
var $goLdapBase = "";
var $goXdmcpIsEnabled = "";
$this->$name= $tmp;
}
-
$tmp =array();
$tmp2=array();
if(isset($this->attrs['goExportEntry'])){
- unset($this->attrs['goExportEntry']['count']);
- if((isset($this->attrs['goExportEntry']))&&(isset($this->attrs['goExportEntry']))){
- foreach($this->attrs['goExportEntry'] as $entry){
- $tmp2= split("\|",$entry);
- $tmp[$tmp2[0]]= $entry;
+ if(isset($this->attrs['goExportEntry']['count'])){
+ for($i= 0; $i<$this->attrs['goExportEntry']['count']; $i++){
+ $entry= $this->attrs['goExportEntry'][$i];
+ $tmp[preg_replace('/\|.*$/', '', $entry)]= $entry;
}
}
}
- $this->goExportEntry = $tmp;
+ $this->goExportEntryList = $tmp;
/* Always is account... */
$this->is_account= TRUE;
function addToList($entry){
$key = key($entry);
- $this->goExportEntry[$key]=$entry[$key];
+ $this->goExportEntryList[$key]=$entry[$key];
}
function deleteFromList($id){
- unset($this->goExportEntry[$id]);
+ unset($this->goExportEntryList[$id]);
}
function addToMountList($entry) {
function execute()
{
- /* Call parent execute */
- plugin::execute();
+ /* Call parent execute */
+ plugin::execute();
/* Fill templating stuff */
$smarty= get_smarty();
-
$smarty->assign("staticAddress", "");
-
- if((isset($_POST['DelNfsEnt']))&&(isset($_POST['goExportEntry']))){
+
+ if((isset($_POST['DelNfsEnt']))&&(isset($_POST['goExportEntryList']))){
if($this->allow_mounts){
- $this->deleteFromMountList($this->goExportEntry[$_POST['goExportEntry']]);
+ foreach($_POST['goExportEntryList'] as $entry){
+ $this->deleteFromMountList($this->goExportEntryList[$entry]);
+ }
+ }
+ foreach($_POST['goExportEntryList'] as $entry){
+ $this->deleteFromList($entry);
}
- $this->deleteFromList($_POST['goExportEntry']);
}
if(isset($_POST['NewNfsAdd'])){
$this->dialog = true;
}
- if((isset($_POST['NewNfsEdit']))&&(isset($_POST['goExportEntry']))){
- $entry = $this->goExportEntry[$_POST['goExportEntry']];
+ if((isset($_POST['NewNfsEdit']))&&(isset($_POST['goExportEntryList']))){
+ $entry = $this->goExportEntryList[$_POST['goExportEntryList'][0]];
$add_mount=isset($this->mounts_to_add[$entry]);
$this->oldone=$entry;
$this->o_subWindow = new servnfs($this->config,$this->acl,$this->allow_mounts,$this->dn,$entry,$add_mount);
}
$tellSmarty=array();
- ksort($this->goExportEntry);
- foreach($this->goExportEntry as $name=>$values){
+ ksort($this->goExportEntryList);
+ foreach($this->goExportEntryList as $name=>$values){
$tmp = split("\|",$values);
$tellSmarty[$name] = $tmp[0]." ".$tmp[4]." (".$tmp[2].")";
}
$this->attrs['objectClass']= $tmp;
/* Arrays */
- foreach (array("goTimeSource", "goExportEntry") as $name){
- $this->attrs[$name]= array();
- foreach ($this->$name as $element){
- $this->attrs[$name][]= $element;
+ foreach (array("goTimeSource"=>"goTimeSource", "goExportEntryList"=>"goExportEntry") as $source => $destination){
+ $this->attrs[$destination]= array();
+ foreach ($this->$source as $element){
+ $this->attrs[$destination][]= $element;
}
}
$this->cleanup();
$ldap->modify ($this->attrs);
- show_ldap_error($ldap->get_error());
+ show_ldap_error($ldap->get_error(), _("Saving server service object failed"));
/* Optionally execute a command after we're done */
if ($this->initially_was_account == $this->is_account){
# load data from mounts container
$ldap = $this->config->get_ldap_link();
- $ldap->cat($mountsdn);
+ $ldap->cat($mountsdn, array('dn'));
$attrs = $ldap->fetch();
# mounts container not present yet, so we create it
if (count($attrs) == 0) {
$ldap->cd($mountsdn);
$ldap->add($mounts);
- show_ldap_error($ldap->get_error());
+ show_ldap_error($ldap->get_error(), _("Creating mount container failed"));
gosa_log("Mount container '$mountsdn' has been created");
}
- # remove deleted mounts from the container
- foreach ($this->mounts_to_remove as $entry) {
- $mount=$this->returnMountEntry($entry);
+ # remove deleted mounts from the container
+ foreach ($this->mounts_to_remove as $entry) {
+ $mount=$this->returnMountEntry($entry);
$mountdn = "cn=".$mount["cn"].","."$mountsdn";
-
- $ldap->cat($mountdn);
- $attrs = $ldap->fetch();
-
- if (count($attrs) != 0) {
- $ldap->rmdir($mountdn);
- show_ldap_error($ldap->get_error());
- gosa_log("Mount object '".$mountdn."' has been removed");
- }
- }
- # add new mounts to the container
- foreach ($this->mounts_to_add as $entry) {
-
+ $ldap->cat($mountdn, array('dn'));
+ $attrs = $ldap->fetch();
+
+ if (count($attrs) != 0) {
+ $ldap->rmdir($mountdn);
+ show_ldap_error($ldap->get_error(), _("Removing mount container failed"));
+ gosa_log("Mount object '".$mountdn."' has been removed");
+ }
+ }
+
+ # add new mounts to the container
+ foreach ($this->mounts_to_add as $entry) {
+
$mount=$this->returnMountEntry($entry);
$mountdn = "cn=".$mount["cn"].","."$mountsdn";
- $ldap->cd($mountdn);
- $ldap->add($mount);
- show_ldap_error($ldap->get_error());
- gosa_log("Mount object '".$mountdn."' has been added");
- }
+ $ldap->cd($mountdn);
+ $ldap->add($mount);
+ show_ldap_error($ldap->get_error(), _("Saving mount container failed"));
+ gosa_log("Mount object '".$mountdn."' has been added");
+ }
}
function get_share_type($share) {