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 141965e commit 54ea1b5
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions src/Handler.pm
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,6 @@ sub uninstall
eval {
iMSCP::Dir->new( dirname => "$CWD/data/logs/roundcube" )->remove();

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

$self->{'dbh'}->do(
"DROP DATABASE IF EXISTS `@{ [ $::imscpConfig{'DATABASE_NAME'} . '_roundcube' ] }`"
);
Expand Down Expand Up @@ -323,11 +321,10 @@ sub deleteMail
{
my ( $self, $moduleData ) = @_;

return unless $moduleData->{'MAIL_TYPE'} =~ /_mail/;
return 0 unless $moduleData->{'MAIL_TYPE'} =~ /_mail/;

local $@;
eval {
local $self->{'dbh'}->{'RaiseError'} = TRUE;
$self->{'dbh'}->do(
"
DELETE FROM `@{ [ $::imscpConfig{'DATABASE_NAME'} . '_roundcube' ] }`.`users`
Expand Down Expand Up @@ -364,9 +361,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 @@ -422,8 +419,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 @@ -608,8 +603,6 @@ sub _setupSqlUser
$self->{'_roundcube_control_user_passwd'}
);

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

# Grant 'all' privileges on the imscp_roundcube database
$self->{'dbh'}->do(
"
Expand Down Expand Up @@ -657,8 +650,6 @@ sub _setupDatabase

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

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

if ( !$self->{'dbh'}->selectrow_hashref(
Expand Down

0 comments on commit 54ea1b5

Please sign in to comment.