fixed two bugs in new classes
This commit is contained in:
parent
610930d018
commit
b2e93fe95f
|
@ -76,7 +76,7 @@ class cache {
|
||||||
if (strpos($_SESSION['ldap']->objectClasses[$i], "NAME '$objectClass'")) $line = $i;
|
if (strpos($_SESSION['ldap']->objectClasses[$i], "NAME '$objectClass'")) $line = $i;
|
||||||
}
|
}
|
||||||
// Return error if objectClass isn't found
|
// Return error if objectClass isn't found
|
||||||
if ($line==-1) trigger_error (_("objectClass objectClass required but not defined in ldap."), E_USER_WARNING);
|
if ($line==-1) trigger_error (_("objectClass $objectClass required but not defined in ldap."), E_USER_WARNING);
|
||||||
// Everything seems to be OK, start processing data
|
// Everything seems to be OK, start processing data
|
||||||
$this->refresh_cache();
|
$this->refresh_cache();
|
||||||
if ($singlescope == '*') $scopes = $allowed_types;
|
if ($singlescope == '*') $scopes = $allowed_types;
|
||||||
|
@ -84,7 +84,7 @@ class cache {
|
||||||
foreach ($scopes as $scope) {
|
foreach ($scopes as $scope) {
|
||||||
$DNs = array_keys($this->ldapcache[$scope]);
|
$DNs = array_keys($this->ldapcache[$scope]);
|
||||||
foreach ($DNs as $dn) {
|
foreach ($DNs as $dn) {
|
||||||
if (isset($this->ldapcache[$scope][$dn][$attribute])) {
|
if (isset($this->ldapcache[$scope][$dn][$attribute]) && in_array($objectClass, $this->ldapcache[$scope][$dn]['objectClass'])) {
|
||||||
// return string if only attribute exists only once
|
// return string if only attribute exists only once
|
||||||
if (count($this->ldapcache[$scope][$dn][$attribute])==1) $return[$dn] = $this->ldapcache[$scope][$dn][$attribute][0];
|
if (count($this->ldapcache[$scope][$dn][$attribute])==1) $return[$dn] = $this->ldapcache[$scope][$dn][$attribute][0];
|
||||||
else {
|
else {
|
||||||
|
@ -153,8 +153,8 @@ class cache {
|
||||||
$scopes = array_keys($this->attributes);
|
$scopes = array_keys($this->attributes);
|
||||||
foreach ($scopes as $scope) {
|
foreach ($scopes as $scope) {
|
||||||
// Get Scope
|
// Get Scope
|
||||||
$function = 'get_'.ucfirst($scope).'Suffix()';
|
$function = '$suffix = $this->config->get_'.ucfirst($scope).'Suffix();';
|
||||||
If ($scope != '*') $suffix = $this->config->get_UserSuffix(); // fixme *** how to call function? $function;
|
If ($scope != '*') eval($function);
|
||||||
else $suffix = '';
|
else $suffix = '';
|
||||||
// Get Data from ldap
|
// Get Data from ldap
|
||||||
$search = $this->attributes[$scope];
|
$search = $this->attributes[$scope];
|
||||||
|
|
|
@ -758,6 +758,10 @@ if (is_array($errors))
|
||||||
|
|
||||||
// print_r($account_new);
|
// print_r($account_new);
|
||||||
//print_r($account_old);
|
//print_r($account_old);
|
||||||
|
//$temp = new cache();
|
||||||
|
//$temp->add_cache(array( 'user' => array('uid', 'cn' ) ));
|
||||||
|
//print_r($temp->get_cache('uid', 'posixAccount', 'user'));
|
||||||
|
//print_r($temp->ldapcache);
|
||||||
|
|
||||||
switch ($select_local) {
|
switch ($select_local) {
|
||||||
/* Select which part of page should be loaded and check values
|
/* Select which part of page should be loaded and check values
|
||||||
|
|
Loading…
Reference in New Issue