summaryrefslogtreecommitdiff
path: root/fml/lib/FML/Command/Admin
diff options
context:
space:
mode:
authorfukachan <fukachan>2003-09-13 09:16:59 +0000
committerfukachan <fukachan>2003-09-13 09:16:59 +0000
commit6516e5bd0eddd74001051ff507e15e4e58330932 (patch)
tree501256c72ce619c06a670bf87ae731c2a67bfb3b /fml/lib/FML/Command/Admin
parent580caed90c994e9b81e6408b4ac04e57d1f4a15d (diff)
downloadfml8-6516e5bd0eddd74001051ff507e15e4e58330932.tar.gz
fml8-6516e5bd0eddd74001051ff507e15e4e58330932.tar.bz2
fml8-6516e5bd0eddd74001051ff507e15e4e58330932.zip
use $curproc->ui_message() instead of "print STDERR ...".
Diffstat (limited to 'fml/lib/FML/Command/Admin')
-rw-r--r--fml/lib/FML/Command/Admin/edit.pm4
-rw-r--r--fml/lib/FML/Command/Admin/mailq.pm4
-rw-r--r--fml/lib/FML/Command/Admin/newml.pm35
-rw-r--r--fml/lib/FML/Command/Admin/rmml.pm10
4 files changed, 30 insertions, 23 deletions
diff --git a/fml/lib/FML/Command/Admin/edit.pm b/fml/lib/FML/Command/Admin/edit.pm
index 2c44101b..889be5aa 100644
--- a/fml/lib/FML/Command/Admin/edit.pm
+++ b/fml/lib/FML/Command/Admin/edit.pm
@@ -4,7 +4,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: edit.pm,v 1.15 2003/03/18 10:35:13 fukachan Exp $
+# $FML: edit.pm,v 1.16 2003/08/23 04:35:30 fukachan Exp $
#
package FML::Command::Admin::edit;
@@ -75,7 +75,7 @@ sub process
my $editor = $ENV{ 'EDITOR' } || 'vi';
if (-f $config_cf) {
- print STDERR "$editor $config_cf\n";
+ $curproc->ui_message("$editor $config_cf");
system $editor, $config_cf;
}
else {
diff --git a/fml/lib/FML/Command/Admin/mailq.pm b/fml/lib/FML/Command/Admin/mailq.pm
index e12b0a97..95fab67d 100644
--- a/fml/lib/FML/Command/Admin/mailq.pm
+++ b/fml/lib/FML/Command/Admin/mailq.pm
@@ -4,7 +4,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: mailq.pm,v 1.4 2003/04/29 11:29:29 fukachan Exp $
+# $FML: mailq.pm,v 1.5 2003/08/23 04:35:31 fukachan Exp $
#
package FML::Command::Admin::mailq;
@@ -94,7 +94,7 @@ sub _queue
}
unless ($count) {
- print STDERR "Mail queue is empty\n";
+ $curproc->ui_message("Mail queue is empty");
}
}
diff --git a/fml/lib/FML/Command/Admin/newml.pm b/fml/lib/FML/Command/Admin/newml.pm
index a3fa60d0..254b5a55 100644
--- a/fml/lib/FML/Command/Admin/newml.pm
+++ b/fml/lib/FML/Command/Admin/newml.pm
@@ -4,7 +4,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: newml.pm,v 1.67 2003/09/04 12:27:53 fukachan Exp $
+# $FML: newml.pm,v 1.68 2003/09/12 00:01:09 fukachan Exp $
#
package FML::Command::Admin::newml;
@@ -202,7 +202,7 @@ sub _init_ml_home_dir
my $dirlist = $config->get_as_array_ref('newml_command_init_public_dirs');
for my $_dir (@$dirlist) {
unless (-d $_dir) {
- print STDERR "creating ", $_dir, "\n";
+ $curproc->ui_message("creating $_dir");
$curproc->mkdir( $_dir, "mode=public");
}
}
@@ -210,7 +210,7 @@ sub _init_ml_home_dir
$dirlist = $config->get_as_array_ref('newml_command_init_private_dirs');
for my $_dir (@$dirlist) {
unless (-d $_dir) {
- print STDERR "creating ", $_dir, "\n";
+ $curproc->ui_message("creating $_dir");
$curproc->mkdir( $_dir, "mode=private");
}
}
@@ -239,7 +239,7 @@ sub _install_template_files
my $src = File::Spec->catfile($template_dir, $file);
my $dst = File::Spec->catfile($ml_home_dir, $file);
- print STDERR "creating ", $dst, "\n";
+ $curproc->ui_message("creating $dst");
_install($src, $dst, $params);
}
@@ -274,8 +274,9 @@ sub _update_aliases
# append
if ($self->_is_mta_alias_maps_has_ml_entry($curproc, $params, $ml_name)) {
- print STDERR "warning: $ml_name already defined!\n";
- print STDERR " ignore aliases updating.\n";
+ $curproc->ui_message("warning: $ml_name already defined!");
+ $curproc->ui_message(" ignore aliases updating");
+ $curproc->logwarn("$ml_name ml already defined");
}
else {
my $list = $config->get_as_array_ref('newml_command_mta_config_list');
@@ -298,7 +299,7 @@ sub _update_aliases
}
if ($found) {
- print STDERR "skipping alias update for $mta\n";
+ $curproc->ui_message("skipping alias update for $mta");
}
else {
$obj->install_alias($curproc, $params, $optargs);
@@ -329,7 +330,9 @@ sub _is_mta_alias_maps_has_ml_entry
my $obj = new FML::MTAControl;
if ($obj->is_user_entry_exist_in_passwd($ml_name)) {
- print STDERR "error: $ml_name is found in passwd\n";
+ my $s = "ml_name=$ml_name is found in passwd";
+ $curproc->ui_message("error: $s");
+ $curproc->logerror($s);
$found = 1;
}
@@ -343,7 +346,9 @@ sub _is_mta_alias_maps_has_ml_entry
});
if ($found) {
- print STDERR "error: $ml_name is found in $mta aliases\n";
+ my $s = "ml_name=$ml_name is found in $mta aliases";
+ $curproc->ui_message("error: $s");
+ $curproc->logerror($s);
last MTA;
}
}
@@ -369,7 +374,7 @@ sub _setup_mail_archive_dir
my $dir = $config->{ html_archive_dir };
unless (-d $dir) {
- print STDERR "creating ", $dir, "\n";
+ $curproc->ui_message("creating $dir");
$curproc->mkdir($dir, "mode=public");
}
}
@@ -398,7 +403,7 @@ sub _setup_cgi_interface
my $ml_admin_cgi_dir = $config->{ ml_admin_cgi_base_dir };
for my $dir ($cgi_base_dir, $admin_cgi_dir, $ml_admin_cgi_dir) {
unless (-d $dir) {
- print STDERR "creating ", $dir, "\n";
+ $curproc->ui_message("creating $dir");
$is_dir_exists{ $dir } = 0;
$curproc->mkdir($dir, "mode=public");
}
@@ -416,8 +421,8 @@ sub _setup_cgi_interface
my $src = File::Spec->catfile($template_dir, 'dot_htaccess');
my $dst = File::Spec->catfile($cgi_base_dir, '.htaccess');
- print STDERR "creating ", $dst, "\n";
- print STDERR " (a dummy to disable cgi by default)\n";
+ $curproc->ui_message("creating $dst");
+ $curproc->ui_message(" (a dummy to disable cgi by default)");
_install($src, $dst, $params);
}
@@ -446,7 +451,7 @@ sub _setup_cgi_interface
File::Spec->catfile($admin_cgi_dir, 'config.cgi'),
File::Spec->catfile($admin_cgi_dir, 'thread.cgi')
) {
- print STDERR "creating ", $dst, "\n";
+ $curproc->ui_message("creating $dst");
_install($src, $dst, $params);
chmod 0755, $dst;
}
@@ -507,7 +512,7 @@ sub _setup_listinfo
my $src = File::Spec->catfile($template_dir, $file);
my $dst = File::Spec->catfile($listinfo_dir, $file);
- print STDERR "creating ", $dst, "\n";
+ $curproc->ui_message("creating $dst");
_install($src, $dst, $params);
}
}
diff --git a/fml/lib/FML/Command/Admin/rmml.pm b/fml/lib/FML/Command/Admin/rmml.pm
index e2d1faf0..a6cddf23 100644
--- a/fml/lib/FML/Command/Admin/rmml.pm
+++ b/fml/lib/FML/Command/Admin/rmml.pm
@@ -4,7 +4,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: rmml.pm,v 1.17 2003/09/04 12:27:53 fukachan Exp $
+# $FML: rmml.pm,v 1.18 2003/09/06 03:34:04 fukachan Exp $
#
package FML::Command::Admin::rmml;
@@ -115,7 +115,7 @@ sub _remove_ml_home_dir
my $ml_home_prefix = $params->{ ml_home_prefix };
my $ml_home_dir = $params->{ ml_home_dir };
- print STDERR "removing ml_home_dir for $ml_name\n";
+ $curproc->ui_message("removing ml_home_dir for $ml_name");
# /var/spool/ml/elena -> /var/spool/ml/@elena
my $removed_dir =
@@ -123,10 +123,12 @@ sub _remove_ml_home_dir
rename($ml_home_dir, $removed_dir);
if (-d $removed_dir && (! -d $ml_home_dir)) {
- print STDERR "\tremoved.\n";
+ $curproc->ui_message("removed");
}
else {
- print STDERR "\tfailed.\n";
+ my $s = "failed to remove ml_home_dir";
+ $curproc->ui_message("error: $s");
+ $curproc->logerror($s);
}
}