summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1c7e3d5)
raw | patch | inline | side by side (parent: 1c7e3d5)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 30 Apr 2008 08:34:37 +0000 (08:34 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 30 Apr 2008 08:34:37 +0000 (08:34 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10737 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/heimdal/admin/systems/services/kerberos/class_password-methods-MIT.inc | patch | blob | history |
diff --git a/gosa-plugins/heimdal/admin/systems/services/kerberos/class_password-methods-MIT.inc b/gosa-plugins/heimdal/admin/systems/services/kerberos/class_password-methods-MIT.inc
index 5a45d6e2fe8df1a35ba9c19b7c0aa2b1c8a12b16..4ea6d299925fe7e9341b5b0ca43fd1b11563fb15 100644 (file)
var $POLICY = "";
+ var $POLICIES = array(); // Policies provided by the corrently selected realm/server
var $PRINC_EXPIRE_TIME = 0;
var $PW_EXPIRATION = 0;
$server= $this->map['PRINCIPAL_SERVER'][$p_name];
$this->goKrbRealm = $this->map['SERVER_REALM'][$server];
$this->principal = $p_name;
+
+ /* Load policies */
+ $server_name = $this->map['REALM_SERVER'][$this->goKrbRealm];
+ $server_mac = $this->server_list[$server_name]['macAddress'];
+ $this->POLICIES = $this->load_policies_for_server($server_mac);
+
+ /* Load principal */
$this->load_principal($this->server_list[$server]['macAddress'],$p_name);
}
}
*/
public function load_principals_for_server($server)
{
- if(!session::is_set("MIT_CACHE")){
- session::set("MIT_CACHE",array());
+ if(!session::is_set("MIT_PRINCIPAL_CACHE")){
+ session::set("MIT_PRINCIPAL_CACHE",array());
}
- $cache = session::get("MIT_CACHE");
+ $cache = session::get("MIT_PRINCIPAL_CACHE");
if(!isset($cache[$server])){
$o = new gosaSupportDaemon();
$tmp = $o->krb5_list_principals($server);
$cache[$server] = $tmp;
- session::set("MIT_CACHE",$cache);
+ session::set("MIT_PRINCIPAL_CACHE",$cache);
+ }
+ return($cache[$server]);
+ }
+
+
+ /*! \brief get list of all configured policies
+ for a given server.
+ The results will cached.
+ */
+ public function load_policies_for_server($server)
+ {
+ if(!session::is_set("MIT_POLICY_CACHE")){
+ session::set("MIT_POLICY_CACHE",array());
+ }
+ $cache = session::get("MIT_POLICY_CACHE");
+ if(!isset($cache[$server])){
+ $o = new gosaSupportDaemon();
+ $tmp = $o->krb5_list_policies($server);
+ $cache[$server] = $tmp;
+ session::set("MIT_POLICY_CACHE",$cache);
}
return($cache[$server]);
}
+
+
/*! \brief Check if this password method is useable.
This is the case if there is a si server running and at least one server configured.
kerberos support.
$smarty->assign("hours",$hours);
$smarty->assign("minutes",$minutes);
+ $smarty->assign("server_list",$this->server_list);
+ $smarty->assign("POLICY" ,$this->POLICY);
+ $smarty->assign("goKrbRealm" , $this->goKrbRealm);
+
+ $server_name = $this->map['REALM_SERVER'][$this->goKrbRealm];
+ $server_mac = $this->server_list[$server_name]['macAddress'];
+ $this->POLICIES = $this->load_policies_for_server($server_mac);
+ $smarty->assign("POLICIES" ,$this->POLICIES);
+
foreach($this->values as $attr){
$smarty->assign($attr ,$this->$attr);
}
{
if(isset($_POST['pwd_heimdal_posted'])){
+ if(isset($_POST['goKrbRealm'])){
+ $this->goKrbRealm = get_post("goKrbRealm");
+ }
+
foreach($this->flags as $attr){
$this->$attr = isset($_POST[$attr]);
}