diff --git a/proftpd/index.cgi b/proftpd/index.cgi index 6df19122f..36e3d867b 100755 --- a/proftpd/index.cgi +++ b/proftpd/index.cgi @@ -5,8 +5,7 @@ require './proftpd-lib.pl'; # Check if proftpd is installed -@st = stat($config{'proftpd_path'}); -if (!@st) { +if (&has_command($config{'proftpd_path'})) { &ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1, 0, &help_search_link("proftpd", "man", "doc", "google")); print &text('index_eproftpd', "$config{'proftpd_path'}", @@ -18,7 +17,20 @@ if (!@st) { print $lnk,"
\n" if ($lnk); &ui_print_footer("/", $text{'index'}); - exit; + return; + } + +# Check that the command is actually proftpd +if (!$site{'version'}) { + &ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1, 0, + &help_search_link("proftpd", "man", "doc", "google")); + print &text('index_eproftpd2', + "$config{'proftpd_path'}", + "@{[&get_webprefix()]}/config.cgi?$module_name", + "$config{'proftpd_path'} -v", + "
$out"),"
\n"; + &ui_print_footer("/", $text{'index'}); + return; } # Check if the config file exists @@ -29,49 +41,7 @@ if (!@$conf) { print &text('index_econf', "$config{'proftpd_conf'}", "@{[&get_webprefix()]}/config.cgi?$module_name"),"
\n"; &ui_print_footer("/", $text{'index'}); - exit; - } - -# Check if the executable has changed .. -if ($site{'size'} != $st[7] || !$site{'version'} || !$site{'fullversion'}) { - # Check if it really is proftpd and the right version - $site{'size'} = $st[7]; - ($ver, $fullver) = &get_proftpd_version(\$out); - if (!$ver) { - &ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1, 0, - &help_search_link("proftpd", "man", "doc", "google")); - print &text('index_eproftpd2', - "$config{'proftpd_path'}", - "@{[&get_webprefix()]}/config.cgi?$module_name", - "$config{'proftpd_path'} -v", - "
$out"),"
\n"; - &ui_print_footer("/", $text{'index'}); - exit; - } - $site{'version'} = $ver; - $site{'fullversion'} = $fullver; - if ($site{'version'} < 0.99) { - &ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1, 0, - &help_search_link("proftpd", "man", "doc", "google")); - print &text('index_eversion', - "$config{'proftpd_path'}", - "@{[&get_webprefix()]}/config.cgi?$module_name"),"
\n";
- &ui_print_footer("/", $text{'index'});
- exit;
- }
-
- # Get the list of modules
- local @mods;
- open(MODS, "$config{'proftpd_path'} -vv |");
- while(