Skip to content

Commit

Permalink
Code cleanup (Package handler)
Browse files Browse the repository at this point in the history
  • Loading branch information
nuxwin committed May 12, 2019
1 parent f02a1d7 commit 00f8e59
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions src/Handler.pm
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ package Package::WebmailClients::RainLoop::Handler;
use strict;
use warnings;
use File::Spec;
use iMSCP::Boolean;
use iMSCP::Crypt qw/ decryptRijndaelCBC encryptRijndaelCBC randomStr /;
use iMSCP::Cwd '$CWD';
use iMSCP::Database;
Expand Down Expand Up @@ -151,8 +150,6 @@ sub uninstall

local $@;
eval {
local $self->{'dbh'}->{'RaiseError'} = TRUE;

$self->{'dbh'}->do(
"DROP DATABASE IF EXISTS `@{ [ $::imscpConfig{'DATABASE_NAME'} . '_rainloop' ] }`"
);
Expand Down Expand Up @@ -208,8 +205,6 @@ sub deleteMail

local $@;
eval {
local $self->{'dbh'}->{'RaiseError'} = TRUE;

my $database = $::imscpConfig{'DATABASE_NAME'} . '_rainloop';

$self->{'dbh'}->do(
Expand Down Expand Up @@ -271,9 +266,9 @@ sub afterFrontEndBuildConfFile
{
my ( $tplContent, $tplName ) = @_;

return 0 unless grep (
$_ eq $tplName, '00_master.nginx', '00_master_ssl.nginx'
);
return 0 unless grep ( $_ eq $tplName, qw/
00_master.nginx 00_master_ssl.nginx
/ );

${ $tplContent } = replaceBloc(
"# SECTION custom BEGIN.\n",
Expand Down Expand Up @@ -400,8 +395,6 @@ sub _buildConfigFiles

local $@;
my $rs = eval {
local $self->{'dbh'}->{'RaiseError'} = TRUE;

my %config = @{ $self->{'dbh'}->selectcol_arrayref(
"
SELECT `name`, `value`
Expand Down Expand Up @@ -562,8 +555,6 @@ sub _setupDatabase

local $@;
my $rs = eval {
local $self->{'dbh'}->{'RaiseError'} = TRUE;

my $database = ::setupGetQuestion( 'DATABASE_NAME' ) . '_rainloop';

$self->{'dbh'}->do(
Expand Down Expand Up @@ -650,8 +641,6 @@ sub _setupSqlUser
$self->{'_rainloop_control_user_passwd'}
);

local $self->{'dbh'}->{'RaiseError'} = TRUE;

# Grant 'all' privileges on the imscp_rainloop database
$self->{'dbh'}->do(
"
Expand Down

0 comments on commit 00f8e59

Please sign in to comment.