Skip to content

Commit

Permalink
Test and Complete test now always show result
Browse files Browse the repository at this point in the history
  • Loading branch information
SL-Gundam committed Dec 19, 2016
1 parent 79fb81c commit b685787
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 27 deletions.
1 change: 1 addition & 0 deletions doc/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Jul 2016 - EmailReporting-0.9.3-DEV
- Test and Complete test now also show location of pear error
- Fixed moved functionality concerning reassign_on_feedback
- Added extra check whether the given priority exists
- Test and Complete test now always show result

Jul 2016 - EmailReporting-0.9.2
- Fixed collation check issue with MantisBT 1.3.x
Expand Down
51 changes: 24 additions & 27 deletions pages/manage_mailbox_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
}
elseif ( ( $f_mailbox_action === 'test' || $f_mailbox_action === 'complete_test' ) && $f_select_mailbox >= 0 )
{
$t_no_redirect = TRUE;

# Verify mailbox - from Recmail by Cas Nuy
plugin_require_api( 'core/mail_api.php' );

Expand All @@ -69,39 +71,34 @@

$t_is_custom_error = ( ( is_array( $t_result ) && isset( $t_result[ 'ERROR_TYPE' ] ) && $t_result[ 'ERROR_TYPE' ] === 'NON-PEAR-ERROR' ) || ( is_bool( $t_result ) && $t_result === FALSE ) );

if ( $t_is_custom_error || PEAR::isError( $t_result ) || $f_mailbox_action === 'complete_test' )
{
$t_no_redirect = TRUE;

ERP_page_begin( plugin_lang_get( 'plugin_title' ) );
ERP_page_begin( plugin_lang_get( 'plugin_title' ) );
?>
<br /><div class="center">
<?php
echo plugin_lang_get( ( ( $t_is_custom_error || PEAR::isError( $t_result ) ) ? 'test_failure' : 'test_success' ) ) . '<br /><br />';

echo plugin_lang_get( 'description' ) . ': ' . $t_mailbox_api->_mailbox[ 'description' ] . '<br />';
echo plugin_lang_get( 'mailbox_type' ) . ': ' . $t_mailbox_api->_mailbox[ 'mailbox_type' ] . '<br />';
echo plugin_lang_get( 'hostname' ) . ': ', $t_mailbox_api->_mailbox[ 'hostname' ] . '<br />';
echo plugin_lang_get( 'port' ) . ': ', $t_mailbox_api->_mailbox[ 'port' ] . '<br />';
echo plugin_lang_get( 'encryption' ) . ': ' . $t_mailbox_api->_mailbox[ 'encryption' ] . '<br />';
echo plugin_lang_get( 'ssl_cert_verify' ) . ': ' . $t_mailbox_api->_mailbox[ 'ssl_cert_verify' ] . '<br />';
echo plugin_lang_get( 'erp_username' ) . ': ' . $t_mailbox_api->_mailbox[ 'erp_username' ] . '<br />';
echo plugin_lang_get( 'erp_password' ) . ': ******' . '<br />';
echo plugin_lang_get( 'auth_method' ) . ': ' . $t_mailbox_api->_mailbox[ 'auth_method' ] . '<br />';

if ( $t_mailbox_api->_mailbox[ 'mailbox_type' ] === 'IMAP' )
{
echo plugin_lang_get( 'imap_basefolder' ) . ': ' . $t_mailbox_api->_mailbox[ 'imap_basefolder' ] . '<br />';
}

echo '<br />' . ( ( $t_is_custom_error ) ? nl2br( $t_result[ 'ERROR_MESSAGE' ] ) : ( ( PEAR::isError( $t_result ) ) ? 'Location: ' . $t_result->ERP_location . '<br />' . $t_result->toString() : NULL ) ) . '<br /><br />';

print_bracket_link( plugin_page( 'manage_mailbox', TRUE ), lang_get( 'proceed' ) );
echo plugin_lang_get( ( ( $t_is_custom_error || PEAR::isError( $t_result ) ) ? 'test_failure' : 'test_success' ) ) . '<br /><br />';

echo plugin_lang_get( 'description' ) . ': ' . $t_mailbox_api->_mailbox[ 'description' ] . '<br />';
echo plugin_lang_get( 'mailbox_type' ) . ': ' . $t_mailbox_api->_mailbox[ 'mailbox_type' ] . '<br />';
echo plugin_lang_get( 'hostname' ) . ': ', $t_mailbox_api->_mailbox[ 'hostname' ] . '<br />';
echo plugin_lang_get( 'port' ) . ': ', $t_mailbox_api->_mailbox[ 'port' ] . '<br />';
echo plugin_lang_get( 'encryption' ) . ': ' . $t_mailbox_api->_mailbox[ 'encryption' ] . '<br />';
echo plugin_lang_get( 'ssl_cert_verify' ) . ': ' . $t_mailbox_api->_mailbox[ 'ssl_cert_verify' ] . '<br />';
echo plugin_lang_get( 'erp_username' ) . ': ' . $t_mailbox_api->_mailbox[ 'erp_username' ] . '<br />';
echo plugin_lang_get( 'erp_password' ) . ': ******' . '<br />';
echo plugin_lang_get( 'auth_method' ) . ': ' . $t_mailbox_api->_mailbox[ 'auth_method' ] . '<br />';

if ( $t_mailbox_api->_mailbox[ 'mailbox_type' ] === 'IMAP' )
{
echo plugin_lang_get( 'imap_basefolder' ) . ': ' . $t_mailbox_api->_mailbox[ 'imap_basefolder' ] . '<br />';
}

echo '<br />' . ( ( $t_is_custom_error ) ? nl2br( $t_result[ 'ERROR_MESSAGE' ] ) : ( ( PEAR::isError( $t_result ) ) ? 'Location: ' . $t_result->ERP_location . '<br />' . $t_result->toString() : NULL ) ) . '<br /><br />';

print_bracket_link( plugin_page( 'manage_mailbox', TRUE ), lang_get( 'proceed' ) );
?>
</div>
<?php
ERP_page_end( __FILE__ );
}
ERP_page_end( __FILE__ );
}

if( plugin_config_get( 'mailboxes' ) !== $t_mailboxes && ( $f_mailbox_action === 'add' || $f_mailbox_action === 'copy' || ( ( $f_mailbox_action === 'edit' || $f_mailbox_action === 'delete' ) && $f_select_mailbox >= 0 ) ) )
Expand Down

0 comments on commit b685787

Please sign in to comment.