From cb2a2ba8c1088ad0b30a8259b017980591604e37 Mon Sep 17 00:00:00 2001 From: SL-Gundam Date: Wed, 25 Jun 2014 00:37:20 +0200 Subject: [PATCH] Added error in case the OpenSSL plugin is missing when it is needed --- core/mail_api.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/core/mail_api.php b/core/mail_api.php index 1bfde63..ba13a19 100644 --- a/core/mail_api.php +++ b/core/mail_api.php @@ -1034,15 +1034,20 @@ private function cleanup_project_name( $p_project_name ) # return the hostname parsed into a hostname + port private function prepare_mailbox_hostname() { - if ( $this->_mailbox[ 'encryption' ] !== 'None' && extension_loaded( 'openssl' ) ) - { - $this->_mailbox[ 'hostname' ] = strtolower( $this->_mailbox[ 'encryption' ] ) . '://' . $this->_mailbox[ 'hostname' ]; + $t_def_mailbox_port_index = 'normal'; - $t_def_mailbox_port_index = 'encrypted'; - } - else + if ( $this->_mailbox[ 'encryption' ] !== 'None' ) { - $t_def_mailbox_port_index = 'normal'; + if ( extension_loaded( 'openssl' ) ) + { + $this->_mailbox[ 'hostname' ] = strtolower( $this->_mailbox[ 'encryption' ] ) . '://' . $this->_mailbox[ 'hostname' ]; + + $t_def_mailbox_port_index = 'encrypted'; + } + else + { + $this->custom_error( 'OpenSSL plugin not available even though the mailbox is configured to use it. Please check whether OpenSSL is properly being loaded' ); + } } $this->_mailbox[ 'port' ] = (int) $this->_mailbox[ 'port' ];