You are here

public static function SimpleLdap::ldap_control_paged_result in Simple LDAP 7.2

Same name and namespace in other branches
  1. 7 SimpleLdap.class.php \SimpleLdap::ldap_control_paged_result()

Wrapper function for ldap_control_paged_result().

@throw SimpleLdapException

@todo Default values for $pagesize, $iscritical, $cookie.

Parameters

resource $link: An LDAP link identifier.

int $pagesize: The number of entries by page.

boolean $iscritical: Indicates whether the pagination is critical of not. If true and if the server doesn't support pagination, the search will return no result.

string $cookie: An opaque structure sent by the server.

Return value

boolean TRUE on success.

1 call to SimpleLdap::ldap_control_paged_result()
SimpleLdapServer::search in ./SimpleLdapServer.class.php
Search the LDAP server.

File

./SimpleLdap.class.php, line 513
Class defining base Simple LDAP functionallity.

Class

SimpleLdap
Simple LDAP class.

Code

public static function ldap_control_paged_result($link, $pagesize, $iscritical, $cookie) {

  // Devel debugging.
  if (variable_get('simple_ldap_devel', FALSE)) {
    dpm(__FUNCTION__);
    dpm(array(
      '$pagesize' => $pagesize,
      '$iscritical' => $iscritical,
      '$cookie' => $cookie,
    ));
  }

  // Wrapped function call.
  $return = @ldap_control_paged_result($link, $pagesize, $iscritical, $cookie);

  // Debugging.
  if (variable_get('simple_ldap_debug', FALSE)) {
    $message = __FUNCTION__ . '($link = @link, $pagesize = @pagesize, $iscritical = @iscritical, $cookie = @cookie) returns @return';
    $variables = array(
      '@link' => print_r($link, TRUE),
      '@pagesize' => print_r($pagesize, TRUE),
      '@iscritical' => print_r($iscritical, TRUE),
      '@cookie' => print_r($cookie, TRUE),
      '@return' => print_r($return, TRUE),
    );
    watchdog('simple_ldap', $message, $variables, WATCHDOG_DEBUG);
  }

  // Error handling.
  if ($return === FALSE) {
    throw new SimpleLdapException($link);
  }
  return $return;
}