PHP Manual
This manual is provided as a courtesy. It is not an official source. Please check php.net for updated information.
These 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.
The 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.
The 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
The 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
This 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 burbach@GONICUS.LOCAL</h1>\n"; $options = kadm5_get_principal($handle, "burbach@GONICUS.LOCAL" ); $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, "burbach@GONICUS.LOCAL", $options); kadm5_destroy($handle);?>
If you have comments, bugfixes, enhancements or want to help in developing this you can send me a mail at holger.burbach@gonicus.de. The project homepage can be found at http://oss.gonicus.de/project/?group_id=7.