summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8523b4f)
raw | patch | inline | side by side (parent: 8523b4f)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 21 May 2008 13:41:51 +0000 (13:41 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 21 May 2008 13:41:51 +0000 (13:41 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10984 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/class_acl.inc | patch | blob | history | |
gosa-core/include/class_userinfo.inc | patch | blob | history |
index b173f68e99baa89a78fae376554b31789a1edc4e..faeac26983282bd7c980f961ce8ed8cc7e0deed6 100644 (file)
var $target= "group";
var $aclTypes= array();
var $aclObjects= array();
+ var $aclFilter= "";
var $aclMyObjects= array();
var $users= array();
var $roles= array();
{
/* Call parent execute */
plugin::execute();
-
+
$tmp= session::get('plist');
$plist= $tmp->info;
$this->gosaAclEntry[$this->currentIndex]['type']= $this->aclType;
$this->gosaAclEntry[$this->currentIndex]['members']= $this->recipients;
$this->gosaAclEntry[$this->currentIndex]['acl']= $this->aclContents;
+ $this->gosaAclEntry[$this->currentIndex]['filter']= $this->aclFilter;
$this->dialogState= 'head';
$this->dialog= FALSE;
}
}
/* Save common values */
- foreach (array("aclType", "aclObject", "target") as $key){
+ foreach (array("aclType","aclFilter", "aclObject", "target") as $key){
if (isset($_POST[$key])){
$this->$key= validate($_POST[$key]);
}
$smarty->assign("aclList", $aclList->DrawList());
$smarty->assign("aclType", $this->aclType);
+ $smarty->assign("aclFilter", $this->aclFilter);
$smarty->assign("aclTypes", $this->aclTypes);
$smarty->assign("target", $this->target);
$smarty->assign("targets", $this->targets);
static function explodeACL($acl)
{
- list($index, $type)= split(':', $acl);
+
+ $list= split(':', $acl);
+ if(count($list) == 5){
+ list($index, $type,$member,$permission,$filter)= $list;
+ $filter = base64_decode($filter);
+ }else{
+ $filter = "";
+ list($index, $type,$member,$permission)= $list;
+ }
+
$a= array( $index => array("type" => $type,
+ "filter"=> $filter,
"members" => acl::extractMembers($acl,$type == "role")));
/* Handle different types */
static function extractACL($acl)
{
/* Rip acl off the string, seperate by ',' and place it in an array */
- $as= preg_replace('/^[^:]+:[^:]+:[^:]*:(.*)$/', '\1', $acl);
+ $as= preg_replace('/^[^:]+:[^:]+:[^:]*:([^:]*).*$/', '\1', $acl);
$aa= split(',', $as);
$a= array();
/* New entry gets presets... */
if ($new){
$this->aclType= 'base';
+ $this->aclFilter= "";
$this->recipients= array();
$this->aclContents= array();
} else {
$this->aclType= $acl['type'];
$this->recipients= $acl['members'];
$this->aclContents= $acl['acl'];
+ $this->aclFilter= $acl['filter'];
}
$this->wasNewEntry= $new;
{
/* Assemble ACL's */
$tmp_acl= array();
+
foreach ($this->gosaAclEntry as $prio => $entry){
$final= "";
$members= "";
$final.= preg_replace('/,$/', '', $acl);
}
+ /* Append additional filter options
+ */
+ if(!empty($entry['filter'])){
+ $final .= ":".base64_encode($entry['filter']);
+ }
+
$tmp_acl[]= $final;
}
index c1263330cef07987f05014760159e37de477dae1..0719927c152b6612030f4ea7fa4a3d14839fad84 100644 (file)
/* Push cache answer? */
$ACL_CACHE = &session::get('ACL_CACHE');
- if (isset($ACL_CACHE["$dn+$object+$attribute"])){
+ if (0 && isset($ACL_CACHE["$dn+$object+$attribute"])){
/* Remove write if needed */
if ($skip_write){
return($ret);
}
+ /* Get ldap object, for later filter checks
+ */
+ $ldap = $this->config->get_ldap_link();
+
$acl= array("r" => "", "w" => "", "c" => "", "d" => "", "m" => "", "a" => "");
/* Build dn array */
continue;
}
- /* Per attribute ACL? */
+# /* With user filter */
+# $sdn = preg_replace("/^[^,]*+,/","",$dn);
+# if (isset($subacl['filter']) && !empty($subacl['filter'])){
+#
+# $ldap->cd($sdn);
+# $ldap->ls($subacl['filter'],$sdn);
+# if(!$ldap->count()){
+# continue;
+# }else{
+# $found = FALSE;
+# while($attrs = $ldap->fetch()){
+# echo $attrs['dn']."<br>";
+# if($attrs['dn'] == $dn){
+# $found = TRUE;
+# echo $acl."<br>";;
+# break;
+# }
+# }
+# if(!$found){
+# continue;
+# }
+# }
+# }
+
+ /* Per attribute ACL? */
if (isset($subacl['acl'][$object][$attribute])){
$acl= $this->mergeACL($acl, $subacl['type'], $subacl['acl'][$object][$attribute]);
continue;