PHP KADM5 Functions

EditRocket provides the following information on KADM5 functions in the PHP source code builder.

bool kadm5_chpass_principal ( resource $handle , string $principal , string $password ) - kadm5_chpass_principal() sets the new password password for the principal.

bool kadm5_create_principal ( resource $handle , string $principal [, string $password [, array $options ]] ) - kadm5_create_principal() creates a principal with the given password. If password is omitted or is NULL, a random key will be generated.

bool kadm5_delete_principal ( resource $handle , string $principal ) - kadm5_delete_principal() remove the principal from the Kerberos database.

bool kadm5_destroy ( resource $handle ) -

bool kadm5_flush ( resource $handle ) -

array kadm5_get_policies ( resource $handle ) - kadm5_get_policies() returns an array containing the policies's names.

array kadm5_get_principal ( resource $handle , string $principal ) - kadm5_get_principal() returns an associative array containing the following keys: KADM5_PRINCIPAL, KADM5_PRINC_EXPIRE_TIME, KADM5_PW_EXPIRATION, KADM5_ATTRIBUTES, KADM5_MAX_LIFE, KADM5_MOD_NAME, KADM5_MOD_TIME, KADM5_KVNO, KADM5_POLICY, KADM5_MAX_RLIFE, KADM5_LAST_SUCCESS, KADM5_LAST_FAILED, KADM5_FAIL_AUTH_COUNT.

array kadm5_get_principals ( resource $handle ) - kadm5_get_principals() returns an array containing the principals's names.

resource kadm5_init_with_password ( string $admin_server , string $realm , string $principal , string $password ) - kadm5_init_with_password() opens a connection with the KADM5 library using the principal and the given password to obtain initial credentials from the admin_server. The parameter realm defines the authentication domain for the connection.

bool kadm5_modify_principal ( resource $handle , string $principal , array $options ) - kadm5_modify_principal() modifies a principal according to the given options. Allowed are the following options: KADM5_PRINC_EXPIRE_TIME, KADM5_PW_EXPIRATION, KADM5_ATTRIBUTES, KADM5_MAX_LIFE, KADM5_KVNO, KADM5_POLICY, KADM5_CLEARPOLICY, KADM5_MAX_RLIFE, KADM5_FAIL_AUTH_COUNT.