IOPLEX
Communications Software
Plexcel for PHP - Active Directory PHP Integration
plexcel_new
plexcel_status
plexcel_find_authorities_by_domain
plexcel_get_authority
plexcel_get_domain
plexcel_log
plexcel_preamble
plexcel_authenticate
plexcel_sso
plexcel_logon
plexcel_logoff
plexcel_accept_token
plexcel_is_member_of
plexcel_set_password
plexcel_change_password
plexcel_gen_service_keytab
plexcel_search_objects
plexcel_get_account
plexcel_add_object
plexcel_modify_object
plexcel_delete_object
plexcel_rename_object
plexcel_set_attrdefs
plexcel_get_attrdefs
plexcel_set_conv_attrdefs

plexcel_get_authority

Printer Friendly Format

Synopsis

string plexcel_get_authority(resource $px, bool $user = FALSE)

Description

The plexcel_get_authority function returns the hostname of the server with which the supplied $px resource is bound. If the $user parameter is FALSE , the hostname of the directory binding is returned. If the $user value is TRUE , the hostname of the server that is an authority for the user is returned.

For example, if plexcel_new(NULL, NULL) is used, plexcel_get_authority will return the hostname of the specific domain controller chosen by Plexcel. HTTP scripts can, and should, use this function to retrieve the directory binding and either store it in the user's session or passed to the client so that it may be used with plexcel_new in subsequent request to ensure that the same server is used. This behavior is sometimes referred to as "server stickyness". Otherwise, setting data on one server may not be visible in a subsequent request because a different authority was chosen and the data has not replicated between them.

Returns

The plexcel_get_authority function a hostname string or FALSE to indicate that an error has occurred in which case plexcel_status should be consulted.

Example

The following PHP script prints the hostname of the $px resource's domain controller.

<?php

$px = plexcel_new(NULL, NULL);
if (!$px)
    die('<pre>' . plexcel_status(NULL) . '</pre>');

$authority = plexcel_get_authority($px, FALSE); 
if ($authority === FALSE)
    die('<pre>' . plexcel_status($px) . '</pre>');

echo $authority;
Retrieving the plexcel resource's domain controller hostname with plexcel_get_authority.
© 2008 IOPLEX Software | Contact Us | Policies