Utilisation de localtime à la place de DateTime

tags/0.0.1
Daniel Berteaud 12 years ago
parent 273ea2ac0d
commit 5082d5e74f
  1. 8
      root/usr/share/qpsmtpd/plugins/logging/log2sql
  2. 1
      smeserver-qpsmtpd-log2sql.spec

@ -10,7 +10,6 @@
##################################################### #####################################################
use DBI; use DBI;
use DateTime;
use strict; use strict;
#plugin level variables are here since version 0.02 #plugin level variables are here since version 0.02
@ -68,7 +67,8 @@ $transaction->notes('log2sql_mail_id', $mail_id);
# quote the mail_id for later use: # quote the mail_id for later use:
$mail_id = $dbh->quote($mail_id); $mail_id = $dbh->quote($mail_id);
my $dt = DateTime->now; my ($sec,$min,$hour,$day,$mon,$year) = localtime;
$year += 1900;
my($statement) = "INSERT INTO ".$mail_table." (mail_id,". my($statement) = "INSERT INTO ".$mail_table." (mail_id,".
$mail_table.".date_day,". $mail_table.".date_day,".
@ -76,8 +76,8 @@ my($statement) = "INSERT INTO ".$mail_table." (mail_id,".
"remote_ip,remote_host,remote_info) ". "remote_ip,remote_host,remote_info) ".
"VALUES(". "VALUES(".
$mail_id.",". $mail_id.",".
$dbh->quote($dt->ymd).",". $dbh->quote($year.'-'.$mon.'-'.$day).",".
$dbh->quote($dt->hms).",". $dbh->quote($hour.':'.$min.':'.$sec).",".
$dbh->quote($self->qp->connection->remote_ip).",". $dbh->quote($self->qp->connection->remote_ip).",".
$dbh->quote($self->qp->connection->remote_host).",". $dbh->quote($self->qp->connection->remote_host).",".
$dbh->quote($self->qp->connection->remote_info).")"; $dbh->quote($self->qp->connection->remote_info).")";

@ -17,7 +17,6 @@ BuildRequires: e-smith-devtools
Requires: smeserver-qpsmtpd Requires: smeserver-qpsmtpd
Requires: e-smith-mysql Requires: e-smith-mysql
Requires: perl(Date::Time)
Requires: perl(DBI) Requires: perl(DBI)
%description %description

Loading…
Cancel
Save