<?php /********************************************************************************* * The contents of this file are subject to the vtiger CRM Public License Version 1.0 * ("License"); You may not use this file except in compliance with the License * The Original Code is: vtiger CRM Open Source * The Initial Developer of the Original Code is vtiger. * Portions created by vtiger are Copyright (C) vtiger. * All Rights Reserved. * ********************************************************************************/ require_once 'modules/Settings/MailScanner/core/MailScannerInfo.php'; require_once 'Smarty_setup.php'; require_once 'vtlib/Vtiger/Cron.php'; global $app_strings, $mod_strings, $currentModule, $theme, $current_language; global $application_unique_key; // defined in config.inc.php $smarty = new vtigerCRM_Smarty(); $smarty->assign("MOD", return_module_language($current_language, 'Settings')); $smarty->assign("CMOD", $mod_strings); $smarty->assign("APP", $app_strings); $smarty->assign("THEME", $theme); $smarty->assign("IMAGE_PATH", "themes/{$theme}/images/"); $scanners = Vtiger_MailScannerInfo::listAll(); $smarty->assign("SCANNERS", $scanners); $smarty->assign("APP_KEY", $application_unique_key); $smarty->assign("CRON_TASK", Vtiger_Cron::getInstance('MailScanner')); $smarty->display('MailScanner/MailScannerInfo.tpl');
} $newscannerinfo = new Vtiger_MailScannerInfo(false, false); $newscannerinfo->scannername = $scannername; $newscannerinfo->server = $server; $newscannerinfo->protocol = vtlib_purify(trim($_REQUEST['mailboxinfo_protocol'])); $newscannerinfo->username = $username; $newscannerinfo->password = vtlib_purify(trim($_REQUEST['mailboxinfo_password'])); $newscannerinfo->ssltype = vtlib_purify(trim($_REQUEST['mailboxinfo_ssltype'])); $newscannerinfo->sslmethod = vtlib_purify(trim($_REQUEST['mailboxinfo_sslmethod'])); $newscannerinfo->searchfor = vtlib_purify(trim($_REQUEST['mailboxinfo_searchfor'])); $newscannerinfo->markas = vtlib_purify(trim($_REQUEST['mailboxinfo_markas'])); $newscannerinfo->isvalid = $_REQUEST['mailboxinfo_enable'] == 'true' ? true : false; // Rescan all folders on next run? $rescanfolder = $_REQUEST['mailboxinfo_rescan_folders'] == 'true' ? true : false; $isconnected = false; $scannerinfo = new Vtiger_MailScannerInfo(trim($_REQUEST['hidden_scannername'])); if (!$scannerinfo->compare($newscannerinfo)) { $mailbox = new Vtiger_MailBox($newscannerinfo); $isconnected = $mailbox->connect(); if ($isconnected) { $newscannerinfo->connecturl = $mailbox->_imapurl; } } else { $isconnected = true; $scannerinfo->isvalid = $newscannerinfo->isvalid; // Copy new value $newscannerinfo = $scannerinfo; } if (!$isconnected) { require_once 'Smarty_setup.php'; global $app_strings, $mod_strings, $currentModule, $theme, $current_language;
<?php /********************************************************************************* * The contents of this file are subject to the vtiger CRM Public License Version 1.0 * ("License"); You may not use this file except in compliance with the License * The Original Code is: vtiger CRM Open Source * The Initial Developer of the Original Code is vtiger. * Portions created by vtiger are Copyright (C) vtiger. * All Rights Reserved. * ********************************************************************************/ require_once 'modules/Settings/MailScanner/core/MailScannerInfo.php'; require_once 'modules/Settings/MailScanner/core/MailBox.php'; $scannerinfo = new Vtiger_MailScannerInfo(trim($_REQUEST['scannername'])); $scannerinfo->delete(); header('Location: index.php?module=Settings&action=MailScanner&parenttab=Settings');
<?php /********************************************************************************* * The contents of this file are subject to the vtiger CRM Public License Version 1.0 * ("License"); You may not use this file except in compliance with the License * The Original Code is: vtiger CRM Open Source * The Initial Developer of the Original Code is vtiger. * Portions created by vtiger are Copyright (C) vtiger. * All Rights Reserved. * ********************************************************************************/ require_once 'modules/Settings/MailScanner/core/MailScannerInfo.php'; require_once 'Smarty_setup.php'; global $app_strings, $mod_strings, $currentModule, $theme, $current_language; $scannername = vtlib_purify($_REQUEST['scannername']); $scannerinfo = new Vtiger_MailScannerInfo($scannername); $smarty = new vtigerCRM_Smarty(); $smarty->assign("MOD", return_module_language($current_language, 'Settings')); $smarty->assign("CMOD", $mod_strings); $smarty->assign("APP", $app_strings); $smarty->assign("THEME", $theme); $smarty->assign("IMAGE_PATH", "themes/{$theme}/images/"); $smarty->assign("SCANNERINFO", $scannerinfo->getAsMap()); $smarty->assign("SCANNERRULES", $scannerinfo->rules); $smarty->display('MailScanner/MailScannerRule.tpl');
<?php /********************************************************************************* * The contents of this file are subject to the vtiger CRM Public License Version 1.0 * ("License"); You may not use this file except in compliance with the License * The Original Code is: vtiger CRM Open Source * The Initial Developer of the Original Code is vtiger. * Portions created by vtiger are Copyright (C) vtiger. * All Rights Reserved. * ********************************************************************************/ require_once 'modules/Settings/MailScanner/core/MailScannerInfo.php'; require_once 'Smarty_setup.php'; global $app_strings, $mod_strings, $currentModule, $theme, $current_language; $smarty = new vtigerCRM_Smarty(); $smarty->assign("MOD", return_module_language($current_language, 'Settings')); $smarty->assign("CMOD", $mod_strings); $smarty->assign("APP", $app_strings); $smarty->assign("THEME", $theme); $smarty->assign("IMAGE_PATH", "themes/{$theme}/images/"); $scannername = vtlib_purify($_REQUEST['scannername']); $scannerinfo = new Vtiger_MailScannerInfo($scannername); $smarty->assign("SCANNERINFO", $scannerinfo->getAsMap()); $smarty->assign("FOLDERINFO", $scannerinfo->getFolderInfo()); $smarty->display('MailScanner/MailScannerFolder.tpl');
/** * Function to get Updated folders list * @return <Array> Folders List */ public function getUpdatedFoldersList() { vimport('~~modules/Settings/MailConverter/handlers/MailBox.php'); $scannerInfo = new Vtiger_MailScannerInfo($this->getName()); $mailBox = new Vtiger_MailBox($scannerInfo); if ($mailBox->connect()) { $folders = $mailBox->getFolders(); $scannerInfo->updateFolderInfo($folders); } return $scannerInfo->getFolderInfo(); }
public function updateFolders($scannerId, $folders) { include_once 'modules/Settings/MailConverter/handlers/MailScannerInfo.php'; $db = PearDatabase::getInstance(); $scannerName = Settings_MailConverter_Module_Model::getScannerName($scannerId); $scannerInfo = new Vtiger_MailScannerInfo($scannerName); $lastScan = $scannerInfo->dateBasedOnMailServerTimezone('d-M-Y'); $db->pquery("DELETE FROM vtiger_mailscanner_folders WHERE scannerid=?", array($scannerId)); foreach ($folders as $folder) { $db->pquery("INSERT INTO vtiger_mailscanner_folders VALUES(?,?,?,?,?,?)", array('', $scannerId, $folder, $lastScan, '0', '1')); } }
<?php /********************************************************************************* * The contents of this file are subject to the vtiger CRM Public License Version 1.0 * ("License"); You may not use this file except in compliance with the License * The Original Code is: vtiger CRM Open Source * The Initial Developer of the Original Code is vtiger. * Portions created by vtiger are Copyright (C) vtiger. * All Rights Reserved. * ********************************************************************************/ require_once 'modules/Settings/MailScanner/core/MailScannerInfo.php'; require_once 'Smarty_setup.php'; $scannername = vtlib_purify($_REQUEST['scannername']); $scannerinfo = new Vtiger_MailScannerInfo($scannername); $folderinfo = array(); foreach ($_REQUEST as $key => $value) { $matches = array(); if (preg_match("/folder_([0-9]+)/", vtlib_purify($key), $matches)) { $folderinfo[vtlib_purify($value)] = array('folderid' => $matches[1], 'enabled' => 1); } } $scannerinfo->enableFoldersForScan($folderinfo); include 'modules/Settings/MailScanner/MailScannerInfo.php';