3 # Display jabber configuration option categories
5 require './jabber-lib.pl';
7 # Check if config file exists
8 if (!-r $config{'jabber_config'}) {
9 &ui_print_header(undef, $text{'index_title'}, "", "intro", 1, 1, undef,
10 &help_search_link("jabber", "man", "doc", "google"));
11 print &text('index_econfig', "<tt>$config{'jabber_config'}</tt>",
12 "$gconfig{'webprefix'}/config.cgi?$module_name"),"<p>\n";
13 &ui_print_footer("/", $text{"index"});
17 # Check if base directory exists
18 if (!-d $config{'jabber_dir'}) {
19 &ui_print_header(undef, $text{'index_title'}, "", "intro", 1, 1, undef,
20 &help_search_link("jabber", "man", "doc", "google"));
21 print &text('index_edir', "<tt>$config{'jabber_dir'}</tt>",
22 "$gconfig{'webprefix'}/config.cgi?$module_name"),"<p>\n";
23 &ui_print_footer("/", $text{"index"});
27 # Check the version of jabberd
28 $jabberd = $config{'jabber_daemon'} ? $config{'jabber_daemon'}
29 : "$config{'jabber_dir'}/bin/jabberd";
31 &ui_print_header(undef, $text{'index_title'}, "", "intro", 1, 1, undef,
32 &help_search_link("jabber", "man", "doc", "google"));
33 print &text('index_ejabberd', "<tt>$jabberd</tt>",
34 "$gconfig{'webprefix'}/config.cgi?$module_name"),"<p>\n";
35 &ui_print_footer("/", $text{"index"});
38 $ver = &get_jabberd_version(\$out);
40 &ui_print_header(undef, $text{'index_title'}, "", "intro", 1, 1, undef,
41 &help_search_link("jabber", "man", "doc", "google"));
42 print &text('index_eversion', "<pre>$out</pre>", "1.4",
43 "<tt>$jabberd -v</tt>"),"<p>\n";
44 &ui_print_footer("/", $text{"index"});
48 &ui_print_header(undef, $text{'index_title'}, "", "intro", 1, 1, undef,
49 &help_search_link("jabber", "man", "doc", "google"));
50 print &text('index_eversion2', "<pre>$out</pre>", "2.0",
51 "<tt>$jabberd -v</tt>"),"<p>\n";
52 &ui_print_footer("/", $text{"index"});
56 &ui_print_header(undef, $text{'index_title'}, "", "intro", 1, 1, undef,
57 &help_search_link("jabber", "man", "doc", "google"),
58 undef, undef, &text('index_version', $ver));
60 # Check if the needed Perl module are installed
61 push(@needs, "XML::Parser") if (!$got_xml_parser);
62 push(@needs, "XML::Generator") if (!$got_xml_generator);
64 $needs = &urlize(join(" ", @needs));
65 print &text(@needs == 2 ? 'index_emodules' : 'index_emodule', @needs,
66 "/cpan/download.cgi?source=3&cpan=$needs&mode=2&return=/$module_name/&returndesc=".&urlize($text{'index_return'})),"<p>\n";
67 print "$text{'index_expat'}<p>\n";
69 &ui_print_footer("/", $text{"index"});
73 # Show config category icons
74 $conf = &get_jabber_config();
76 print &text('index_eparse', "<tt>XML::Parser</tt>", $conf),"<p>\n";
78 &ui_print_footer("/", $text{"index"});
81 @cats = ( "general", "messages", "modules", "karma", "ips", "filter", "admin", "file" );
82 @links = map { "edit_${_}.cgi" } @cats;
83 @titles = map { $text{"${_}_title"} } @cats;
84 @icons = map { "images/${_}.gif" } @cats;
85 &icons_table(\@links, \@titles, \@icons);
87 # Show warning about config file
88 open(CONFIG, $config{'jabber_config'});
96 print "<b>",&text('index_comments',
97 "<tt>$config{'jabber_config'}</tt>"),"</b><p>\n" if ($has_comment);
99 # Check if jabber is running and show the correct buttons
101 print "<table width=100%>\n";
102 if (&check_pid_file(&jabber_pid_file())) {
103 # Running .. offer to restart and stop
104 print "<form action=restart.cgi><tr>\n";
105 print "<td><input type=submit value=\"$text{'index_restart'}\"></td>\n";
106 print "<td>$text{'index_restartmsg'}</td>\n";
107 print "</tr></form>\n";
109 print "<form action=stop.cgi><tr>\n";
110 print "<td><input type=submit value=\"$text{'index_stop'}\"></td>\n";
111 print "<td>$text{'index_stopmsg'}</td>\n";
112 print "</tr></form>\n";
115 # Not running .. offer to start
116 print "<form action=start.cgi><tr>\n";
117 print "<td><input type=submit value=\"$text{'index_start'}\"></td>\n";
118 print "<td>$text{'index_startmsg'}</td>\n";
119 print "</tr></form>\n";
124 &ui_print_footer("/", $text{'index'});