#!/usr/local/bin/perl # index.cgi # Display jabber configuration option categories require './jabber-lib.pl'; # Check if config file exists if (!-r $config{'jabber_config'}) { &ui_print_header(undef, $text{'index_title'}, "", "intro", 1, 1, undef, &help_search_link("jabber", "man", "doc", "google")); print &text('index_econfig', "$config{'jabber_config'}", "$gconfig{'webprefix'}/config.cgi?$module_name"),"

\n"; &ui_print_footer("/", $text{"index"}); exit; } # Check if base directory exists if (!-d $config{'jabber_dir'}) { &ui_print_header(undef, $text{'index_title'}, "", "intro", 1, 1, undef, &help_search_link("jabber", "man", "doc", "google")); print &text('index_edir', "$config{'jabber_dir'}", "$gconfig{'webprefix'}/config.cgi?$module_name"),"

\n"; &ui_print_footer("/", $text{"index"}); exit; } # Check the version of jabberd $jabberd = $config{'jabber_daemon'} ? $config{'jabber_daemon'} : "$config{'jabber_dir'}/bin/jabberd"; if (!-x $jabberd) { &ui_print_header(undef, $text{'index_title'}, "", "intro", 1, 1, undef, &help_search_link("jabber", "man", "doc", "google")); print &text('index_ejabberd', "$jabberd", "$gconfig{'webprefix'}/config.cgi?$module_name"),"

\n"; &ui_print_footer("/", $text{"index"}); exit; } $ver = &get_jabberd_version(\$out); if (!$ver) { &ui_print_header(undef, $text{'index_title'}, "", "intro", 1, 1, undef, &help_search_link("jabber", "man", "doc", "google")); print &text('index_eversion', "

$out
", "1.4", "$jabberd -v"),"

\n"; &ui_print_footer("/", $text{"index"}); exit; } elsif ($ver >= 2) { &ui_print_header(undef, $text{'index_title'}, "", "intro", 1, 1, undef, &help_search_link("jabber", "man", "doc", "google")); print &text('index_eversion2', "

$out
", "2.0", "$jabberd -v"),"

\n"; &ui_print_footer("/", $text{"index"}); exit; } &ui_print_header(undef, $text{'index_title'}, "", "intro", 1, 1, undef, &help_search_link("jabber", "man", "doc", "google"), undef, undef, &text('index_version', $ver)); # Check if the needed Perl module are installed push(@needs, "XML::Parser") if (!$got_xml_parser); push(@needs, "XML::Generator") if (!$got_xml_generator); if (@needs) { $needs = &urlize(join(" ", @needs)); print &text(@needs == 2 ? 'index_emodules' : 'index_emodule', @needs, "/cpan/download.cgi?source=3&cpan=$needs&mode=2&return=/$module_name/&returndesc=".&urlize($text{'index_return'})),"

\n"; print "$text{'index_expat'}

\n"; print &ui_hr(); &ui_print_footer("/", $text{"index"}); exit; } # Show config category icons $conf = &get_jabber_config(); if (!ref($conf)) { print &text('index_eparse', "XML::Parser", $conf),"

\n"; print &ui_hr(); &ui_print_footer("/", $text{"index"}); exit; } @cats = ( "general", "messages", "modules", "karma", "ips", "filter", "admin", "file" ); @links = map { "edit_${_}.cgi" } @cats; @titles = map { $text{"${_}_title"} } @cats; @icons = map { "images/${_}.gif" } @cats; &icons_table(\@links, \@titles, \@icons); # Show warning about config file open(CONFIG, $config{'jabber_config'}); while() { if (/\s+