// // @(#) $Id: s.download_emails.php 1.4 03/04/15 14:50:39-00:00 jpm $ // include_once "../config.inc.php"; include_once APP_INC_PATH . "class.support.php"; include_once APP_INC_PATH . "class.lock.php"; include_once APP_INC_PATH . "class.project.php"; include_once APP_INC_PATH . "db_access.php"; ini_set("memory_limit", "256M"); // we need the IMAP extension for this to work if (!function_exists('imap_open')) { echo "Error: Eventum requires the IMAP extension in order to download messages saved on a IMAP/POP3 mailbox.\n"; echo "Please refer to the PHP manual for more details about how to enable the IMAP extension.\n"; exit; } $emails = Email_Account::getList(); foreach ($emails as $email) { $username = $email['ema_username']; $hostname = $email['ema_hostname']; $mailbox = $email['ema_folder']; // get the account ID since we need it for locking. $account_id = Email_Account::getAccountID($username, $hostname, $mailbox); if ($account_id == 0 && $fix_lock != true) { echo "Error: Could not find a email account with the parameter provided. Please verify your email account settings and try again.\n"; } // check if there is another instance of this script already running if (!Lock::acquire('download_emails_' . $account_id)) { if ($type == 'cli') { echo "Error: Another instance of the script is still running for the specified account ({$account_id}). " . "If this is not accurate, you may fix it by running this script with '--fix-lock' " . "as the 4th parameter or you may unlock ALL accounts by running this script with '--fix-lock' " . "as the only parameter.\n"; } else { echo "Error: Another instance of the script is still running for the specified account ({$account_id}). " . "If this is not accurate, you may fix it by running this script with 'fix-lock=1' " . "in the query string or you may unlock ALL accounts by running this script with 'fix-lock=1' " . "as the only parameter.<br />\n";
* * @copyright (c) Eventum Team * @license GNU General Public License, version 2 or later (GPL-2+) * * For the full copyright and license information, * please see the COPYING and AUTHORS files * that were distributed with this source code. */ require_once __DIR__ . '/../../init.php'; $tpl = new Template_Helper(); $tpl->setTemplate('manage/email_accounts.tpl.html'); Auth::checkAuthentication(); $tpl->assign('all_projects', Project::getAll()); $role_id = Auth::getCurrentRole(); if ($role_id < User::ROLE_REPORTER) { Misc::setMessage(ev_gettext('Sorry, you are not allowed to access this page.'), Misc::MSG_ERROR); $tpl->displayTemplate(); exit; } if (@$_POST['cat'] == 'new') { Misc::mapMessages(Email_Account::insert(), array(1 => array(ev_gettext('Thank you, the email account was added successfully.'), Misc::MSG_INFO), -1 => array(ev_gettext('An error occurred while trying to add the new account.'), Misc::MSG_ERROR))); } elseif (@$_POST['cat'] == 'update') { Misc::mapMessages(Email_Account::update(), array(1 => array(ev_gettext('Thank you, the email account was updated successfully.'), Misc::MSG_INFO), -1 => array(ev_gettext('An error occurred while trying to update the account information.'), Misc::MSG_ERROR))); } elseif (@$_POST['cat'] == 'delete') { Misc::mapMessages(Email_Account::remove(), array(1 => array(ev_gettext('Thank you, the email account was deleted successfully.'), Misc::MSG_INFO), -1 => array(ev_gettext('An error occurred while trying to delete the account information.'), Misc::MSG_ERROR))); } if (@$_GET['cat'] == 'edit') { $tpl->assign('info', Email_Account::getDetails($_GET['id'])); } $tpl->assign('list', Email_Account::getList()); $tpl->displayTemplate();
// include_once "../config.inc.php"; include_once APP_INC_PATH . "class.template.php"; include_once APP_INC_PATH . "class.auth.php"; include_once APP_INC_PATH . "class.user.php"; include_once APP_INC_PATH . "class.project.php"; include_once APP_INC_PATH . "class.support.php"; include_once APP_INC_PATH . "db_access.php"; $tpl = new Template_API(); $tpl->setTemplate("manage/index.tpl.html"); Auth::checkAuthentication(APP_COOKIE); $tpl->assign("type", "email_accounts"); $tpl->assign("all_projects", Project::getAll()); $role_id = Auth::getCurrentRole(); if ($role_id == User::getRoleID('administrator')) { $tpl->assign("show_setup_links", true); if (@$HTTP_POST_VARS["cat"] == "new") { $tpl->assign("result", Email_Account::insert()); } elseif (@$HTTP_POST_VARS["cat"] == "update") { $tpl->assign("result", Email_Account::update()); } elseif (@$HTTP_POST_VARS["cat"] == "delete") { Email_Account::remove(); } if (@$HTTP_GET_VARS["cat"] == "edit") { $tpl->assign("info", Email_Account::getDetails($HTTP_GET_VARS["id"])); } $tpl->assign("list", Email_Account::getList()); } else { $tpl->assign("show_not_allowed_msg", true); } $tpl->displayTemplate();