Skip to content
Extraits de code Groupes Projets
Valider 81af5c60 rédigé par Alexandre Morignot's avatar Alexandre Morignot
Parcourir les fichiers

remove useless code

parent 55c49b44
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -8,7 +8,6 @@ use Sam::Chan; ...@@ -8,7 +8,6 @@ use Sam::Chan;
use Sam::Event; use Sam::Event;
use Time::Local; use Time::Local;
our $dbh;
our $log; our $log;
sub exec { sub exec {
......
...@@ -8,18 +8,12 @@ use Regexp::Common qw(URI); ...@@ -8,18 +8,12 @@ use Regexp::Common qw(URI);
use Sam::Chan; use Sam::Chan;
use Sam::Event; use Sam::Event;
our $dbh;
our $log; our $log;
our $irc; our $irc;
sub exec { sub exec {
my ($id, $command, $arg, $chan_name) = @_; my ($id, $command, $arg, $chan_name) = @_;
my $saveCommit = $dbh->{AutoCommit};
my $saveError = $dbh->{RaiseError};
$dbh->{AutoCommit} = 0;
$dbh->{RaiseError} = 1;
if ($command eq "lien" or $command eq "url" or $command eq "link") { if ($command eq "lien" or $command eq "url" or $command eq "link") {
if ($arg !~ /^$RE{URI}{HTTP}{-scheme => qr(https?)}$/) { if ($arg !~ /^$RE{URI}{HTTP}{-scheme => qr(https?)}$/) {
die "Ce n'est pas une URL valide"; die "Ce n'est pas une URL valide";
...@@ -46,9 +40,6 @@ sub exec { ...@@ -46,9 +40,6 @@ sub exec {
else { else {
die "Commande inconnue"; die "Commande inconnue";
} }
$dbh->{AutoCommit} = $saveCommit;
$dbh->{RaiseError} = $saveError;
} }
1; 1;
...@@ -9,13 +9,11 @@ require Exporter; ...@@ -9,13 +9,11 @@ require Exporter;
our @ISA = qw(Exporter); our @ISA = qw(Exporter);
our @EXPORT_OK = qw(exec); our @EXPORT_OK = qw(exec);
our $dbh;
our $log; our $log;
our $irc; our $irc;
sub exec { sub exec {
my $chan = shift; my $chan = shift;
my $sth;
my $calendar_id = Sam::Chan->new(name => $chan)->load->calendar_id; my $calendar_id = Sam::Chan->new(name => $chan)->load->calendar_id;
my $events = Sam::Event::Manager->get_events( my $events = Sam::Event::Manager->get_events(
......
...@@ -19,10 +19,7 @@ my $lastID; ...@@ -19,10 +19,7 @@ my $lastID;
sub setConf { sub setConf {
my ($nickNew, $ircNew, $dbh, $log, $lastIDnew) = @_; my ($nickNew, $ircNew, $dbh, $log, $lastIDnew) = @_;
$Sam::commands::add::dbh = $dbh;
$Sam::commands::list::dbh = $dbh;
$Sam::commands::addUser::dbh = $dbh; $Sam::commands::addUser::dbh = $dbh;
$Sam::commands::edit::dbh = $dbh;
$Sam::commands::getUsers::dbh = $dbh; $Sam::commands::getUsers::dbh = $dbh;
$Sam::commands::add::log = $log; $Sam::commands::add::log = $log;
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter