Example #1
0
if (isset($_REQUEST['is_create_case']) && $_REQUEST['is_create_case'] == 'on') {
    $focus->mailbox_type = 'createcase';
} else {
    if (empty($focus->mailbox_type) || $focus->mailbox_type == 'createcase') {
        $focus->mailbox_type = 'pick';
    }
}
/////////////////////////////////////////////////////////
////	SERVICE STRING CONCATENATION
$useSsl = isset($_REQUEST['ssl']) && $_REQUEST['ssl'] == 1 ? true : false;
$optimum = $focus->getSessionConnectionString($focus->server_url, $focus->email_user, $focus->port, $focus->protocol);
if (empty($optimum)) {
    $optimum = $focus->findOptimumSettings($useSsl, $focus->email_user, $focus->email_password, $focus->server_url, $focus->port, $focus->protocol, $focus->mailbox);
}
// if
$delimiter = $focus->getSessionInboundDelimiterString($focus->server_url, $focus->email_user, $focus->port, $focus->protocol);
//added check to ensure the $optimum['serial']) is not empty.
if (is_array($optimum) && count($optimum) > 0 && !empty($optimum['serial'])) {
    $focus->service = $optimum['serial'];
} else {
    // no save
    // allowing bad save to allow Email Campaigns configuration to continue even without IMAP
    $focus->service = "::::::" . $focus->protocol . "::::";
    // save bogus info.
    $error = "&error=true";
}
////	END SERVICE STRING CONCAT
/////////////////////////////////////////////////////////
if (isset($_REQUEST['mark_read']) && $_REQUEST['mark_read'] == 1) {
    $focus->delete_seen = 0;
} else {
 public function testgetSessionInboundDelimiterString()
 {
     $inboundEmail = new InboundEmail();
     //test without setting session key
     $result = $inboundEmail->getSessionInboundDelimiterString('mail.google.com', 'test', 22, 'IMAP');
     $this->assertEquals('', $result);
     //test with session key set
     $_SESSION['mail.google.comtest22IMAPdelimiter'] = 'delimit string';
     $result = $inboundEmail->getSessionInboundDelimiterString('mail.google.com', 'test', 22, 'IMAP');
     $this->assertEquals('delimit string', $result);
 }