01tonythomas has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/140077

Change subject: Fixed Indendation errors after 
I02f4750cc37e7b4b928e4f20882382915e465be8
......................................................................

Fixed Indendation errors after I02f4750cc37e7b4b928e4f20882382915e465be8

Change-Id: I5fddd3f56e971a9c845727f77f5a0763c1a08e67
---
M BounceHandler.php
M BounceHandlerHooks.php
M processIMAPEmails.php
M sql/bounce_records.sql
4 files changed, 16 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BounceHandler 
refs/changes/77/140077/1

diff --git a/BounceHandler.php b/BounceHandler.php
index f7b0a08..4a4c55b 100644
--- a/BounceHandler.php
+++ b/BounceHandler.php
@@ -29,7 +29,7 @@
 $wgExtensionMessagesFiles['BounceHandlerAlias'] = $dir . 
'/BounceHandler.alias.php';
 
 # Schema updates for update.php
-$wgHooks['LoadExtensionSchemaUpdates'][] = 'BounceHandlerHooks::AddTable';
+$wgHooks['LoadExtensionSchemaUpdates'][] = 
'BounceHandlerHooks::addBounceRecordsTable';
 
 /**
  * VERP Configurations
diff --git a/BounceHandlerHooks.php b/BounceHandlerHooks.php
index 6803ee1..0335634 100644
--- a/BounceHandlerHooks.php
+++ b/BounceHandlerHooks.php
@@ -9,7 +9,7 @@
                if ( $wgEnableVERP ) {
                        $from->address = self::generateVERP( $recip->address );
                }
-       return true;
+               return true;
        }
        /**
         * Generate VERP address
@@ -26,17 +26,18 @@
                }
                $verp_hash = hash_hmac( $wgVERPalgo, $to, $wgVERPsecret );
                $email_prefix = 'bounces';
-               $returnPath = $email_prefix.'-'.$verp_hash.'@'.$email_domain;
+               $returnPath = $email_prefix. '-' .$verp_hash. '@' 
.$email_domain;
                return $returnPath;
        }
+
        /*
-       * Add tables to DataBase
+       * Add tables to Database
        */
-       public static function AddTable( DatabaseUpdater $updater ) {
+       public static function addBounceRecordsTable( DatabaseUpdater $updater 
) {
                $updater->addExtensionTable(
                        'bounce_records',
                        __DIR__. '/sql/bounce_records.sql', true
                        );
-       return true;
+               return true;
        }
 }
\ No newline at end of file
diff --git a/processIMAPEmails.php b/processIMAPEmails.php
index 3ff8993..50a111c 100644
--- a/processIMAPEmails.php
+++ b/processIMAPEmails.php
@@ -19,22 +19,25 @@
                global $wgIMAPuser, $wgIMAPpass, $wgIMAPserver;
                $imapuser = $this->getArg( 0 );
                $imappass = $this->getArg( 1 );
-               if ( !( $imapuser ) && ( $wgIMAPuser === null ) ) {
+               if ( !$imapuser && $wgIMAPuser === null ) {
                        $this->error( "invalid IMAP username.", true );
                } else {
-                       $imapuser = ( ( $wgIMAPuser === null ) ? $imapuser : 
$wgIMAPuser );
+                       $imapuser = $wgIMAPuser === null ? $imapuser : 
$wgIMAPuser;
                }
-               if ( !( $imappass ) && ( $wgIMAPpass === null ) ) {
+               if ( !$imappass && $wgIMAPpass === null ) {
                        $this->error( "invalid IMAP password.", true );
                } else {
-                       $imappass = ( ( $wgIMAPpass === null ) ?  $imappass : 
$wgIMAPpass );
+                       $imappass = $wgIMAPpass === null ?  $imappass : 
$wgIMAPpass;
                }
                if ( $wgIMAPserver === null ) {
                        $this->error( "invalid IMAP server.", true );
                }
 
                // Establish IMAP connection
-               $conn = imap_open( $wgIMAPserver, $imapuser, $imappass ) or 
die( imap_last_error() );
+               $conn = imap_open( $wgIMAPserver, $imapuser, $imappass );
+               if ( !$conn ) {
+                       $this->error( imap_last_error() );
+               }
                $num_recent = imap_num_recent( $conn );
 
                // Establish Database connection
diff --git a/sql/bounce_records.sql b/sql/bounce_records.sql
index 549914b..8434dd5 100644
--- a/sql/bounce_records.sql
+++ b/sql/bounce_records.sql
@@ -2,7 +2,7 @@
 -- Licence: GNU GPL v2+
 -- Author: Tony Thomas, Legoktm, Jeff Green
 
-CREATE TABLE IF NOT EXISTS /*_*/bounce_records (
+CREATE TABLE /*_*/bounce_records (
        br_id           INT unsigned        NOT NULL PRIMARY KEY auto_increment,
        br_user         VARCHAR(255)    NOT NULL, -- Email Id of failing 
recieptent
        br_timestamp    varbinary(14)   NOT NULL,

-- 
To view, visit https://gerrit.wikimedia.org/r/140077
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5fddd3f56e971a9c845727f77f5a0763c1a08e67
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BounceHandler
Gerrit-Branch: master
Gerrit-Owner: 01tonythomas <01tonytho...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to