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 strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Carp;
|
use Carp;
|
||||||
|
use utf8;
|
||||||
|
use open IO => ':utf8';
|
||||||
|
use open ':std';
|
||||||
|
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
use Email::MIME;
|
use Email::MIME;
|
||||||
use Exporter 'import';
|
use Exporter 'import';
|
||||||
|
|
@ -68,12 +72,18 @@ sub log
|
||||||
if ($mail_error && $level <= ERROR)
|
if ($mail_error && $level <= ERROR)
|
||||||
{
|
{
|
||||||
require Email::Sender::Simple;
|
require Email::Sender::Simple;
|
||||||
|
Email::Sender::Simple->import(qw(sendmail));
|
||||||
my $mail = Email::MIME->create(
|
my $mail = Email::MIME->create(
|
||||||
header_str => [
|
header_str => [
|
||||||
From => "Roots assistants <root\@$HOSTNAME.acu.epita.fr>",
|
From => "Roots assistants <root\@$HOSTNAME.acu.epita.fr>",
|
||||||
To => "Roots assistants <ml-root\@acu.epita.fr>",
|
To => "Roots assistants <ml-root\@acu.epita.fr>",
|
||||||
Subject => "[LERDORF][ERROR] ".join(' ', @_)
|
Subject => "[LERDORF][ERROR] ".join(' ', @_)
|
||||||
],
|
],
|
||||||
|
attributes => {
|
||||||
|
encoding => 'quoted-printable',
|
||||||
|
charset => 'utf-8',
|
||||||
|
format => 'flowed',
|
||||||
|
},
|
||||||
body_str => "Bonjour,
|
body_str => "Bonjour,
|
||||||
|
|
||||||
Une erreur de niveau $level est survenue sur la machine $HOSTNAME.
|
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(@)
|
sub cmd_no_strong_auth_warn(@)
|
||||||
{
|
{
|
||||||
require Email::Sender::Simple;
|
require Email::Sender::Simple;
|
||||||
|
Email::Sender::Simple->import(qw(sendmail));
|
||||||
|
|
||||||
for my $entry (get_no_strong_auth_user())
|
for my $entry (get_no_strong_auth_user())
|
||||||
{
|
{
|
||||||
|
|
@ -1554,6 +1555,7 @@ Les roots ACU";
|
||||||
sub cmd_no_strong_auth_close(@)
|
sub cmd_no_strong_auth_close(@)
|
||||||
{
|
{
|
||||||
require Email::Sender::Simple;
|
require Email::Sender::Simple;
|
||||||
|
Email::Sender::Simple->import(qw(sendmail));
|
||||||
|
|
||||||
for my $entry (get_no_strong_auth_user())
|
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(@)
|
sub cmd_ssh_keys_without_passphrase_warn(@)
|
||||||
{
|
{
|
||||||
require Email::Sender::Simple;
|
require Email::Sender::Simple;
|
||||||
|
Email::Sender::Simple->import(qw(sendmail));
|
||||||
|
|
||||||
my $process = sub() {
|
my $process = sub() {
|
||||||
my $entry = shift;
|
my $entry = shift;
|
||||||
|
|
@ -1761,6 +1764,7 @@ Les roots ACU";
|
||||||
sub cmd_ssh_keys_without_passphrase_remove(@)
|
sub cmd_ssh_keys_without_passphrase_remove(@)
|
||||||
{
|
{
|
||||||
require Email::Sender::Simple;
|
require Email::Sender::Simple;
|
||||||
|
Email::Sender::Simple->import(qw(sendmail));
|
||||||
|
|
||||||
my $process = sub() {
|
my $process = sub() {
|
||||||
my $entry = shift;
|
my $entry = shift;
|
||||||
|
|
|
||||||
Reference in a new issue