refactoring
This commit is contained in:
parent
e6dd937f32
commit
129338dfa6
|
@ -727,14 +727,34 @@ function searchLDAPByFilter($filter, $attributes, $scopes, $attrsOnly = false) {
|
|||
* @return array list of found entries
|
||||
*/
|
||||
function searchLDAP($suffix, $filter, $attributes) {
|
||||
$return = searchLDAPPaged($_SESSION['ldap']->server(), escapeDN($suffix), $filter, $attributes,
|
||||
0, $_SESSION['config']->get_searchLimit());
|
||||
if (ldap_errno($_SESSION['ldap']->server()) == 4) {
|
||||
$limit = 0;
|
||||
if (!empty($_SESSION['config'])) {
|
||||
$limit = $_SESSION['config']->get_searchLimit();
|
||||
}
|
||||
$return = searchLDAPPaged(getLDAPServerHandle(), escapeDN($suffix), $filter, $attributes,
|
||||
0, $limit);
|
||||
if (ldap_errno(getLDAPServerHandle()) == 4) {
|
||||
logNewMessage(LOG_WARNING, 'LDAP size limit exeeded. Please increase the limit on your server.');
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the LDAP server handle.
|
||||
*
|
||||
* @return handle LDAP handle
|
||||
*/
|
||||
function getLDAPServerHandle() {
|
||||
if (!empty($_SESSION['ldap'])) {
|
||||
// admin pages
|
||||
return $_SESSION['ldap']->server();
|
||||
}
|
||||
else {
|
||||
// self service
|
||||
return $_SESSION['ldapHandle'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs an LDAP search and uses paging if configured.
|
||||
*
|
||||
|
|
|
@ -798,11 +798,13 @@ class htmlTableExtendedInputField extends htmlInputField {
|
|||
* @param String $fieldName unique field name
|
||||
* @param String $fieldValue value of input field (optional)
|
||||
* @param String $helpID help ID (optional)
|
||||
* @param boolean $required input required
|
||||
*/
|
||||
function __construct($label, $fieldName, $fieldValue = null, $helpID = null) {
|
||||
function __construct($label, $fieldName, $fieldValue = null, $helpID = null, $required = false) {
|
||||
parent::__construct($fieldName, $fieldValue);
|
||||
$this->label = htmlspecialchars($label);
|
||||
$this->helpID = $helpID;
|
||||
$this->required = $required;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue