0ef19fbdd3a01ee8b8b07f75999f5cddb95e4580
1 package krb5;
2 use Exporter;
3 @ISA = qw(Exporter);
4 my @events = (
5 "get_events",
6 "krb5_list_principals",
7 "krb5_list_policies",
8 "krb5_get_principal",
9 "krb5_set_principal",
10 "krb5_del_principal",
11 "krb5_get_policy",
12 "krb5_set_policy",
13 "krb5_del_policy",
15 );
16 @EXPORT = @events;
18 use strict;
19 use warnings;
20 use GOSA::GosaSupportDaemon;
22 BEGIN {}
24 END {}
25 sub get_events { return \@events; }
28 sub krb5_list_principals {
29 my ($msg, $msg_hash) = @_;
30 my $header = @{$msg_hash->{'header'}}[0];
31 my $source = @{$msg_hash->{'source'}}[0];
32 my $target = @{$msg_hash->{'target'}}[0];
33 my $session_id = @{$msg_hash->{'session_id'}}[0];
35 # do now whatever kerb5_list_pricipals has to do
37 # build return message with twisted target and source
38 my $out_hash = &main::create_xml_hash("answer_krb5_list_principals", $target, $source);
39 &add_content2xml_hash($out_hash, "session_id", $session_id);
40 &add_content2xml_hash($out_hash, "principal", 'rettenberger@GONICUS.DE');
41 &add_content2xml_hash($out_hash, "principal", 'pollmeier@GONICUS.DE');
42 &add_content2xml_hash($out_hash, "principal", 'hickert@GONICUS.DE');
43 my $out_msg = &create_xml_string($out_hash);
45 # return message
46 return $out_msg;
48 }
51 sub krb5_set_principal {
52 my ($msg, $msg_hash) = @_;
53 my $header = @{$msg_hash->{'header'}}[0];
54 my $source = @{$msg_hash->{'source'}}[0];
55 my $target = @{$msg_hash->{'target'}}[0];
56 my $session_id = @{$msg_hash->{'session_id'}}[0];
58 # build return message with twisted target and source
59 my $out_hash = &main::create_xml_hash("answer_krb5_list_principals", $target, $source);
60 my $out_msg = &create_xml_string($out_hash);
62 # return message
63 return $out_msg;
66 }
69 sub krb5_get_principal {
70 my ($msg, $msg_hash) = @_;
71 my $header = @{$msg_hash->{'header'}}[0];
72 my $source = @{$msg_hash->{'source'}}[0];
73 my $target = @{$msg_hash->{'target'}}[0];
74 my $session_id = @{$msg_hash->{'session_id'}}[0];
76 # build return message with twisted target and source
77 my $out_hash = &main::create_xml_hash("answer_krb5_list_principals", $target, $source);
78 my $out_msg = &create_xml_string($out_hash);
80 # return message
81 return $out_msg;
84 }
87 sub krb5_del_principal {
88 my ($msg, $msg_hash) = @_;
89 my $header = @{$msg_hash->{'header'}}[0];
90 my $source = @{$msg_hash->{'source'}}[0];
91 my $target = @{$msg_hash->{'target'}}[0];
92 my $session_id = @{$msg_hash->{'session_id'}}[0];
94 # build return message with twisted target and source
95 my $out_hash = &main::create_xml_hash("answer_krb5_list_principals", $target, $source);
96 my $out_msg = &create_xml_string($out_hash);
98 # return message
99 return $out_msg;
102 }
105 sub krb5_list_policies {
106 my ($msg, $msg_hash) = @_;
107 my $header = @{$msg_hash->{'header'}}[0];
108 my $source = @{$msg_hash->{'source'}}[0];
109 my $target = @{$msg_hash->{'target'}}[0];
110 my $session_id = @{$msg_hash->{'session_id'}}[0];
112 # build return message with twisted target and source
113 my $out_hash = &main::create_xml_hash("answer_krb5_list_principals", $target, $source);
114 my $out_msg = &create_xml_string($out_hash);
116 # return message
117 return $out_msg;
120 }
123 sub krb5_get_policy {
124 my ($msg, $msg_hash) = @_;
125 my $header = @{$msg_hash->{'header'}}[0];
126 my $source = @{$msg_hash->{'source'}}[0];
127 my $target = @{$msg_hash->{'target'}}[0];
128 my $session_id = @{$msg_hash->{'session_id'}}[0];
130 # build return message with twisted target and source
131 my $out_hash = &main::create_xml_hash("answer_krb5_list_principals", $target, $source);
132 my $out_msg = &create_xml_string($out_hash);
134 # return message
135 return $out_msg;
138 }
141 sub krb5_set_policy {
142 my ($msg, $msg_hash) = @_;
143 my $header = @{$msg_hash->{'header'}}[0];
144 my $source = @{$msg_hash->{'source'}}[0];
145 my $target = @{$msg_hash->{'target'}}[0];
146 my $session_id = @{$msg_hash->{'session_id'}}[0];
148 # build return message with twisted target and source
149 my $out_hash = &main::create_xml_hash("answer_krb5_list_principals", $target, $source);
150 my $out_msg = &create_xml_string($out_hash);
152 # return message
153 return $out_msg;
156 }
159 sub krb5_del_policy {
160 my ($msg, $msg_hash) = @_;
161 my $header = @{$msg_hash->{'header'}}[0];
162 my $source = @{$msg_hash->{'source'}}[0];
163 my $target = @{$msg_hash->{'target'}}[0];
164 my $session_id = @{$msg_hash->{'session_id'}}[0];
166 # build return message with twisted target and source
167 my $out_hash = &main::create_xml_hash("answer_krb5_list_principals", $target, $source);
168 my $out_msg = &create_xml_string($out_hash);
170 # return message
171 return $out_msg;
174 }
176 1;