Ejemplo n.º 1
0
if (isset($_REQUEST['is_auto_import']) && $_REQUEST['is_auto_import'] == 'on') {
    if (empty($focus->groupfolder_id)) {
        $groupFolderId = $focus->createAutoImportSugarFolder();
        $focus->groupfolder_id = $groupFolderId;
    }
    $stored_options['isAutoImport'] = true;
} else {
    $focus->groupfolder_id = "";
    //If the user is turning the auto-import feature off then remove all previous subscriptions.
    if (!empty($focus->fetched_row['groupfolder_id'])) {
        $GLOBALS['log']->debug("Clearining all subscriptions to folder id: {$focus->fetched_row['groupfolder_id']}");
        $f = new SugarFolder();
        $f->clearSubscriptionsForFolder($focus->fetched_row['groupfolder_id']);
        //Now delete the old group folder.
        $f->retrieve($focus->fetched_row['groupfolder_id']);
        $f->delete();
    }
    $stored_options['isAutoImport'] = false;
}
if (!empty($focus->groupfolder_id)) {
    if ($_REQUEST['leaveMessagesOnMailServer'] == "1") {
        $stored_options['leaveMessagesOnMailServer'] = 1;
    } else {
        $stored_options['leaveMessagesOnMailServer'] = 0;
    }
}
$focus->stored_options = base64_encode(serialize($stored_options));
$GLOBALS['log']->info('----->InboundEmail now saving self');
////////////////////////////////////////////////////////////////////////////////
////    SEND US TO SAVE DESTINATION
////////////////////////////////////////////////////////////////////////////////