Code

Updated locales
[gosa.git] / gosa-core / plugins / admin / acl / class_aclRole.inc
index 5939a5b3815f5db011690d34cba7145a4db0e110..45462de8f4848472b09a798c67d6d3bdce9a9511 100644 (file)
@@ -1,10 +1,30 @@
 <?php
+/*
+ * This code is part of GOsa (http://www.gosa-project.org)
+ * Copyright (C) 2003-2008 GONICUS GmbH
+ *
+ * ID: $$Id$$
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 
 class aclrole extends acl
 {
   /* Definitions */
-  var $plHeadline= "Access control list templates";
-  var $plDescription= "This does something";
+  var $plHeadline= "Access control roles";
+  var $plDescription= "Edit AC roles";
 
   /* attribute list for save action */
   var $attributes= array('gosaAclTemplate',"cn","description");
@@ -107,7 +127,7 @@ class aclrole extends acl
     asort($this->aclObjects);
 
     /* Fill acl types */
-    $this->aclTypes= array( "reset" => _("Reset ACLs"),
+    $this->aclTypes= array( "reset" => _("Reset ACL"),
                              "one" => _("One level"),
                              "base" => _("Current object"),
                              "sub" => _("Complete subtree"),
@@ -232,7 +252,7 @@ class aclrole extends acl
           continue;
         }
 
-        /* Ordinary ACLs */
+        /* Ordinary ACL */
         if (!isset($new_acl[$object])){
           $new_acl[$object]= array();
         }
@@ -337,8 +357,8 @@ class aclrole extends acl
         $field2= array("string" => $this->assembleAclSummary($entry));
         $action= "<input type='image' name='sortup_$key' alt='up' title='"._("Up")."' src='images/sort_up.png' align='top'>";
         $action.= "<input type='image' name='sortdown_$key' alt='down' title='"._("Down")."' src='images/sort_down.png'>";
-        $action.= "<input class='center' type='image' src='images/edit.png' alt='"._("edit")."' name='acl_edit_$key' title='"._("Edit ACL")."'>";
-        $action.= "<input class='center' type='image' src='images/edittrash.png' alt='"._("delete")."' name='acl_del_$key' title='"._("Delete ACL")."'>";
+        $action.= "<input class='center' type='image' src='images/edit.png' alt='"._("Edit")."' name='acl_edit_$key' title='".msgPool::editButton(_("ACL"))."'>";
+        $action.= "<input class='center' type='image' src='images/edittrash.png' alt='"._("Delete")."' name='acl_del_$key' title='".msgPool::delButton(_("ACL"))."'>";
 
         $field3= array("string" => $action, "attach" => "style='border-right:0px;width:50px;text-align:right;'");
         $aclList->AddEntry(array($field1, $field2, $field3));
@@ -377,13 +397,13 @@ class aclrole extends acl
         if ($summary == ""){
           $summary= '<i>'._("No ACL settings for this category").'</i>';
         } else {
-          $summary= sprintf(_("Contains ACLs for these objects: %s"), preg_replace('/, $/', '', $summary));
+          $summary= sprintf(_("ACL for these objects: %s"), preg_replace('/, $/', '', $summary));
         }
 
         $field1= array("string" => $dsc, "attach" => "style='width:140px'");
         $field2= array("string" => $summary);
-        $action= "<input class='center' type='image' src='images/edit.png' alt='"._("edit")."' name='cat_edit_$section' title='"._("Edit categories ACLs")."'>";
-        $action.= "<input class='center' type='image' src='images/edittrash.png' alt='"._("delete")."' name='cat_del_$section' title='"._("Clear categories ACLs")."'>";
+        $action= "<input class='center' type='image' src='images/edit.png' alt='"._("Edit")."' name='cat_edit_$section' title='"._("Edit category ACL")."'>";
+        $action.= "<input class='center' type='image' src='images/edittrash.png' alt='"._("Delete")."' name='cat_del_$section' title='"._("Reset category ACL")."'>";
         $field3= array("string" => $action, "attach" => "style='border-right:0px;width:50px'");
         $aclList->AddEntry(array($field1, $field2, $field3));
       }
@@ -561,9 +581,11 @@ class aclrole extends acl
       new log("create","aclroles/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
     }
 
-    show_ldap_error($ldap->get_error(), sprintf(_("Saving ACLs with dn '%s' failed."),$this->dn));
+    if (!$ldap->success()){
+      msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, "", get_class()));
+    }
 
-    /* Refresh users ACLs */
+    /* Refresh users ACL */
     $ui= get_userinfo();
     $ui->loadACL();
     session::set('ui',$ui);
@@ -599,7 +621,9 @@ class aclrole extends acl
         
     $ldap->rmDir($this->dn);
     new log("remove","aclroles/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
-    show_ldap_error($ldap->get_error(), sprintf(_("Removing of aclRole with dn '%s' failed."),$this->dn));
+    if (!$ldap->success()){
+      msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, "", get_class()));
+    }
 
     /* Optionally execute a command after we're done */
     $this->handle_post_events("remove");
@@ -611,7 +635,9 @@ class aclrole extends acl
       $og= new ogroup($this->config, $ldap->getDN());
       unset($og->member[$this->dn]);
       $og->save ();
-      show_ldap_error($ldap->get_error(), sprintf(_("Removing aclRole from objectgroup '%s' failed"), $og->dn));
+      if (!$ldap->success()){
+        msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $og->dn, "", get_class()));
+      }
     }
   }
 
@@ -666,12 +692,12 @@ class aclrole extends acl
   {
     return (array(
           "plShortName" => _("Role"),
-          "plDescription" => _("ACL roles"),
+          "plDescription" => _("Access control roles"),
           "plSelfModify"  => FALSE,
           "plDepends"     => array(),
           "plPriority"    => 0,
           "plSection"     => array("admin"),
-          "plCategory"    => array("aclroles" => array("objectClass" => "gosaRole", "description" => _("Acl roles"))),
+          "plCategory"    => array("aclroles" => array("objectClass" => "gosaRole", "description" => _("Access control roles"))),
 
           "plProvidedAcls"    => array(
             "cn"                => _("Name"),