fixed two bugs in new classes

This commit is contained in:
katagia 2003-12-12 10:15:36 +00:00
parent 610930d018
commit b2e93fe95f
2 changed files with 8 additions and 4 deletions

View File

@ -76,7 +76,7 @@ class cache {
if (strpos($_SESSION['ldap']->objectClasses[$i], "NAME '$objectClass'")) $line = $i;
}
// 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
$this->refresh_cache();
if ($singlescope == '*') $scopes = $allowed_types;
@ -84,7 +84,7 @@ class cache {
foreach ($scopes as $scope) {
$DNs = array_keys($this->ldapcache[$scope]);
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
if (count($this->ldapcache[$scope][$dn][$attribute])==1) $return[$dn] = $this->ldapcache[$scope][$dn][$attribute][0];
else {
@ -153,8 +153,8 @@ class cache {
$scopes = array_keys($this->attributes);
foreach ($scopes as $scope) {
// Get Scope
$function = 'get_'.ucfirst($scope).'Suffix()';
If ($scope != '*') $suffix = $this->config->get_UserSuffix(); // fixme *** how to call function? $function;
$function = '$suffix = $this->config->get_'.ucfirst($scope).'Suffix();';
If ($scope != '*') eval($function);
else $suffix = '';
// Get Data from ldap
$search = $this->attributes[$scope];

View File

@ -758,6 +758,10 @@ if (is_array($errors))
// print_r($account_new);
//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) {
/* Select which part of page should be loaded and check values