예제 #1
0
 */
/**********************************
	INITIALIZATION METHODS
 *********************************/
require '../../../bootstrap.php';
$pommo->init();
$logger =& $pommo->_logger;
$dbo =& $pommo->_dbo;
Pommo::requireOnce($pommo->_baseDir . 'inc/lib/phpmailer/class.phpmailer.php');
Pommo::requireOnce($pommo->_baseDir . 'inc/lib/phpmailer/class.smtp.php');
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
Pommo::requireOnce($pommo->_baseDir . 'inc/classes/template.php');
$smarty = new PommoTemplate();
$smarty->prepareForForm();
$smarty->assign('returnStr', Pommo::_T('Configure'));
// Read user requested changes
if (!empty($_POST['addSmtpServer'])) {
    $server = array('host' => 'mail.localhost', 'port' => '25', 'auth' => 'off', 'user' => '', 'pass' => '');
    $input['smtp_' . key($_POST['addSmtpServer'])] = serialize($server);
    PommoAPI::configUpdate($input, TRUE);
    $update = true;
} elseif (!empty($_POST['updateSmtpServer'])) {
    $key = key($_POST['updateSmtpServer']);
    $server = array('host' => $_POST['host'][$key], 'port' => $_POST['port'][$key], 'auth' => $_POST['auth'][$key], 'user' => $_POST['user'][$key], 'pass' => $_POST['pass'][$key]);
    $input['smtp_' . $key] = serialize($server);
    PommoAPI::configUpdate($input, TRUE);
    $update = true;
} elseif (!empty($_POST['deleteSmtpServer'])) {
    $input['smtp_' . key($_POST['deleteSmtpServer'])] = '';