do not use cache

This commit is contained in:
Roland Gruber 2010-08-05 20:42:39 +00:00
parent 03d4b9975c
commit 2bd24982a3
2 changed files with 7 additions and 11 deletions

View File

@ -227,14 +227,9 @@ class inetLocalMailRecipient extends baseModule {
// check if address has correct format // check if address has correct format
if (get_preg($_POST['localAdr'], 'mailLocalAddress')) { if (get_preg($_POST['localAdr'], 'mailLocalAddress')) {
// check if new address is not already in database // check if new address is not already in database
$data = $_SESSION['cache']->get_cache('mailLocalAddress', 'inetLocalMailRecipient', 'user'); $data = searchLDAPByAttribute('mailLocalAddress', $_POST['localAdr'], 'inetLocalMailRecipient', array('dn'), array('user'));
$keys = array_keys($data); if (sizeof($data) > 0) {
for ($i = 0; $i < sizeof($keys); $i++) { $errors[] = array('WARN', _('This mail address is already in use:') . " " . $_POST['localAdr'], $data[0]['dn']);
$adrList = $data[$keys[$i]];
if (in_array_ignore_case($_POST['localAdr'], $adrList)) {
$errors[] = array('WARN', _('This mail address is already in use:') . " " . $_POST['localAdr'], $keys[$i]);
break;
}
} }
$this->attributes['mailLocalAddress'][] = $_POST['localAdr']; $this->attributes['mailLocalAddress'][] = $_POST['localAdr'];
} }

View File

@ -940,9 +940,10 @@ class inetOrgPerson extends baseModule implements passwordService {
} }
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideManager')) { if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideManager')) {
// get list of existing users for manager attribute // get list of existing users for manager attribute
$dnUsers = $_SESSION['cache']->get_cache('uid', 'inetOrgPerson', 'user'); $dnUsers = searchLDAPByAttribute(null, null, 'inetOrgPerson', array('dn'), array('user'));
if (!is_array($dnUsers)) $dnUsers = array(); for ($i = 0; $i < sizeof($dnUsers); $i++) {
$dnUsers = array_keys($dnUsers); $dnUsers[$i] = $dnUsers[$i]['dn'];
}
usort($dnUsers, array($_SESSION['ldap'], 'cmp_array')); usort($dnUsers, array($_SESSION['ldap'], 'cmp_array'));
array_unshift($dnUsers, '-'); array_unshift($dnUsers, '-');
$options = array(); $options = array();