Code

Removed a couple of print_red calls
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 21 Feb 2008 07:24:41 +0000 (07:24 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 21 Feb 2008 07:24:41 +0000 (07:24 +0000)
Enabled unit tagging

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8998 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/ihtml/themes/default/msg_dialog.tpl
gosa-core/include/class_config.inc
gosa-core/include/class_hostActionQueue.inc
gosa-core/plugins/admin/acl/class_aclManagement.inc
gosa-core/plugins/admin/acl/class_aclRole.inc
gosa-core/plugins/admin/departments/class_departmentGeneric.inc
gosa-core/plugins/admin/departments/generic.tpl

index 1929f8863fe92f959405230e59f148739d5ef1ac..c0251705b44ec6ac20c378ffaf450c796d0bb89e 100644 (file)
 
                <div id='e_layer{$i_ID}' style="errorMsgDialog">
                        <div id="e_layerTitle{$i_ID}" style="errorMsgTitle">
-                               &nbsp;&nbsp;{$s_Title}
-                       </div>
-                       <div style="errorMsgSeperator"></div>
-                       <table style='width:100%' summary='' border=0>
-                               <tr>
-                                       <td style='vertical-align:top;padding:2px 10px 0px 10px'>
+                       <table><tr><td>
        {if $i_Type == ERROR_DIALOG}
                                                <img src='images/error.png' alt='{t}Error{/t}'>
        {elseif $i_Type == WARNING_DIALOG}
        {elseif $i_Type == INFO_DIALOG || $i_Type == CONFIRM_DIALOG}
                                                <img src='images/info.png' alt='{t}Information{/t}'>
        {/if}
-                                       </td>
+                       </td><td style='font-size: 1.1em; font-weight:bold;'>{$s_Title}</td></tr>
+                       </table>
+                       </div>
+                       <div style="errorMsgSeperator"></div>
+                       <table style='width:100%' summary='' border=0>
+                               <tr>
                                        <td style='width:100%'>
                                                <b>{$s_Message}</b>
                                                <br>
                <div id='e_layer{$i_ID}' class="errorMsgDialog">
 
                <div id="e_layerTitle{$i_ID}" class="errorMsgTitle">
-                       &nbsp;&nbsp;{$s_Title}
-               </div>
-               <div class="errorMsgSepeator"></div>
-
-                       <table style='width:100%' summary='' border=0>
-                               <tr>
-                                       <td style='vertical-align:top;padding:2px 10px 0px 10px'>
+                       <table><tr><td>
        {if $i_Type == ERROR_DIALOG}
                                                <img src='images/error.png' alt='{t}Error{/t}'>
        {elseif $i_Type == WARNING_DIALOG}
        {elseif $i_Type == INFO_DIALOG || $i_Type == CONFIRM_DIALOG}
                                                <img src='images/info.png' alt='{t}Information{/t}'>
        {/if}
-                                       </td>
+                       </td><td style='font-size: 1.1em; font-weight:bold;'>{$s_Title}</td></tr>
+               </table>
+               </div>
+               <div class="errorMsgSepeator"></div>
+
+                       <table style='width:100%' summary='' border=0>
+                               <tr>
                                        <td style='width:100%'>
                                                <b>{$s_Message}</b>
                                                <br>
index 69ee3f9097b2c66d7504ff661bd6b6d905c0df9f..a1c386f8293c15a91ac8c13c16f90e63f4caeeea 100644 (file)
@@ -221,7 +221,7 @@ class config  {
     /* Check for connection */
     if (is_null($this->ldap) || (is_int($this->ldap) && $this->ldap == 0)){
       $smarty= get_smarty();
-      msg_dialog::display(_("LDAP error"), _("Can't bind to LDAP. Please contact the system administrator."), FATAL_ERROR_DIALOG);
+      msg_dialog::display(_("LDAP error"), _("Cannot bind to LDAP. Please contact the system administrator."), FATAL_ERROR_DIALOG);
       exit();
     }
 
index c32be66ae6821f9ddc0803b84ccebfa239378808..c21ebfd76560da070b51e300406f501779272488 100644 (file)
@@ -140,6 +140,7 @@ class hostActionQueue {
 
       if(count($parts) != 10){
         print_red(_("Entry broken, skipped."));
+        msg_dialog::display(_("GOsa infrastructure"), _("Cannot read broken entry - skipped!"), WARNING_DIALOG);
       }else{
 
         $entry = array();
index d924c5998a0083c422fb1049dc0d52b652c1ec27..299cbd2e8a77c44f62f63e7ac4bd3aae481db593 100644 (file)
@@ -157,7 +157,7 @@ class aclManagement extends plugin
         $this->acltabs= new aclroletab($this->config, NULL,$this->dn);
         $this->acltabs->set_acl_base($this->DivListACL->selectedBase);
       }else{
-        print_red(_("You are not allowed to create a new role."));
+        msg_dialog::display(_("Permission error"), _("You have no permissions to create a new role!"), ERROR_DIALOG);
       }
     }
 
@@ -194,7 +194,7 @@ class aclManagement extends plugin
         /* Set ACL and move DN to the headline */
         session::set('objectinfo',$this->dn);
       }else{
-        print_red(_("You are not allowed to edit this acl."));
+        msg_dialog::display(_("Permission error"), _("You have no permissions to edit this ACL!"), ERROR_DIALOG);
       }
     }
 
@@ -247,7 +247,7 @@ class aclManagement extends plugin
 
         /* Obviously the acl isn't allowed to delete. Show message and
            clean session. */
-        print_red (_("You are not allowed to delete this acl!"));
+        msg_dialog::display(_("Permission error"), _("You have no permissions to delete this ACL!"), ERROR_DIALOG);
       }
     }
 
@@ -271,7 +271,7 @@ class aclManagement extends plugin
 
         /* Normally this shouldn't be reached, send some extra
            logs to notify the administrator */
-        print_red (_("You are not allowed to delete this acl role!"));
+        msg_dialog::display(_("Permission error"), _("You have no permissions to delete this role!"), ERROR_DIALOG);
 
         if(isset($this->ui->uid)){
           new log("security","aclroles/".get_class($this),$this->dn,array(),"Warning: '".$this->ui->uid."' tried to trick acl role deletion.");
@@ -310,7 +310,7 @@ class aclManagement extends plugin
 
         /* Obviously the acl isn't allowed to delete. Show message and
            clean session. */
-        print_red (_("You are not allowed to delete this acl!"));
+        msg_dialog::display(_("Permission error"), _("You have no permissions to delete this ACL!"), ERROR_DIALOG);
       }
     }
 
@@ -334,7 +334,7 @@ class aclManagement extends plugin
 
         /* Normally this shouldn't be reached, send some extra
            logs to notify the administrator */
-        print_red (_("You are not allowed to delete this acl!"));
+        msg_dialog::display(_("Permission error"), _("You have no permissions to delete this ACL!"), ERROR_DIALOG);
 
         if(isset($this->ui->uid)){
           new log("security","aclroles/".get_class($this),$this->dn,array(),"Warning: '".$this->ui->uid."' tried to trick acl role      deletion.");
index 01581ab9bb67b4ed5619f3c9b15bcd99ed31b9f6..5939a5b3815f5db011690d34cba7145a4db0e110 100644 (file)
@@ -593,7 +593,7 @@ class aclrole extends acl
         $all_names .= ", ...";
       }
       $all_names = "<span style='text-align:left;'>".$all_names."</span>";
-      print_red(sprintf(_("This role can't be removed while it is in use. Follwing objects are using this role %s"),$all_names));
+      msg_dialog::display(_("Object in use"), sprintf(_("This role cannot be removed while it is in use by these objects:")."<br><br>%s", $all_names), WARNING_DIALOG);
       return;
     }
         
index 03cedf2dc19ecc5fbd78bf9da26c721a89eb62d5..a6e443d0815bb2faaa29b4c0664efb475f3068f6 100644 (file)
@@ -50,13 +50,6 @@ class department extends plugin
        var $objectclasses= array("top", "gosaDepartment", "organizationalUnit");
   var $initially_was_tagged = false;
 
-  
-  /* Temporary disable the Unit Tag functionalityi.
-     This is not used anymore, cause of the new acl implementation. 
-     Setting this to TRUE will disable 
-      all POST / GET activity, "Department tagging" and the checkbox within the generic template.
-   */
-  var $UnitTagDiabled     = TRUE;
   var $orig_base = "";
   var $orig_ou = "";
 
@@ -166,13 +159,10 @@ class department extends plugin
                $smarty->assign("base_select", $this->base);
 
     /* Set admin unit flag */
-    $smarty->assign("UnitTagDiabled",$this->UnitTagDiabled);
-    if(!$this->UnitTagDiabled){
-      if ($this->is_administrational_unit) {
-        $smarty->assign("unitTag", "checked");
-      } else {
-        $smarty->assign("unitTag", "");
-      }
+    if ($this->is_administrational_unit) {
+      $smarty->assign("unitTag", "checked");
+    } else {
+      $smarty->assign("unitTag", "");
     }
 
                return($smarty->fetch (get_template_path('generic.tpl', TRUE)));
@@ -232,13 +222,11 @@ class department extends plugin
       }
 
       /* Save tagging flag */
-      if(!$this->UnitTagDiabled){
-        if ($this->acl_is_writeable("unitTag")){
-          if (isset($_POST['unitTag'])){
-            $this->is_administrational_unit= true;
-          } else {
-            $this->is_administrational_unit= false;
-          }
+      if ($this->acl_is_writeable("unitTag")){
+        if (isset($_POST['unitTag'])){
+          $this->is_administrational_unit= true;
+        } else {
+          $this->is_administrational_unit= false;
         }
       }
     }
@@ -291,70 +279,64 @@ class department extends plugin
        {
                $ldap= $this->config->get_ldap_link();
 
-    if(!$this->UnitTagDiabled){
+    /* Add tag objects if needed */
+    if ($this->is_administrational_unit){
 
-      /* Add tag objects if needed */
-      if ($this->is_administrational_unit){
+      /* If this wasn't tagged before add oc an reset unit tag */
+      if(!$this->initially_was_tagged){
+        $this->objectclasses[]= "gosaAdministrativeUnit";
+        $this->gosaUnitTag= "";
 
-        /* If this wasn't tagged before add oc an reset unit tag */
-        if(!$this->initially_was_tagged){
-          $this->objectclasses[]= "gosaAdministrativeUnit";
-          $this->gosaUnitTag= "";
-
-          /* It seams that this method is called twice, 
-             set this to true. to avoid adding this oc twice */
-          $this->initially_was_tagged = true;
-        }
+        /* It seams that this method is called twice, 
+           set this to true. to avoid adding this oc twice */
+        $this->initially_was_tagged = true;
+      }
 
-        if ($this->gosaUnitTag == ""){
+      if ($this->gosaUnitTag == ""){
 
-          /* It's unlikely, but check if already used... */
-          $try= 5;
-          $ldap->cd($this->config->current['BASE']);
-          while ($try--){
+        /* It's unlikely, but check if already used... */
+        $try= 5;
+        $ldap->cd($this->config->current['BASE']);
+        while ($try--){
 
-            /* Generate microtime stamp as tag */
-            list($usec, $sec)= explode(" ", microtime());
-            $time_stamp= preg_replace("/\./", "", $sec.$usec);
+          /* Generate microtime stamp as tag */
+          list($usec, $sec)= explode(" ", microtime());
+          $time_stamp= preg_replace("/\./", "", $sec.$usec);
 
-            $ldap->search("(&(objectClass=gosaAdministrativeUnit)(gosaUnitTag=$time_stamp))",array("gosaUnitTag"));
-            if ($ldap->count() == 0){
-              break;
-            }
-          }
-          if($try == 0) {
-            print_red(_("Fatal error: Can't find an unused tag to mark the administrative unit!"));
-            return;
+          $ldap->search("(&(objectClass=gosaAdministrativeUnit)(gosaUnitTag=$time_stamp))",array("gosaUnitTag"));
+          if ($ldap->count() == 0){
+            break;
           }
-          $this->gosaUnitTag= preg_replace("/\./", "", $sec.$usec);
         }
+        if($try == 0) {
+          msg_dialog::display(_("Fatal error"), _("Cannot find an unused tag for this administrative unit!"), WARNING_DIALOG);
+          return;
+        }
+        $this->gosaUnitTag= preg_replace("/\./", "", $sec.$usec);
       }
     }
-               plugin::save();
-
-    if(!$this->UnitTagDiabled){
+    plugin::save();
 
-      /* Remove tag information if needed */
-      if (!$this->is_administrational_unit){
-        $tmp= array();
+    /* Remove tag information if needed */
+    if (!$this->is_administrational_unit){
+      $tmp= array();
 
-        /* Remove gosaAdministrativeUnit from this plugin */
-        $has_unit_tag= false;
-        foreach($this->attrs['objectClass'] as $oc){
-          if (!preg_match("/^gosaAdministrativeUnit$/i", $oc)){
-            $tmp[]= $oc;
-          }
-          if (preg_match("/^gosaAdministrativeUnitTag$/i", $oc)){
-            $has_unit_tag= true;
-          }
+      /* Remove gosaAdministrativeUnit from this plugin */
+      $has_unit_tag= false;
+      foreach($this->attrs['objectClass'] as $oc){
+        if (!preg_match("/^gosaAdministrativeUnit$/i", $oc)){
+          $tmp[]= $oc;
         }
-        $this->attrs['objectClass']= $tmp;
-
-        if(!$has_unit_tag && isset($this->attrs['gosaUnitTag'])){
-          $this->attrs['gosaUnitTag']= array();
+        if (preg_match("/^gosaAdministrativeUnitTag$/i", $oc)){
+          $has_unit_tag= true;
         }
-        $this->gosaUnitTag = "";
       }
+      $this->attrs['objectClass']= $tmp;
+
+      if(!$has_unit_tag && isset($this->attrs['gosaUnitTag'])){
+        $this->attrs['gosaUnitTag']= array();
+      }
+      $this->gosaUnitTag = "";
     }
 
                /* Write back to ldap */
@@ -375,12 +357,9 @@ class department extends plugin
                }
     show_ldap_error($ldap->get_error(), sprintf(_("Saving of department with dn '%s' failed."),$this->dn));
 
-
-    if(!$this->UnitTagDiabled){
-      /* The parameter forces only to set must_be_tagged, and don't touch any objects 
-         This will be done later */
-      $this->tag_objects(true);
-    }
+    /* The parameter forces only to set must_be_tagged, and don't touch any objects 
+       This will be done later */
+    $this->tag_objects(true);
     
     /* Optionally execute a command after we're done */
                $this->postcreate();
index 7e353be8c826af3cf9df493c4e2ec662b7920094..a743aeb340d4baab2f2bb2dcdbb80ec8c68a399c 100644 (file)
  </tr>
 </table>
 
-
-{if !$UnitTagDiabled}
-
-<!--
-This is not used anymore cause of the new acl implementation
-Its functionality is disabled in class_departmentGeneric.inc
--->
-
 <p class='seperator'>&nbsp;</p>
 
 <table summary="" style="width:100%; vertical-align:top; text-align:left;" cellpadding=4>
@@ -122,7 +114,6 @@ Its functionality is disabled in class_departmentGeneric.inc
   </tr>
 </table>
 
-{/if}
 <!-- Place cursor -->
 <input type='hidden' name='dep_generic_posted' value='1'>
 <script language="JavaScript" type="text/javascript">