Code

* bugfix: gosaTriggered.pm: all functions work now
[gosa.git] / gosa-si / client / events / krb5.pm
index 1e79daa562fbcfb1a9a594b4011a0609333a7194..0a262f5cc0cce7bd6a2077370a0680a84d147044 100644 (file)
@@ -92,6 +92,11 @@ sub krb5_list_principals {
       }
     }
 
+    my $forward_to_gosa = @{$msg_hash->{'forward_to_gosa'}}[0];
+    if (defined $forward_to_gosa) {
+        &add_content2xml_hash($out_hash, "forward_to_gosa", $forward_to_gosa);
+    }
+
     # return message
     return &create_xml_string($out_hash);
 }
@@ -140,9 +145,17 @@ sub krb5_create_principal {
 
         $princ->principal($principal);
         $kadm5->create_principal($princ, join '', map { chr rand(255) + 1 } 1..256) or &add_content2xml_hash($out_hash, "error", Authen::Krb5::Admin::error);
+
+       # Directly randomize key
+       $kadm5->randkey_principal($princ);
       }
     }
 
+    my $forward_to_gosa = @{$msg_hash->{'forward_to_gosa'}}[0];
+    if (defined $forward_to_gosa) {
+        &add_content2xml_hash($out_hash, "forward_to_gosa", $forward_to_gosa);
+    }
+
     # return message
     return &create_xml_string($out_hash);
 }
@@ -194,6 +207,11 @@ sub krb5_modify_principal {
       }
     }
 
+    my $forward_to_gosa = @{$msg_hash->{'forward_to_gosa'}}[0];
+    if (defined $forward_to_gosa) {
+        &add_content2xml_hash($out_hash, "forward_to_gosa", $forward_to_gosa);
+    }
+
     # return message
     return &create_xml_string($out_hash);
 }
@@ -245,6 +263,11 @@ sub krb5_get_principal {
       }
     }
 
+    my $forward_to_gosa = @{$msg_hash->{'forward_to_gosa'}}[0];
+    if (defined $forward_to_gosa) {
+        &add_content2xml_hash($out_hash, "forward_to_gosa", $forward_to_gosa);
+    }
+
     # return message
     return &create_xml_string($out_hash);
 }
@@ -281,6 +304,11 @@ sub krb5_del_principal {
       }
     }
 
+    my $forward_to_gosa = @{$msg_hash->{'forward_to_gosa'}}[0];
+    if (defined $forward_to_gosa) {
+        &add_content2xml_hash($out_hash, "forward_to_gosa", $forward_to_gosa);
+    }
+
     # return message
     return &create_xml_string($out_hash);
 }
@@ -308,6 +336,11 @@ sub krb5_list_policies {
       }
     }
 
+    my $forward_to_gosa = @{$msg_hash->{'forward_to_gosa'}}[0];
+    if (defined $forward_to_gosa) {
+        &add_content2xml_hash($out_hash, "forward_to_gosa", $forward_to_gosa);
+    }
+
     # return message
     return &create_xml_string($out_hash);
 }
@@ -347,6 +380,11 @@ sub krb5_get_policy {
       &add_content2xml_hash($out_hash, "policy_refcnt", $data->policy_refcnt);
     }
 
+    my $forward_to_gosa = @{$msg_hash->{'forward_to_gosa'}}[0];
+    if (defined $forward_to_gosa) {
+        &add_content2xml_hash($out_hash, "forward_to_gosa", $forward_to_gosa);
+    }
+
     # return message
     return &create_xml_string($out_hash);
 }
@@ -395,6 +433,11 @@ sub krb5_create_policy {
       $kadm5->create_policy($pol) or &add_content2xml_hash($out_hash, "error", Authen::Krb5::Admin::error);
     }
 
+    my $forward_to_gosa = @{$msg_hash->{'forward_to_gosa'}}[0];
+    if (defined $forward_to_gosa) {
+        &add_content2xml_hash($out_hash, "forward_to_gosa", $forward_to_gosa);
+    }
+
     # build return message with twisted target and source
     my $out_msg = &create_xml_string($out_hash);
 
@@ -441,6 +484,11 @@ sub krb5_modify_policy {
       $kadm5->modify_policy($pol) or &add_content2xml_hash($out_hash, "error", Authen::Krb5::Admin::error);
     }
 
+    my $forward_to_gosa = @{$msg_hash->{'forward_to_gosa'}}[0];
+    if (defined $forward_to_gosa) {
+        &add_content2xml_hash($out_hash, "forward_to_gosa", $forward_to_gosa);
+    }
+
     # build return message with twisted target and source
     my $out_msg = &create_xml_string($out_hash);
 
@@ -475,6 +523,11 @@ sub krb5_del_policy {
       $kadm5->delete_policy($policy) or &add_content2xml_hash($out_hash, "error", Authen::Krb5::Admin::error);
     }
 
+    my $forward_to_gosa = @{$msg_hash->{'forward_to_gosa'}}[0];
+    if (defined $forward_to_gosa) {
+        &add_content2xml_hash($out_hash, "forward_to_gosa", $forward_to_gosa);
+    }
+
     # return message
     return &create_xml_string($out_hash);
 }
@@ -514,6 +567,11 @@ sub krb5_set_password {
       $kadm5->chpass_principal($principal, @{$msg_hash->{'password'}}[0]) or &add_content2xml_hash($out_hash, "error", Authen::Krb5::Admin::error);
     }
 
+    my $forward_to_gosa = @{$msg_hash->{'forward_to_gosa'}}[0];
+    if (defined $forward_to_gosa) {
+        &add_content2xml_hash($out_hash, "forward_to_gosa", $forward_to_gosa);
+    }
+
     # return message
     return &create_xml_string($out_hash);
 }