#!/usr/local/bin/perl # index.cgi # Show fetchmail configurations require './fetchmail-lib.pl'; # Check if fetchmail is installed if (!&has_command($config{'fetchmail_path'})) { &ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1, 0, &help_search_link("fetchmail", "doc", "man", "google")); print "
",&text('index_efetchmail', "$config{'fetchmail_path'}", "$gconfig{'webprefix'}/config.cgi?$module_name"),"
\n"; &ui_print_footer("/", $text{'index'}); exit; } # Get and show the version $ver = &get_fetchmail_version(); &ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1, 0, &help_search_link("fetchmail", "doc", "man", "google"), undef, undef, &text('index_version', $ver)); if ($config{'config_file'}) { # Just read one config file @conf = &parse_config_file($config{'config_file'}); @conf = grep { $_->{'poll'} } @conf; print "",&text('index_file', "$config{'config_file'}"),"
\n"; &show_polls(\@conf, $config{'config_file'}, $config{'daemon_user'}); local @uinfo = getpwnam($config{'daemon_user'}); print &ui_hr(); print "
\n"; if ($running) { # daemon is running - offer to stop it print " | \n"; print "",&text('index_stopmsg', "$config{'daemon_user'}", $interval)," | \n"; } else { # daemon isn't running - offer to start it print "
\n"; } elsif ($config{'max_users'} && $ucount > $config{'max_users'}) { # Show user search form print "$text{'index_toomany'}
\n"; print &ui_form_start("edit_user.cgi"); print "$text{'index_search'}\n"; print &ui_user_textbox("user", undef, 20),"\n"; print &ui_submit($text{'index_show'}),"\n"; print &ui_form_end(); $toomany = 1; } elsif (!$config{'view_mode'}) { # Full details &show_button(); print "
$text{'index_user'} | $text{'index_conf'} |
",&html_escape($u->[1]->[0]), " | \n"; &show_polls($u->[0], "$u->[1]->[7]/.fetchmailrc", $u->[1]->[0]); print " |