From 7fd55b33640992d1204173e385c10d26b2b3a477 Mon Sep 17 00:00:00 2001 From: cajus Date: Fri, 29 Jan 2010 16:54:29 +0000 Subject: [PATCH] Moved to POST for selector lists git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15465 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_baseSelector.inc | 17 ++++++++------ .../admin/departments/class_department.inc | 23 ++++++++++--------- .../plugins/admin/groups/class_group.inc | 22 +++++++++--------- .../plugins/admin/ogroups/class_ogroup.inc | 23 ++++++++++--------- .../plugins/personal/generic/class_user.inc | 22 +++++++++--------- 5 files changed, 56 insertions(+), 51 deletions(-) diff --git a/gosa-core/include/class_baseSelector.inc b/gosa-core/include/class_baseSelector.inc index fa9ad7ddb..81951f440 100644 --- a/gosa-core/include/class_baseSelector.inc +++ b/gosa-core/include/class_baseSelector.inc @@ -101,9 +101,9 @@ class baseSelector { // Analyze for base changes if needed $this->action= null; $last_base= $this->base; - if(isset($_REQUEST['PID']) && $_REQUEST['PID'] == $this->pid) { - if (isset($_REQUEST['REBASE'])) { - $new_base= base64_decode($_REQUEST['REBASE']); + if(isset($_REQUEST['BPID']) && $_REQUEST['BPID'] == $this->pid) { + if (isset($_POST['bs_rebase_'.$this->pid]) && !empty($_POST['bs_rebase_'.$this->pid])) { + $new_base= base64_decode($_POST['bs_rebase_'.$this->pid]); if (isset($this->pathMapping[$new_base])) { $this->base= $new_base; $this->action= 'rebase'; @@ -132,7 +132,7 @@ class baseSelector { return true; } - $link= "href='?plug=".$_GET['plug']."&PID=".$this->pid."&REBASE=".base64_encode($config->current['BASE'])."'"; + $link= "onclick=\"\$('bs_rebase_".$this->pid."').value='".base64_encode($config->current['BASE'])."'; $('submit_tree_base_".$this->pid."').click();\""; $this->tree= "pid."').hide()\" onfocus=\"\$('bs_".$this->pid."').hide()\" onmouseover=\"Element.clonePosition(\$('bs_".$this->pid."'), 'bs_input_".$this->pid."', {setHeight: false, setWidth: false, offsetTop:(Element.getHeight('bs_input_".$this->pid."'))});\$('bs_".$this->pid."').show();\" onmouseout=\"rtimer= Element.hide.delay(0.25, 'bs_".$this->pid."')\" value=\"".preg_replace('/"/', '"',$this->pathMapping[$this->base])."\">"; @@ -174,7 +174,7 @@ class baseSelector { $this->tree.= "\n"; } $selected= $this->base == $base?" class='treeListSelected'":""; - $link= "href='?plug=".$_GET['plug']."&PID=".$this->pid."&REBASE=".base64_encode($base)."'"; + $link= "onclick=\"\$('bs_rebase_".$this->pid."').value='".base64_encode($base)."';$('submit_tree_base_".$this->pid."').click();\""; $this->tree.= "
  • ".str_replace(' ', ' ', ldap::fix(preg_replace('/^[a-z0-9]+=([^,]+),.*$/i', '$1', $base))).""; $last_indent= $indent; @@ -191,6 +191,9 @@ class baseSelector { if ($this->submitButton) { $this->tree.= " "; } + $this->tree.= ""; + $this->tree.= ""; + $this->tree.= ""; return true; } @@ -209,8 +212,8 @@ class baseSelector { function getAction() { - // Do not do anything if this is not our PID, or there's even no PID available... - if(!isset($_REQUEST['PID']) || $_REQUEST['PID'] != $this->pid) { + // Do not do anything if this is not our BPID, or there's even no BPID available... + if(!isset($_REQUEST['BPID']) || $_REQUEST['BPID'] != $this->pid) { return; } diff --git a/gosa-core/plugins/admin/departments/class_department.inc b/gosa-core/plugins/admin/departments/class_department.inc index 35baf3a11..685564bf5 100644 --- a/gosa-core/plugins/admin/departments/class_department.inc +++ b/gosa-core/plugins/admin/departments/class_department.inc @@ -230,17 +230,6 @@ class department extends plugin /* Save data to object */ function save_object() { - /* Refresh base */ - if ($this->acl_is_moveable($this->base)){ - if (!$this->baseSelector->update()) { - msg_dialog::display(_("Error"), msgPool::permMove(), ERROR_DIALOG); - } - if ($this->base != $this->baseSelector->getBase()) { - $this->base= $this->baseSelector->getBase(); - $this->is_modified= TRUE; - } - } - if (isset($_POST['dep_generic_posted'])){ $nA = $this->namingAttr; @@ -255,6 +244,18 @@ class department extends plugin plugin::save_object(); $this->base = $base_tmp; + /* Refresh base */ + if ($this->acl_is_moveable($this->base)){ + if (!$this->baseSelector->update()) { + msg_dialog::display(_("Error"), msgPool::permMove(), ERROR_DIALOG); + } + if ($this->base != $this->baseSelector->getBase()) { + $this->base= $this->baseSelector->getBase(); + $this->is_modified= TRUE; + } + } + + /* Save tagging flag */ if ($this->acl_is_writeable("gosaUnitTag")){ if (isset($_POST['is_administrational_unit'])){ diff --git a/gosa-core/plugins/admin/groups/class_group.inc b/gosa-core/plugins/admin/groups/class_group.inc index 456eb4c25..d63a6965b 100644 --- a/gosa-core/plugins/admin/groups/class_group.inc +++ b/gosa-core/plugins/admin/groups/class_group.inc @@ -737,17 +737,6 @@ class group extends plugin /* Save data to object */ function save_object() { - /* Refresh base */ - if ($this->acl_is_moveable($this->base)){ - if (!$this->baseSelector->update()) { - msg_dialog::display(_("Error"), msgPool::permMove(), ERROR_DIALOG); - } - if ($this->base != $this->baseSelector->getBase()) { - $this->base= $this->baseSelector->getBase(); - $this->is_modified= TRUE; - } - } - /* Save additional values for possible next step */ if (isset($_POST['groupedit'])){ @@ -758,6 +747,17 @@ class group extends plugin plugin::save_object(); $this->base = $base_tmp; + /* Refresh base */ + if ($this->acl_is_moveable($this->base)){ + if (!$this->baseSelector->update()) { + msg_dialog::display(_("Error"), msgPool::permMove(), ERROR_DIALOG); + } + if ($this->base != $this->baseSelector->getBase()) { + $this->base= $this->baseSelector->getBase(); + $this->is_modified= TRUE; + } + } + $this->force_gid= 0; /* Only reset sambagroup flag if we are able to write this flag */ diff --git a/gosa-core/plugins/admin/ogroups/class_ogroup.inc b/gosa-core/plugins/admin/ogroups/class_ogroup.inc index 5c51363c5..e98bc65c2 100644 --- a/gosa-core/plugins/admin/ogroups/class_ogroup.inc +++ b/gosa-core/plugins/admin/ogroups/class_ogroup.inc @@ -466,17 +466,6 @@ class ogroup extends plugin /* Save data to object */ function save_object() { - /* Refresh base */ - if ($this->acl_is_moveable($this->base)){ - if (!$this->baseSelector->update()) { - msg_dialog::display(_("Error"), msgPool::permMove(), ERROR_DIALOG); - } - if ($this->base != $this->baseSelector->getBase()) { - $this->base= $this->baseSelector->getBase(); - $this->is_modified= TRUE; - } - } - /* Save additional values for possible next step */ if (isset($_POST['ogroupedit'])){ @@ -509,6 +498,18 @@ class ogroup extends plugin $base_tmp = $this->base; plugin::save_object(); $this->base = $base_tmp; + + /* Refresh base */ + if ($this->acl_is_moveable($this->base)){ + if (!$this->baseSelector->update()) { + msg_dialog::display(_("Error"), msgPool::permMove(), ERROR_DIALOG); + } + if ($this->base != $this->baseSelector->getBase()) { + $this->base= $this->baseSelector->getBase(); + $this->is_modified= TRUE; + } + } + } } diff --git a/gosa-core/plugins/personal/generic/class_user.inc b/gosa-core/plugins/personal/generic/class_user.inc index aec8e0340..4ceb1dc2a 100644 --- a/gosa-core/plugins/personal/generic/class_user.inc +++ b/gosa-core/plugins/personal/generic/class_user.inc @@ -740,17 +740,6 @@ class user extends plugin /* Save data to object */ function save_object() { - /* Refresh base */ - if ($this->acl_is_moveable($this->base)){ - if (!$this->baseSelector->update()) { - msg_dialog::display(_("Error"), msgPool::permMove(), ERROR_DIALOG); - } - if ($this->base != $this->baseSelector->getBase()) { - $this->base= $this->baseSelector->getBase(); - $this->is_modified= TRUE; - } - } - if(isset($_POST['generic']) || isset($_POST['multiple_user_posted'])){ /* Make a backup of the current selected base */ @@ -759,6 +748,17 @@ class user extends plugin /* Parents save function */ plugin::save_object (); + /* Refresh base */ + if ($this->acl_is_moveable($this->base)){ + if (!$this->baseSelector->update()) { + msg_dialog::display(_("Error"), msgPool::permMove(), ERROR_DIALOG); + } + if ($this->base != $this->baseSelector->getBase()) { + $this->base= $this->baseSelector->getBase(); + $this->is_modified= TRUE; + } + } + /* Sync lists */ $this->gosaLoginRestrictionWidget->save_object(); if ($this->gosaLoginRestrictionWidget->isModified()) { -- 2.30.2