Merge branch 'master' of ssh://cpp/liblerdorf
This commit is contained in:
commit
dd01b53d68
2 changed files with 14 additions and 0 deletions
10
ACU/Log.pm
10
ACU/Log.pm
|
|
@ -4,6 +4,10 @@ use v5.10.1;
|
|||
use strict;
|
||||
use warnings;
|
||||
use Carp;
|
||||
use utf8;
|
||||
use open IO => ':utf8';
|
||||
use open ':std';
|
||||
|
||||
use Data::Dumper;
|
||||
use Email::MIME;
|
||||
use Exporter 'import';
|
||||
|
|
@ -68,12 +72,18 @@ sub log
|
|||
if ($mail_error && $level <= ERROR)
|
||||
{
|
||||
require Email::Sender::Simple;
|
||||
Email::Sender::Simple->import(qw(sendmail));
|
||||
my $mail = Email::MIME->create(
|
||||
header_str => [
|
||||
From => "Roots assistants <root\@$HOSTNAME.acu.epita.fr>",
|
||||
To => "Roots assistants <ml-root\@acu.epita.fr>",
|
||||
Subject => "[LERDORF][ERROR] ".join(' ', @_)
|
||||
],
|
||||
attributes => {
|
||||
encoding => 'quoted-printable',
|
||||
charset => 'utf-8',
|
||||
format => 'flowed',
|
||||
},
|
||||
body_str => "Bonjour,
|
||||
|
||||
Une erreur de niveau $level est survenue sur la machine $HOSTNAME.
|
||||
|
|
|
|||
|
|
@ -1513,6 +1513,7 @@ sub cmd_no_strong_auth_view(@)
|
|||
sub cmd_no_strong_auth_warn(@)
|
||||
{
|
||||
require Email::Sender::Simple;
|
||||
Email::Sender::Simple->import(qw(sendmail));
|
||||
|
||||
for my $entry (get_no_strong_auth_user())
|
||||
{
|
||||
|
|
@ -1554,6 +1555,7 @@ Les roots ACU";
|
|||
sub cmd_no_strong_auth_close(@)
|
||||
{
|
||||
require Email::Sender::Simple;
|
||||
Email::Sender::Simple->import(qw(sendmail));
|
||||
|
||||
for my $entry (get_no_strong_auth_user())
|
||||
{
|
||||
|
|
@ -1707,6 +1709,7 @@ sub cmd_ssh_keys_without_passphrase_view(@)
|
|||
sub cmd_ssh_keys_without_passphrase_warn(@)
|
||||
{
|
||||
require Email::Sender::Simple;
|
||||
Email::Sender::Simple->import(qw(sendmail));
|
||||
|
||||
my $process = sub() {
|
||||
my $entry = shift;
|
||||
|
|
@ -1761,6 +1764,7 @@ Les roots ACU";
|
|||
sub cmd_ssh_keys_without_passphrase_remove(@)
|
||||
{
|
||||
require Email::Sender::Simple;
|
||||
Email::Sender::Simple->import(qw(sendmail));
|
||||
|
||||
my $process = sub() {
|
||||
my $entry = shift;
|
||||
|
|
|
|||
Reference in a new issue