summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 673bb86)
raw | patch | inline | side by side (parent: 673bb86)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 8 Dec 2006 12:40:03 +0000 (12:40 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 8 Dec 2006 12:40:03 +0000 (12:40 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5350 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/include/class_tabs.inc b/include/class_tabs.inc
index a8ffef5b0128d0bc2e32c25af09e310eedb8d29a..15c5fa0fe1a03197d2f96a005fe96bb21504747a 100644 (file)
--- a/include/class_tabs.inc
+++ b/include/class_tabs.inc
function set_acl($acl)
{
- /* Set local acl */
- $this->acl= $acl;
+ /* Set local acl */
+ $this->acl= $acl;
- /* Setup for all plugins */
- foreach ($this->by_object as $key => $obj){
- $sacl= get_module_permission($acl, "$key", $this->dn);
- $obj->acl= $sacl;
- $this->by_object[$key]= $obj;
- }
+ /* Setup for all plugins */
+ foreach ($this->by_object as $key => $obj){
+ $sacl= get_module_permission($acl, "$key", $this->dn);
+ $obj->acl= $sacl;
+ $this->by_object[$key]= $obj;
+ }
}
function delete()
{
- /* Check if all plugins will ACK for deletion */
- foreach (array_reverse($this->by_object) as $key => $obj){
- $reason= $obj->allow_remove();
- if ($reason != ""){
- print_red(sprintf(_("Delete process has been canceled by plugin '%s': %s"), $key, $reason));
- return;
- }
- }
+ /* Check if all plugins will ACK for deletion */
+ foreach (array_reverse($this->by_object) as $key => $obj){
+ $reason= $obj->allow_remove();
+ if ($reason != ""){
+ print_red(sprintf(_("Delete process has been canceled by plugin '%s': %s"), $key, $reason));
+ return;
+ }
+ }
- /* Delete for all plugins */
- foreach (array_reverse($this->by_object) as $key => $obj){
- $obj->remove_from_parent();
- }
+ /* Delete for all plugins */
+ foreach (array_reverse($this->by_object) as $key => $obj){
+ $obj->remove_from_parent();
+ }
}
function password_change_needed()
{
- /* Ask all plugins for needed password changes */
- foreach ($this->by_object as $key => $obj){
- if ($obj->password_change_needed()){
- return TRUE;
- }
- }
+ /* Ask all plugins for needed password changes */
+ foreach ($this->by_object as $key => $obj){
+ if ($obj->password_change_needed()){
+ return TRUE;
+ }
+ }
- return FALSE;
+ return FALSE;
}
function check($ignore_account= FALSE)
index 77003f9e706d8bfeb1571e87f51aba54d3808492..99e7286100c5a094b0399fefbe7b8e12b2ad8a43 100644 (file)
$this->subtreeACL[$base][]= $attrs["gosaSubtreeACL"][$i];
}
}
+
}
}
index 678ef0b7f00a5112714efafe154ad8d8809f9e74..5d52314bee70e8ebdbd9d73ccbc009a13509446d 100644 (file)
"gidNumber");
$ACLD['appgroup']= array();
$ACLD['all']= array();
+$ACLD['acl']= array('acl');
$ACLD['mailgroup']= array("default_permission",
"imap_perms",
"member_permissions",
index 25799507bbad8184b12eed8fb59d382b3b055d1c..3507d91fa73d4d9b3fda4bdc891a9d3e316a35ca 100644 (file)
var $object= "";
var $current_acl= "";
var $selfflag= FALSE;
+ var $tacl= "";
var $gosaSubtreeACL;
function execute()
{
+ if (chkacl($this->acl, 'acl') != ""){
+ $display= "<b>"._("You have no permissions to view and edit ACLs.")."</b>";
+
+ return ($display);
+ }
+
/* Call parent execute */
plugin::execute();
$display= $smarty->fetch (get_template_path('acl.tpl', TRUE));
/* Show acl stuff */
- $this->acl= get_module_permission (array($this->current_acl), $this->object, "");
+ $this->tacl= get_module_permission (array($this->current_acl), $this->object, "");
$display.= $this->print_attributes ($this->objects[$this->object]);
return ($display);
}
/* Save data to object */
function save_object()
{
- plugin::save_object();
+ if (chkacl($this->acl, 'acl') == ""){
+ plugin::save_object();
- if (!isset($_POST['object'])){
- return;
- }
+ if (!isset($_POST['object'])){
+ return;
+ }
- /* Strip of old information */
- if ($this->object == "all"){
- $this->current_acl= preg_replace ( "/[,]?all[,]?/", "", $this->current_acl);
- }
- $this->current_acl= preg_replace ( "/(^|[^a-z0-9A-Z])$this->object#[^,]*[,]?/", ",", $this->current_acl);
+ /* Strip of old information */
+ if ($this->object == "all"){
+ $this->current_acl= preg_replace ( "/[,]?all[,]?/", "", $this->current_acl);
+ }
+ $this->current_acl= preg_replace ( "/(^|[^a-z0-9A-Z])$this->object#[^,]*[,]?/", ",", $this->current_acl);
- /* assemble new attributes */
- $attrs= "";
- if (isset($_POST['all'])){
- $attrs.= "#all";
- }
- if ($this->object != "all" && !isset($_POST['all']) && $this->object != ""){
- foreach ($this->objects[$this->object] as $key => $val){
- if (is_integer($key)){
- $aname= $val;
- } else {
- $aname= $key;
- }
- if (isset($_POST[$aname])){
- $attrs.= "#$aname";
+ /* assemble new attributes */
+ $attrs= "";
+ if (isset($_POST['all'])){
+ $attrs.= "#all";
+ }
+ if ($this->object != "all" && !isset($_POST['all']) && $this->object != ""){
+ foreach ($this->objects[$this->object] as $key => $val){
+ if (is_integer($key)){
+ $aname= $val;
+ } else {
+ $aname= $key;
+ }
+ if (isset($_POST[$aname])){
+ $attrs.= "#$aname";
+ }
}
}
- }
- /* append information */
- if ($attrs != ""){
- $tmp= $this->object;
- $attrs= $tmp.$attrs;
- }
- if ($this->current_acl != "" && $attrs != ""){
- $this->current_acl.= ",";
- }
- $this->current_acl.= $attrs;
- if (preg_match("/all#all/", $this->current_acl)){
- $this->current_acl= "all";
- }
- if (preg_match("/^all,/", $this->current_acl)){
- $this->current_acl= "all";
- }
+ /* append information */
+ if ($attrs != ""){
+ $tmp= $this->object;
+ $attrs= $tmp.$attrs;
+ }
+ if ($this->current_acl != "" && $attrs != ""){
+ $this->current_acl.= ",";
+ }
+ $this->current_acl.= $attrs;
+ if (preg_match("/all#all/", $this->current_acl)){
+ $this->current_acl= "all";
+ }
+ if (preg_match("/^all,/", $this->current_acl)){
+ $this->current_acl= "all";
+ }
- /* Save current object selection */
- if (isset($_POST['object'])){
- $this->object= $_POST['object'];
- }
- if (isset($_POST['selfflag'])){
- $this->selfflag= TRUE;
- } else {
- $this->selfflag= FALSE;
- }
+ /* Save current object selection */
+ if (isset($_POST['object'])){
+ $this->object= $_POST['object'];
+ }
+ if (isset($_POST['selfflag'])){
+ $this->selfflag= TRUE;
+ } else {
+ $this->selfflag= FALSE;
+ }
- /* Remove double colons, strip trailing colon... */
- $this->current_acl= preg_replace("/,,/", ",", $this->current_acl);
- $this->current_acl= preg_replace("/,$/", "", $this->current_acl);
+ /* Remove double colons, strip trailing colon... */
+ $this->current_acl= preg_replace("/,,/", ",", $this->current_acl);
+ $this->current_acl= preg_replace("/,$/", "", $this->current_acl);
+ $this->current_acl= preg_replace("/^,/", "", $this->current_acl);
+ }
}
function print_attributes ($name)
{
$display= "<input type=checkbox name=\"all\" value=\"1\"";
- if (chkacl ($this->acl, "all") == ""){
+ if (chkacl ($this->tacl, "all") == ""){
$display.= " checked";
}
$display.= "><b>"._("All fields are writeable")."</b><br>";
if (is_integer($key)){
$display.= "<td><input type=checkbox name=\"$val\" value=\"1\" ";
- if (chkacl ($this->acl, "$val") == ""){
+ if (chkacl ($this->tacl, "$val") == ""){
$display.= "checked";
}
$display.= ">$val</td>";
} else {
$display.= "<td><input type=checkbox name=\"$key\" value=\"1\"";
- if (chkacl ($this->acl, "$key") == ""){
+ if (chkacl ($this->tacl, "$key") == ""){
$display.= "checked";
}
$display.= ">"._($val)."</td>";