From: hickert Date: Fri, 15 Dec 2006 05:39:16 +0000 (+0000) Subject: Fixed duplicated info message in dep_iframe.tpl X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3d526fe63c4beadfe061aff2b5f90f1174ee4ffb;p=gosa.git Fixed duplicated info message in dep_iframe.tpl Added Warning dialog - The user is now forced to confirm the save action, if the dn will change. Sanpshot and ACls entries will be broken after modifying the dn. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5397 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/departments/class_departmentGeneric.inc b/plugins/admin/departments/class_departmentGeneric.inc index 5c557e392..3efe8f8fd 100644 --- a/plugins/admin/departments/class_departmentGeneric.inc +++ b/plugins/admin/departments/class_departmentGeneric.inc @@ -57,6 +57,8 @@ class department extends plugin all POST / GET activity, "Department tagging" and the checkbox within the generic template. */ var $UnitTagDiabled = TRUE; + var $orig_base = ""; + var $orig_ou = ""; function department ($config, $dn) { @@ -66,6 +68,7 @@ class department extends plugin $this->ui= get_userinfo(); $this->dn= $dn; $this->orig_dn= $dn; + $this->orig_ou= $this->ou; $this->config= $config; /* Set base */ @@ -80,6 +83,8 @@ class department extends plugin $this->base= preg_replace ("/^[^,]+,/", "", $this->dn); } + $this->orig_base = $this->base; + /* Is administrational Unit? */ if ($dn != "new" && in_array_ics('gosaAdministrativeUnit', $this->attrs['objectClass'])){ $this->is_administrational_unit= true; diff --git a/plugins/admin/departments/class_departmentManagement.inc b/plugins/admin/departments/class_departmentManagement.inc index 9a82e127f..a880d8147 100644 --- a/plugins/admin/departments/class_departmentManagement.inc +++ b/plugins/admin/departments/class_departmentManagement.inc @@ -181,7 +181,18 @@ class departmentManagement extends plugin Edit department finished ***************/ - if ((isset($_POST['edit_finish'])) && (isset($this->deptabs->config))){ + if ((isset($_POST['edit_finish'])) && (isset($this->deptabs->config)) && !isset($_POST['dep_move_confirm'])){ + $this->deptabs->save_object(); + $obj = $this->deptabs->by_object['department']; + if($obj->orig_dn != "new"){ + if($obj->orig_ou != $obj->ou || $obj->base != $obj->orig_base){ + return($smarty->fetch(get_template_path("dep_move_confirm.tpl",TRUE))); + } + } + } + + /* Save changes */ + if ((isset($_POST['edit_finish'])|| isset($_POST['dep_move_confirm'])) && (isset($this->deptabs->config))){ /* Check tabs, will feed message array */ $message= $this->deptabs->check(); diff --git a/plugins/admin/departments/dep_iframe.tpl b/plugins/admin/departments/dep_iframe.tpl index 81ea9369d..396cf2cf0 100644 --- a/plugins/admin/departments/dep_iframe.tpl +++ b/plugins/admin/departments/dep_iframe.tpl @@ -1,6 +1,5 @@

{t}Processing the requested operation{/t}

{$message} -{t}As soon as the move operation has finished, you can scroll down to end of the page and press the 'Continue' button to continue with the department management dialog.{/t}

diff --git a/plugins/admin/departments/dep_move_confirm.tpl b/plugins/admin/departments/dep_move_confirm.tpl new file mode 100644 index 000000000..9338b7611 --- /dev/null +++ b/plugins/admin/departments/dep_move_confirm.tpl @@ -0,0 +1,19 @@ +
+  {t}Warning{/t} - {t}You are currently moving/renaming this department.{/t} +
+

+{t}Modifying a departments naming attribute 'ou' or base may corrupt acls and snapshot entries for all entire objects.{/t} +

+

+{t}GOsa can NOT fix this for you, yet.{/t} +

+

+{t}Before you confirm this action, ensure that everything will be as expected, possibly the best solution is a backup.{/t} +

+ +

+ +   + +

+