|
Home
iRate! IceMelon IM Tutorials Headlines CoolSites PHP Functions |
|
Most Referenced Functions » google_pagerank() » preg_replace() » imagecreatefrompng() » site_pageranks() » imagepng() » imagedestroy() » imagestring() » imagecolorallocate() » htmlentities() » preg_match() » fopen() » header() » getimagesize() » preg_match_all() » session_start() » htmlspecialchars() » ob_start() » ob_flush() » strstr() » flush() » strpos() » setcookie() » str_replace() » array2vars() » nl2br() » preg_split() » ereg() » ereg_replace() » urlencode() » readgzfile() Become a sponsor for $15/month. Link is sitewide - PR5 homepage, 20+ PR4 pages, 90+ PR3 pages. Email dave[AT]icemelon[D0T]c0m. |
PHP Functions
Function: java_last_exception_get (PHP 4 >= 4.0.2, PECL) java_last_exception_get -- Get last Java exceptionDescriptionobject java_last_exception_get ( void )Warning This function is EXPERIMENTAL . The behaviour of this function, the name of this function, and anything else documented about this function may change without notice in a future release of PHP. Use this function at your own risk. The following example demonstrates the usage of Java's exception handler from within PHP: Example 1. Java exception handler
<?php
$stack = new Java('java.util.Stack');
$stack->push(1);
// This should succeed
$result = $stack->pop();
$ex = java_last_exception_get();
if (!$ex) {
echo "$result\n";
}
// This should fail (error suppressed by @)
$result = @$stack->pop();
$ex = java_last_exception_get();
if ($ex) {
echo $ex->toString();
}
// Clear last exception
java_last_exception_clear();
?>
LX. KADM5
IntroductionThese package allows you to access Kerberos V administration servers. You can create, modify, and delete Kerberos V principals and policies. More information about Kerberos can be found at http://web.mit.edu/kerberos/www/ . Documentation for Kerberos and KADM5 can be found at http://web.mit.edu/kerberos/www/krb5-1.2/krb5-1.2.8/doc/admin_toc.html . Predefined ConstantsThe constants below are defined by this extension, and will only be available when the extension has either been compiled into PHP or dynamically loaded at runtime. Constants for Attribute FlagsThe functions kadm5_create_principal() , kadm5_modify_principal() , and kadm5_modify_principal() allow to specify special attributes using a bitfield. The symbols are defined below: Table 1. Attributes for use by the KDC constant KRB5_KDB_DISALLOW_POSTDATED KRB5_KDB_DISALLOW_FORWARDABLE KRB5_KDB_DISALLOW_TGT_BASED KRB5_KDB_DISALLOW_RENEWABLE KRB5_KDB_DISALLOW_PROXIABLE KRB5_KDB_DISALLOW_DUP_SKEY KRB5_KDB_DISALLOW_ALL_TIX KRB5_KDB_REQUIRES_PRE_AUTH KRB5_KDB_REQUIRES_HW_AUTH KRB5_KDB_REQUIRES_PWCHANGE KRB5_KDB_DISALLOW_SVR KRB5_KDB_PWCHANGE_SERVER KRB5_KDB_SUPPORT_DESMD5 KRB5_KDB_NEW_PRINC Constants for OptionsThe functions kadm5_create_principal() , kadm5_modify_principal() , and kadm5_get_principal() allow to specify or return principal's options as an associative array. The keys for the associative array are defined as string constants below: Table 2. Options for creating/modifying/retrieving principals constant funcdef description KADM5_PRINCIPAL long The expire time of the princial as a Kerberos timestamp. KADM5_PRINC_EXPIRE_TIME long The expire time of the princial as a Kerberos timestamp. KADM5_LAST_PW_CHANGE long The time this principal's password was last changed. KADM5_PW_EXPIRATION long The expire time of the principal's current password, as a Kerberos timestamp. KADM5_MAX_LIFE long The maximum lifetime of any Kerberos ticket issued to this principal. KADM5_MAX_RLIFE long The maximum renewable lifetime of any Kerberos ticket issued to or for this principal. KADM5_MOD_NAME string The name of the Kerberos principal that most recently modified this principal. KADM5_MOD_TIME long The time this principal was last modified, as a Kerberos timestamp. KADM5_KVNO long The version of the principal's current key. KADM5_POLICY string The name of the policy controlling this principal. KADM5_CLEARPOLICY long Standard procedure is to assign the 'default' policy to new principals. KADM5_CLEARPOLICY suppresses this behaviour. KADM5_LAST_SUCCESS long The KDC time of the last successfull AS_REQ. KADM5_LAST_FAILED long The KDC time of the last failed AS_REQ. KADM5_FAIL_AUTH_COUNT long The number of consecutive failed AS_REQs. KADM5_RANDKEY long Generates a random password for the principal. The parameter password will be ignored. KADM5_ATTRIBUTES long A bitfield of attributes for use by the KDC.ExamplesThis simple example shows how to connect, query, print resulting principals and disconnect from a KADM5 database. Example 1. KADM5 extension overview example
<?php
$handle = kadm5_init_with_password("afs-1", "GONICUS.LOCAL", "admin/admin", "password");
print "<h1>get_principals</h1>\n";
$principals = kadm5_get_principals($handle);
for( $i=0; $i<count($principals); $i++)
print "$principals[$i]<br>\n";
print "<h1>get_policies</h1>\n";
$policies = kadm5_get_policies($handle);
for( $i=0; $i<count($policies); $i++)
print "$policies[$i]<br>\n";
print "<h1>get_principal [email protected]</h1>\n";
$options = kadm5_get_principal($handle, "[email protected]" );
$keys = array_keys($options);
for( $i=0; $i<count($keys); $i++) {
$value = $options[$keys[$i]];
print "$keys[$i]: $value<br>\n";
}
$options = array(KADM5_PRINC_EXPIRE_TIME => 0);
kadm5_modify_principal($handle, "[email protected]", $options);
kadm5_destroy($handle);
?>
Contact InformationIf you have comments, bugfixes, enhancements or want to help in developing this you can send me a mail at [email protected] . The project homepage can be found at http://oss.gonicus.de/project/?group_id=7 . Table of Contents kadm5_chpass_principal -- Changes the principal's password. kadm5_create_principal -- Creates a kerberos principal with the given parameters. kadm5_delete_principal -- Deletes a kerberos principal. kadm5_destroy -- Closes the connection to the admin server and releases all related resources. kadm5_flush -- Flush all changes to the Kerberos database, leaving the connection to the Kerberos admin server open. kadm5_get_policies -- Gets all policies from the Kerberos database. kadm5_get_principal -- Gets the principal's entries from the Kerberos database. kadm5_get_principals -- Gets all principals from the Kerberos database. kadm5_init_with_password -- Opens a conncetion to the KADM5 library and initializes any neccessary state information. kadm5_modify_principal -- Modifies a kerberos principal with the given parameters.Related Function(s) |