![]() 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_set_attrdefs plexcel_get_attrdefs plexcel_set_conv_attrdefs |
Synopsissession_start();
require_once('plexcel.php');
array plexcel_preamble(array $options=NULL)
DescriptionThe plexcel_preamble function abstracts all of the normal authentication related work (the “preamble”) into a single easy-to-use function. It allows for a specific domain controller to be selected and abstracts error handling, parameter handling and client logoff. It is recommended that scripts requiring general purpose authentication use this function or create their own customized version of it. Note: Because this function may call plexcel_sso and because plexcel_sso needs to be called twice for each authentication, this function should be invoked before any code that is not absolutely necessary. Note: It is strongly recommended that https:// be used when submitting client credentials to the server in plain text. The optional $options parameter specifies the following possible options.
This function requires that specific HTTP request parameters are used. The following table describes these parameters in detail.
ReturnsThe plexcel_preamble function returns an array containing several elements. These elements, which may be accessed by index and by name, are described further in the following table.
Tip: Use PHP's list construct to dereference this array directly into variables for use within scripts. $preamble = plexcel_preamble(); list($authority, $bindstr, $px, $err, $action, $is_authenticated) = $preamble;Using PHP's list construct to dereference the $preamble array into variables ExampleThe following is a highly simplified version of the plexcel/examples/preamble.php script. Notice that this example is significantly simpler than the plexcel_authenticate example and yet it provides the same features. <?php
session_start();
require_once('plexcel.php');
$preamble = plexcel_preamble();
list($authority, $bindstr, $px, $err, $action, $is_authenticated) = $preamble;
echo "<form name='f' method='POST'>";
echo "<input type='hidden' name='p_action' value='$action'/>";
echo "<input type='hidden' name='p_authority' value='$authority'/>";
$username = plexcel_get_param('p_username');
if ($err)
echo $err;
if ($is_authenticated == FALSE) {
echo "<p/>Username: <input type='text' name='p_username' value='" .
htmlspecialchars($username) . "'/> must be UPN<br/>";
echo "Password: <input type='password' name='p_password'/>";
} else {
echo "<input type='hidden' name='p_username' value='" .
htmlspecialchars($username) . "'/>";
echo "<a href=\"javascript:document.f.p_action.value='logoff';document.f.submit();\">Logoff</a>";
echo '<p/>You are successfully logged on.';
}
echo "<p/><input type='submit'/>";
echo "</form>";
?>
A complete plexcel_preamble example with logon form
See alsoplexcel_authenticate | plexcel_sso | plexcel_logon | plexcel_logoff |
||||||||||||||||||||||||||||||||||||||||||||||
|
© 2008 IOPLEX Software |
Contact Us |
Policies
|