From ed3ec25c9ccb81afecdbd912f8a45fa3124ddb19 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Wed, 10 Jun 2009 19:00:17 +0000 Subject: [PATCH] Username in header --- fetchmail/check.cgi | 4 +++- fetchmail/edit_global.cgi | 5 ++++- fetchmail/edit_poll.cgi | 5 +++-- fetchmail/lang/en | 1 + 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/fetchmail/check.cgi b/fetchmail/check.cgi index f0b9bfa70..5a324c637 100755 --- a/fetchmail/check.cgi +++ b/fetchmail/check.cgi @@ -4,7 +4,6 @@ require './fetchmail-lib.pl'; &ReadParse(); -&ui_print_unbuffered_header(undef, $text{'check_title'}, ""); if ($config{'config_file'}) { $file = $config{'config_file'}; @@ -13,8 +12,11 @@ else { &can_edit_user($in{'user'}) || &error($text{'poll_ecannot'}); @uinfo = getpwnam($in{'user'}); $file = "$uinfo[7]/.fetchmailrc"; + $uheader = &text('poll_foruser', "$in{'user'}"); } +&ui_print_unbuffered_header($uheader, $text{'check_title'}, ""); + $cmd = "$config{'fetchmail_path'} -v -f '$file'"; if ($config{'mda_command'}) { $cmd .= " -m '$config{'mda_command'}'"; diff --git a/fetchmail/edit_global.cgi b/fetchmail/edit_global.cgi index 078c49159..b61543727 100755 --- a/fetchmail/edit_global.cgi +++ b/fetchmail/edit_global.cgi @@ -4,7 +4,6 @@ require './fetchmail-lib.pl'; &ReadParse(); -&ui_print_header(undef, $text{'global_title'}, ""); if ($config{'config_file'}) { $file = $config{'config_file'}; @@ -13,7 +12,11 @@ else { &can_edit_user($in{'user'}) || &error($text{'poll_ecannot'}); @uinfo = getpwnam($in{'user'}); $file = "$uinfo[7]/.fetchmailrc"; + $uheader = &text('poll_foruser', "$in{'user'}"); } + +&ui_print_header($uheader, $text{'global_title'}, ""); + @conf = &parse_config_file($file); foreach $c (@conf) { $poll = $c if ($c->{'defaults'}); diff --git a/fetchmail/edit_poll.cgi b/fetchmail/edit_poll.cgi index 96276d6bb..30a6b42d8 100755 --- a/fetchmail/edit_poll.cgi +++ b/fetchmail/edit_poll.cgi @@ -11,13 +11,14 @@ else { &can_edit_user($in{'user'}) || &error($text{'poll_ecannot'}); @uinfo = getpwnam($in{'user'}); $file = "$uinfo[7]/.fetchmailrc"; + $uheader = &text('poll_foruser', "$in{'user'}"); } if ($in{'new'}) { - &ui_print_header(undef, $text{'poll_create'}, ""); + &ui_print_header($uheader, $text{'poll_create'}, ""); } else { - &ui_print_header(undef, $text{'poll_edit'}, ""); + &ui_print_header($uheader, $text{'poll_edit'}, ""); @conf = &parse_config_file($file); $poll = $conf[$in{'idx'}]; } diff --git a/fetchmail/lang/en b/fetchmail/lang/en index 37ca94827..12fcfe769 100644 --- a/fetchmail/lang/en +++ b/fetchmail/lang/en @@ -64,6 +64,7 @@ poll_postconnect=Command to run after disconnecting poll_ecannot=You are not allowed to edit this user's fetchmail config poll_efile=Only users' fetchmail config files can be edited poll_eusername=User does not exist! +poll_foruser=For user $1 stop_err=Failed to stop fetchmail stop_ecannot=You are not allowed to stop fetchmail