config=$config; } function is_available() { if (function_exists('kadm5_init_with_password')){ return(true); }else{ return false; } } function generate_hash($pwd) { $cfg= $this->config->data['SERVERS']['KERBEROS']; if (!function_exists('kadm5_init_with_password')) { print_red (_("Warning: Can't set kerberos password. Your PHP version has no kerberos support, password has not been changed.")); } else { $handle = kadm5_init_with_password($cfg['SERVER'], $cfg['REALM'], $cfg['ADMIN'], $cfg['PASSWORD']); if ($handle === FALSE) { print_red (_("Kerberos database communication failed!")); } $ret= kadm5_chpass_principal($handle, $this->attrs['uid'][0]."@".$cfg['REALM'],$pwd); if ($ret === FALSE) { print_red (_("Changing password in kerberos database failed!")); } kadm5_destroy($handle); $newpass= "{".$this->config->current['KRBSASL']."}".$this->attrs['uid'][0]."@".$cfg['REALM']; return $newpass; } } } /* Dummy class for OpenLDAP Kerberos/SASL change */ class passwordMethodsasl extends passwordMethodkerberos { } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?>