X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Finclude%2Fclass_acl.inc;h=02d0a41a1b33d518c4ef6fa92231dc3098f7c2a5;hb=3a308e40188042fb56365af23190514a85621963;hp=b5852d5cde62ae27e0c1ee432774f0ef52e2478e;hpb=6170df8a276b59ad49bc98182df8a16bc9aaa766;p=gosa.git diff --git a/gosa-core/include/class_acl.inc b/gosa-core/include/class_acl.inc index b5852d5cd..02d0a41a1 100644 --- a/gosa-core/include/class_acl.inc +++ b/gosa-core/include/class_acl.inc @@ -87,7 +87,18 @@ class acl extends plugin $ldap->search('(&(objectClass=gosaAccount)(gosaUnitTag='.$tag.'))', array('uid', 'cn')); } while ($attrs= $ldap->fetch()){ - $this->users['U:'.$attrs['dn']]= $attrs['cn'][0].' ['.$attrs['uid'][0].']'; + + // Allow objects without cn to be listed without causing an error. + if(!isset($attrs['cn'][0]) && isset($attrs['uid'][0])){ + $this->users['U:'.$attrs['dn']]= $attrs['uid'][0]; + }elseif(!isset($attrs['uid'][0]) && isset($attrs['cn'][0])){ + $this->users['U:'.$attrs['dn']]= $attrs['cn'][0]; + }elseif(!isset($attrs['uid'][0]) && !isset($attrs['cn'][0])){ + $this->users['U:'.$attrs['dn']]= $attrs['dn']; + }else{ + $this->users['U:'.$attrs['dn']]= $attrs['cn'][0].' ['.$attrs['uid'][0].']'; + } + } ksort($this->users); @@ -132,7 +143,7 @@ class acl extends plugin } /* Objects */ - $tmp= session::get('plist'); + $tmp= session::global_get('plist'); $plist= $tmp->info; $cats = array(); if (isset($this->parent) && $this->parent !== NULL){ @@ -230,7 +241,7 @@ class acl extends plugin /* Call parent execute */ plugin::execute(); - $tmp= session::get('plist'); + $tmp= session::global_get('plist'); $plist= $tmp->info; /* Handle posts */ @@ -245,6 +256,17 @@ class acl extends plugin $aclDialog= FALSE; $firstedit= FALSE; + /* Act on HTML post and gets here. + */ + if(isset($_GET['id']) && isset($_GET['act']) && $_GET['act'] == "edit"){ + $id = trim($_GET['id']); + $this->dialogState= 'create'; + $firstedit= TRUE; + $this->dialog= TRUE; + $this->currentIndex= $id; + $this->loadAclEntry(); + } + foreach($_POST as $name => $post){ /* Actions... */ @@ -456,9 +478,15 @@ class acl extends plugin if(!$this->acl_is_readable("")) continue; $action =""; + + if($this->acl_is_readable("")){ + $link = "".$this->assembleAclSummary($entry).""; + }else{ + $link = $this->assembleAclSummary($entry); + } $field1= array("string" => $this->aclTypes[$entry['type']], "attach" => "style='width:150px'"); - $field2= array("string" => $this->assembleAclSummary($entry)); + $field2= array("string" => $link); if($this->acl_is_writeable("")){ $action.= "info; asort($plist); $newSort = array(); @@ -664,7 +692,7 @@ class acl extends plugin { $display= ""; $cols= 3; - $tmp= session::get('plist'); + $tmp= session::global_get('plist'); $plist= $tmp->info; asort($plist); @@ -708,8 +736,11 @@ class acl extends plugin /* Create sub acl if it does not exist */ if (!isset($this->aclContents[$key])){ $this->aclContents[$key]= array(); + } + if(!isset($this->aclContents[$key][0])){ $this->aclContents[$key][0]= ''; } + $currentAcl= $this->aclContents[$key]; /* Get the overall plugin acls @@ -719,22 +750,34 @@ class acl extends plugin $overall_acl = $currentAcl[0]; } + // Detect configured plugins + $expand = count($currentAcl) > 1 || $currentAcl[0] != ""; + /* Object header */ $tname= preg_replace("/[^a-z0-9]/i","_",$name); - if(session::get('js')) { - if(isset($_SERVER['HTTP_USER_AGENT']) && preg_match("/gecko/i",$_SERVER['HTTP_USER_AGENT'])) { + + if($expand){ + $back_color = "#C8C8FF"; + }else{ + $back_color = "#C8C8C8"; + } + + if(session::global_get('js')) { + if(isset($_SERVER['HTTP_USER_AGENT']) && + (preg_match("/gecko/i",$_SERVER['HTTP_USER_AGENT'])) || + (preg_match("/presto/i",$_SERVER['HTTP_USER_AGENT']))) { $display.= "\n". "\n ". - "\n ". - "\n ". + "\n ". + "\n ". "\n "; } else if (isset($_SERVER['HTTP_USER_AGENT']) && preg_match("/ie/i",$_SERVER['HTTP_USER_AGENT'])) { $display.= "\n
"._("Object").": $name". - "\n "._("Object").": $name". + "\n
". "\n ". "\n ". "\n ". + "\n ". "\n "; } else { $display.= "\n
"._("Object").": $name". - "\n
". @@ -770,9 +813,9 @@ class acl extends plugin /* Walk through the list of attributes */ $cnt= 1; $splist= $plist[preg_replace('%^.*/%', '', $key)]['plProvidedAcls']; -# asort($splist); - if(session::get('js')) { - if(isset($_SERVER['HTTP_USER_AGENT']) && preg_match("/gecko/i",$_SERVER['HTTP_USER_AGENT'])) { + if(session::global_get('js')) { + if(isset($_SERVER['HTTP_USER_AGENT']) && + (preg_match("/gecko/i",$_SERVER['HTTP_USER_AGENT'])) || (preg_match("/presto/i",$_SERVER['HTTP_USER_AGENT']))) { $display.= "\n ". "\n ". @@ -1167,13 +1216,13 @@ class acl extends plugin } if (!$ldap->success()){ - msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class())); + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class()), ERROR_DIALOG); } /* Refresh users ACLs */ $ui= get_userinfo(); $ui->loadACL(); - session::set('ui',$ui); + session::global_set('ui',$ui); }
". "\n ". "\n ". "\n