[gosa.git] / gosa-plugins / mit-krb5 / admin / systems / services / kerberos / class_password-methods-MIT.inc
diff --git a/gosa-plugins/mit-krb5/admin/systems/services/kerberos/class_password-methods-MIT.inc b/gosa-plugins/mit-krb5/admin/systems/services/kerberos/class_password-methods-MIT.inc
index 322511f1fe521a74defce624a85fd53291f3175f..0a65aea84f7891155dc8b559a919d3d89a5a27e7 100644 (file)
var $POLICY = "_none_";
var $POLICIES = array(); // Policies provided by the corrently selected realm/server
+ public function is_locked($config,$dn = "")
+ {
+ return(FALSE);
+ }
+
+ public function lock_account($config,$dn = "")
+ {
+ return(FALSE);
+ }
+
+ public function unlock_account($config,$dn = "")
+ {
+ return(FALSE);
+ }
+
public function __construct(&$config,$dn = "new")
{
$this->config= $config;
/* No config object given, this may be the case
if there is only a is_available() request triggered.
*/
- if(!is_object($config)){
+ if(!is_object($this->config)){
return;
}
$cache = session::get("MIT_PRINCIPAL_CACHE");
if(!isset($cache[$server])){
$o = new gosaSupportDaemon();
- $tmp = $o->krb5_list_principals($server);
- if($o->is_error()){
- $this->si_error = TRUE;
- $this->si_error_msg = sprintf(_("Cannot load principals from server '%s'!"),$server).": <br>".$o->get_error();
- msg_dialog::display(_("Service infrastructure"),msgPool::siError($o->get_error()),ERROR_DIALOG);
- return(array());
- }else{
- $cache[$server] = $tmp;
+ if($o->is_configured()){
+ $tmp = $o->krb5_list_principals($server);
+ if($o->is_error()){
+ $this->si_error = TRUE;
+ $this->si_error_msg = sprintf(_("Cannot load principals from server '%s'!"),$server).": <br>".$o->get_error();
+ msg_dialog::display(_("Service infrastructure"),msgPool::siError($o->get_error()),ERROR_DIALOG);
+ return(array());
+ }else{
+ $cache[$server] = $tmp;
+ }
}
session::set("MIT_PRINCIPAL_CACHE",$cache);
}
*/
public function is_available()
{
+ global $config;
+
+ /* No config object given, this may be the case
+ if there is only a is_available() request triggered.
+ */
+ if(!is_object($config)){
+ return;
+ }
+
+
$o = new gosaSupportDaemon(FALSE);
- if(count($this->server_list) && $o->connect()){
+
+ if(count($this->server_list) && $o->connect() && $o->is_configured()){
return TRUE;
}
return(FALSE);
public function generate_hash($pwd = "")
{
$mode= "kerberos";
- if ($this->config->get_cfg_value("useSaslForKerberos") == "true"){
+
+ /* No config object given, this may be the case
+ if there is only a is_available() request triggered.
+ */
+ if (is_object($this->config) && $this->config->get_cfg_value("useSaslForKerberos") == "true"){
$mode= "sasl";
}
return "{".$mode."}".$this->attrs['uid'][0]."@".$this->goKrbRealm;
public function get_hash_name()
{
$mode= "kerberos";
- if ($this->config->get_cfg_value("useSaslForKerberos") == "true"){
+
+ /* No config object given, this may be the case
+ if there is only a is_available() request triggered.
+ */
+ if (is_object($this->config) && $this->config->get_cfg_value("useSaslForKerberos") == "true"){
$mode= "sasl";
}
return "$mode";
/* Save principal changes */
$o = new gosaSupportDaemon();
- if(in_array($principal,$this->server_list[$server_name]['principals'])){
+ if(in_array_strict($principal,$this->server_list[$server_name]['principals'])){
$this->is_new = FALSE;
}