Handle hostnames with upper-case letters
[webmin.git] / jabber / edit_messages.cgi
1 #!/usr/local/bin/perl
2 # edit_messages.cgi
3 # Display welcome and other messages
4
5 require './jabber-lib.pl';
6 &ui_print_header(undef, $text{'messages_title'}, "", "messages");
7
8 $conf = &get_jabber_config();
9 $session = &find_by_tag("service", "id", "sessions", $conf);
10 $jsm = &find("jsm", $session);
11
12 print "<form action=save_messages.cgi method=post>\n";
13 print "<table border width=100%>\n";
14 print "<tr $tb> <td><b>$text{'messages_header'}</b></td> </tr>\n";
15 print "<tr $cb> <td><table width=100%>\n";
16
17 $welcome = &find("welcome", $jsm);
18 print "<tr> <td><b>$text{'messages_wsubject'}</b></td>\n";
19 printf "<td colspan=3><input name=wsubject size=50 value='%s'></td> </tr>\n",
20         &find_value("subject", $welcome);
21 print "<tr> <td valign=top><b>$text{'messages_wbody'}</b></td>\n";
22 print "<td colspan=3><textarea name=wbody rows=4 cols=50 wrap=auto>",
23         &find_value("body", $welcome),"</textarea></td> </tr>\n";
24
25 print "<tr> <td colspan=4><hr></td> </tr>\n";
26
27 $register = &find("register", $jsm);
28 print "<tr> <td><b>$text{'messages_rinstr'}</b></td>\n";
29 printf "<td colspan=3><input name=rinstr size=50 value='%s'></td> </tr>\n",
30         &find_value("instructions", $register);
31 print "<tr> <td><b>$text{'messages_rnotify'}</b></td>\n";
32 printf "<td><input type=radio name=rnotify value=1 %s> %s\n",
33         $register->[1]->[0]->{'notify'} eq 'yes' ? 'checked' : '', $text{'yes'};
34 printf "<input type=radio name=rnotify value=0 %s> %s</td>\n",
35         $register->[1]->[0]->{'notify'} eq 'yes' ? '' : 'checked', $text{'no'};
36 print "<td><b>$text{'messages_rfields'}</b></td> <td>\n";
37 foreach $f (@register_fields) {
38         local $rf = &find($f, $register);
39         printf "<input type=checkbox name=%s value=1 %s> %s\n",
40                 "rfield_$f", $rf ? "checked" : "", $f;
41         }
42 print "</td></tr>\n";
43
44 print "<tr> <td colspan=4><hr></td> </tr>\n";
45
46 $vcard = &find("vcard", $jsm);
47 @vc = @{$vcard->[1]}; shift(@vc);
48 print "<tr> <td valign=top><b>$text{'messages_vcard'}</b></td>\n";
49 print "<td colspan=3><textarea name=vcard rows=4 cols=50 wrap=auto>",
50         &xml_string($vcard->[0], $vcard->[1]),"</textarea></td> </tr>\n";
51
52 $vcard2jud = &find("vcard2jud", $jsm);
53 print "<tr> <td><b>$text{'messages_vcard2jud'}</b></td>\n";
54 printf "<td><input type=radio name=vcard2jud value=1 %s> %s\n",
55         $vcard2jud ? "checked" : "", $text{'yes'};
56 printf "<input type=radio name=vcard2jud value=0 %s> %s</td> </tr>\n",
57         $vcard2jud ? "" : "checked", $text{'no'};
58
59 print "</table></td></tr></table>\n";
60 print "<input type=submit value='$text{'save'}'></form>\n";
61
62 &ui_print_footer("", $text{'index_return'});
63