X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Fplugins%2Fadmin%2Facl%2Fclass_aclRole.inc;h=45462de8f4848472b09a798c67d6d3bdce9a9511;hb=fd450a2cdb42590454fa0feebf2691cebbc2829f;hp=9c72d0ab5269af16f55e89ebf34349dabed69eed;hpb=6a9f0a5811944230a4d0f6a57563e16c7951d5c7;p=gosa.git diff --git a/gosa-core/plugins/admin/acl/class_aclRole.inc b/gosa-core/plugins/admin/acl/class_aclRole.inc index 9c72d0ab5..45462de8f 100644 --- a/gosa-core/plugins/admin/acl/class_aclRole.inc +++ b/gosa-core/plugins/admin/acl/class_aclRole.inc @@ -1,10 +1,30 @@ 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= ""; $action.= ""; - $action.= ""; - $action.= ""; + $action.= ""; + $action.= ""; $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= ''._("No ACL settings for this category").''; } 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= ""; - $action.= ""; + $action= ""; + $action.= ""; $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); @@ -593,25 +615,29 @@ class aclrole extends acl $all_names .= ", ..."; } $all_names = "".$all_names.""; - 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:")."

%s", $all_names), WARNING_DIALOG); return; } $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"); /* Delete references to object groups */ $ldap->cd ($this->config->current['BASE']); - $ldap->search ("(&(objectClass=gosaGroupOfNames)(member=".$this->dn."))", array("cn")); + $ldap->search ("(&(objectClass=gosaGroupOfNames)(member=".LDAP::prepare4filter($this->dn)."))", array("cn")); while ($ldap->fetch()){ $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"),