X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Fplugins%2Fadmin%2Facl%2Fclass_aclRole.inc;h=45462de8f4848472b09a798c67d6d3bdce9a9511;hb=fd450a2cdb42590454fa0feebf2691cebbc2829f;hp=16c7e44737d83da46fcef82d26e37af4c103cef2;hpb=951ff52238278141c5d423bda877eea92c86ce32;p=gosa.git diff --git a/gosa-core/plugins/admin/acl/class_aclRole.inc b/gosa-core/plugins/admin/acl/class_aclRole.inc index 16c7e4473..45462de8f 100644 --- a/gosa-core/plugins/admin/acl/class_aclRole.inc +++ b/gosa-core/plugins/admin/acl/class_aclRole.inc @@ -1,10 +1,30 @@ dn == "new"){ - $this->base = $_SESSION['CurrentMainBase']; + $this->base = session::get('CurrentMainBase'); }else{ $this->base = preg_replace("/^[^,]+,[^,]+,/","",$this->dn); new log("view","aclroles/".get_class($this),$this->dn); @@ -56,7 +76,7 @@ class aclrole extends acl ksort($this->gosaAclTemplate); /* Extract available categories from plugin info list */ - $tmp= get_global('plist'); + $tmp= session::get('plist'); $plist= $tmp->info; $oc = array(); foreach ($plist as $class => $acls){ @@ -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"), @@ -154,7 +174,7 @@ class aclrole extends acl } } - $tmp= get_global('plist'); + $tmp= session::get('plist'); $plist= $tmp->info; /* Handle posts */ @@ -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)); } @@ -426,7 +446,7 @@ class aclrole extends acl function sort_by_priority($list) { - $tmp= get_global('plist'); + $tmp= session::get('plist'); $plist= $tmp->info; asort($plist); $newSort = array(); @@ -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"),