Code

Fixed duplicated info message in dep_iframe.tpl
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 15 Dec 2006 05:39:16 +0000 (05:39 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 15 Dec 2006 05:39:16 +0000 (05:39 +0000)
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

plugins/admin/departments/class_departmentGeneric.inc
plugins/admin/departments/class_departmentManagement.inc
plugins/admin/departments/dep_iframe.tpl
plugins/admin/departments/dep_move_confirm.tpl [new file with mode: 0644]

index 5c557e3928125e437ab3884dcb81d844a384dfe4..3efe8f8fdb27b8400285e58450d0c8d2f8cb3680 100644 (file)
@@ -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;
index 9a82e127f69582b0c0ae51dad11d05128895dffd..a880d81477a9a7e9ce8d29175a5293c5cbe20cc0 100644 (file)
@@ -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();
index 81ea9369d5b22434156ce8adffbe0cb182aea5d8..396cf2cf0e977080221e56c807e9290ec5b89232 100644 (file)
@@ -1,6 +1,5 @@
 <h2>{t}Processing the requested operation{/t}</h2>
 {$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}
 <br>
 <br>
 <div style="margin:3px;background-color:white; border:1px solid #A0A0A0">
diff --git a/plugins/admin/departments/dep_move_confirm.tpl b/plugins/admin/departments/dep_move_confirm.tpl
new file mode 100644 (file)
index 0000000..9338b76
--- /dev/null
@@ -0,0 +1,19 @@
+<div style="font-size:18px;">
+ <img alt="" src="images/button_cancel.png" align=top>&nbsp;{t}Warning{/t} - {t}You are currently moving/renaming this department.{/t}
+</div>
+<p>
+{t}Modifying a departments naming attribute 'ou' or base may corrupt acls and snapshot entries for all entire objects.{/t}
+</p>
+<p>
+{t}GOsa can NOT fix this for you, yet.{/t}
+</p>
+<p>
+{t}Before you confirm this action, ensure that everything will be as expected, possibly the best solution is a backup.{/t} 
+</p>
+
+<p class="plugbottom">
+       <input type='submit' name='dep_move_confirm' value='{t}Save{/t}'>
+       &nbsp;
+       <input type='submit' name='cancel_save' value='{t}Cancel{/t}'>
+</p>
+