-
Notifications
You must be signed in to change notification settings - Fork 0
/
edit_email.cgi
executable file
·36 lines (28 loc) · 1.15 KB
/
edit_email.cgi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/local/bin/perl
# Show the current email settings for a repository
use strict;
use warnings;
our (%text, %in, %config);
require './virtualmin-svn-lib.pl';
&ReadParse();
$config{'cannotify'} || &error($text{'email_ecannot'});
# Get the domain and repository
my $dom = &virtual_server::get_domain($in{'dom'});
&can_edit_domain($dom) || &error($text{'add_edom'});
my @reps = &list_reps($dom);
my ($rep) = grep { $_->{'rep'} eq $in{'rep'} } @reps;
$rep || &error($text{'delete_erep'});
&ui_print_header(&virtual_server::domain_in($dom), $text{'email_title'}, "");
print &ui_form_start("save_email.cgi");
print &ui_hidden("dom", $in{'dom'});
print &ui_hidden("rep", $in{'rep'});
print &ui_hidden("show", $in{'show'});
print &ui_table_start($text{'email_header'}, undef, 2);
print &ui_table_row($text{'email_rep'}, "<tt>$in{'rep'}</tt>");
my $email = &get_repository_email($dom, $rep);
print &ui_table_row($text{'email_email'},
&ui_opt_textbox("email", $email, 50,
$text{'email_none'}, $text{'email_send'}));
print &ui_table_end();
print &ui_form_end([ [ "save", $text{'save'} ] ]);
&ui_print_footer("index.cgi?show=$in{'show'}", $text{'index_return'});