summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e8348ad)
raw | patch | inline | side by side (parent: e8348ad)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 18 Sep 2007 10:04:48 +0000 (10:04 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 18 Sep 2007 10:04:48 +0000 (10:04 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7315 594d385d-05f5-0310-b6e9-bd551577e9d8
include/class_userinfo.inc | patch | blob | history | |
include/functions.inc | patch | blob | history |
index ac33f535d5d9ddf03e899ec9862ad6b2ae6b6fd7..c3712521ccb9a3d7b9dde672140672a644baa2b0 100644 (file)
function cleanACL($acl, $reset= FALSE)
{
- foreach ($acl as $key => $value){
+ foreach ($acl as &$value){
/* Reset removes everything but 'p' */
if ($reset && $value != 'p'){
- $acl[$key]= "";
+ $value= "";
continue;
}
/* Decrease tree level */
- if (preg_match('/^[0-9]+$/', $value)){
- if ($value > 0){
- $acl[$key]= $value - 1;
+ if (is_int($value)){
+ if ($value){
+ $value--;
} else {
- $acl[$key]= "";
+ $value= "";
}
}
}
diff --git a/include/functions.inc b/include/functions.inc
index 7bf69aaf36da8f402d9057f2403523cd5119b245..2280628a1ee1846286037ea8d8ea1f689cc3679d 100644 (file)
--- a/include/functions.inc
+++ b/include/functions.inc
function search_config(&$arr, $name, $return)
{
+ $lname= strtolower($name);
if (is_array($arr)){
foreach ($arr as $a){
- if (isset($a['CLASS']) &&
- strtolower($a['CLASS']) == strtolower($name)){
+ if (isset($a['CLASS']) && strtolower($a['CLASS']) == $lname){
if (isset($a[$return])){
return ($a[$return]);