コード例 #1
0
 *********************************/
require '../../bootstrap.php';
Pommo::requireOnce($pommo->_baseDir . 'inc/helpers/mailings.php');
$pommo->init();
$logger =& $pommo->_logger;
$dbo =& $pommo->_dbo;
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
Pommo::requireOnce($pommo->_baseDir . 'inc/classes/template.php');
$smarty = new PommoTemplate();
if (PommoMailing::isCurrent()) {
    Pommo::kill(sprintf(Pommo::_T('A Mailing is currently processing. Visit the %sStatus%s page to check its progress.'), '<a href="mailing_status.php">', '</a>'));
}
if ($pommo->_config['demo_mode'] == 'on') {
    $logger->addMsg(sprintf(Pommo::_T('%sDemonstration Mode%s is on -- no Emails will actually be sent. This is good for testing settings.'), '<a href="' . $pommo->_baseUrl . 'admin/setup/setup_configure.php#mailings">', '</a>'));
}
// WYSIWYG JavaScript Includes
Pommo::requireOnce($pommo->_baseDir . 'themes/wysiwyg/editors.php');
$editors = new PommoWYSIWYG();
$editor = $editors->loadEditor();
if (!$editor) {
    die('Could not find requested WYSIWYG editor (' . $editor . ') in editors.php');
}
$smarty->assign('wysiwygJS', $editor);
// translation assignments for dialg titles...
$smarty->assign('t_personalization', Pommo::_T('Personalization'));
$smarty->assign('t_testMailing', Pommo::_T('Test Mailing'));
$smarty->assign('t_saveTemplate', Pommo::_T('Save Template'));
$smarty->display('admin/mailings/mailings_start.tpl');
Pommo::kill();
コード例 #2
0
	INITIALIZATION METHODS
 *********************************/
require '../../../bootstrap.php';
$pommo->init();
$logger =& $pommo->_logger;
$dbo =& $pommo->_dbo;
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
Pommo::requireOnce($pommo->_baseDir . 'inc/classes/template.php');
$smarty = new PommoTemplate();
// Read user requested changes
if (!empty($_POST['throttle_restore'])) {
    $input = array('throttle_MPS' => 3, 'throttle_BPS' => 0, 'throttle_DP' => 10, 'throttle_DBPP' => 0, 'throttle_DMPP' => 0);
    PommoAPI::configUpdate($input, TRUE);
    $smarty->assign('output', Pommo::_T('Configuration Updated.'));
} elseif (!empty($_POST['throttle-submit'])) {
    $input = array();
    $input['throttle_MPS'] = is_numeric($_POST['mps']) && $_POST['mps'] >= 0 && $_POST['mps'] <= 5 ? $_POST['mps'] : 3;
    $input['throttle_BPS'] = is_numeric($_POST['bps']) && $_POST['bps'] >= 0 && $_POST['bps'] <= 400 ? $_POST['bps'] * 1024 : 0;
    $input['throttle_DP'] = is_numeric($_POST['dp']) && $_POST['dp'] >= 5 && $_POST['dp'] <= 20 ? $_POST['dp'] : 10;
    $input['throttle_DMPP'] = is_numeric($_POST['dmpp']) && $_POST['dmpp'] >= 0 && $_POST['dmpp'] <= 5 ? $_POST['dmpp'] : 0;
    $input['throttle_DBPP'] = is_numeric($_POST['dbpp']) && $_POST['dbpp'] >= 0 && $_POST['dbpp'] <= 200 ? $_POST['dbpp'] * 1024 : 0;
    if (!empty($input)) {
        PommoAPI::configUpdate($input, TRUE);
        $smarty->assign('output', Pommo::_T('Configuration Updated.'));
    } else {
        $smarty->assign('output', Pommo::_T('Please review and correct errors with your submission.'));
    }
}
$config = PommoAPI::configGet(array('throttle_MPS', 'throttle_BPS', 'throttle_DP', 'throttle_DBPP', 'throttle_DMPP'));
コード例 #3
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'])] = '';
    PommoAPI::configUpdate($input, TRUE);
コード例 #4
0
 * by the Free Software Foundation; either version 2, or any later version.
 * 
 * poMMo is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty
 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
 * the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with program; see the file docs/LICENSE. If not, write to the
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 */
/**********************************
	INITIALIZATION METHODS
 *********************************/
header('Content-Type: text/html; charset=UTF-8');
define('_poMMo_embed', TRUE);
require dirname(__FILE__) . '/bootstrap.php';
$pommo->init(array('authLevel' => 0, 'noSession' => TRUE));
$logger =& $pommo->_logger;
$dbo =& $pommo->_dbo;
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
Pommo::requireOnce($pommo->_baseDir . 'inc/classes/template.php');
$smarty = new PommoTemplate();
// subscription forms will be activated from this template
// Function
$smarty->prepareForSubscribeForm();
// assign referer since this is an embedded form
$smarty->assign('referer', htmlspecialchars($_SERVER['PHP_SELF']));
$smarty->display('subscribe/form.subscribe.tpl');
コード例 #5
0
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 */
/**********************************
	INITIALIZATION METHODS
 *********************************/
require '../../bootstrap.php';
Pommo::requireOnce($pommo->_baseDir . 'inc/helpers/mailings.php');
$config = PommoAPI::configGet('public_history');
if ($config['public_history'] == 'on') {
    $pommo->init(array('authLevel' => 0));
} else {
    Pommo::redirect('login.php');
}
$logger =& $pommo->_logger;
$dbo =& $pommo->_dbo;
if (isset($_REQUEST['mailings'])) {
    if (is_array($_REQUEST['mailings'])) {
        $_REQUEST['mailings'] = $_REQUEST['mailings'][0];
    }
    $mailing = current(PommoMailing::get(array('id' => $_REQUEST['mailings'])));
} else {
    die;
}
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
Pommo::requireOnce($pommo->_baseDir . 'inc/classes/template.php');
$smarty = new PommoTemplate();
$smarty->assign($mailing);
$smarty->display('inc/mailing.tpl');
Pommo::kill();
コード例 #6
0
ファイル: preview.php プロジェクト: BackupTheBerlios/oos-svn
$smarty = new PommoTemplate();
$smarty->prepareForForm();
if (PommoMailing::isCurrent()) {
    Pommo::kill(sprintf(Pommo::_T('A Mailing is currently processing. Visit the %sStatus%s page to check its progress.'), '<a href="mailing_status.php">', '</a>'));
}
// TODO -- fix stateInit so we don't NEED to supply the defaults that have already been defined
$dbvalues = PommoAPI::configGet(array('list_fromname', 'list_fromemail', 'list_frombounce', 'list_charset', 'list_wysiwyg'));
// Initialize page state with default values overriden by those held in $_REQUEST
$state =& PommoAPI::stateInit('mailing', array('fromname' => $dbvalues['list_fromname'], 'fromemail' => $dbvalues['list_fromemail'], 'frombounce' => $dbvalues['list_frombounce'], 'list_charset' => $dbvalues['list_charset'], 'wysiwyg' => $dbvalues['list_wysiwyg'], 'mailgroup' => 'all', 'subject' => '', 'body' => '', 'altbody' => ''), $_POST);
$state['charset'] = $state['list_charset'];
// validate composition
$tempbody = trim($state['body']);
$tempalt = trim($state['altbody']);
if (empty($tempbody) && empty($tempalt) || empty($state['subject'])) {
    $logger->addErr(Pommo::_T('Subject or Message cannot be empty!'));
    $smarty->assign($state);
    $smarty->display('admin/mailings/mailing/preview.tpl');
    Pommo::kill();
}
// get the group
$group = new PommoGroup($state['mailgroup'], 1);
$state['tally'] = $group->_tally;
$state['group'] = $group->_name;
// determine html status
$state['ishtml'] = empty($tempbody) ? 'off' : 'on';
// processs send request
if (!empty($_REQUEST['sendaway'])) {
    /**********************************
    		JSON OUTPUT INITIALIZATION
    	 *********************************/
    Pommo::requireOnce($pommo->_baseDir . 'inc/classes/json.php');
コード例 #7
0
ファイル: activate.php プロジェクト: BackupTheBerlios/oos-svn
Pommo::requireOnce($pommo->_baseDir . 'inc/classes/template.php');
$smarty = new PommoTemplate();
// make sure email/login is valid
$subscriber = current(PommoSubscriber::get(array('email' => empty($_REQUEST['email']) ? '0' : $_REQUEST['email'], 'status' => 1)));
if (empty($subscriber)) {
    Pommo::redirect('login.php');
}
// see if an anctivation email was sent to this subscriber in the last 2 minutes;
$query = "\n\tSELECT \n\t\t*\n\tFROM \n\t\t" . $dbo->table['scratch'] . "\n\tWHERE\n\t\t`type`=1\n\t\tAND `int`=%i\n\t\tAND `time` > (NOW() - INTERVAL 2 MINUTE)\n\tLIMIT 1";
$query = $dbo->prepare($query, array($subscriber['id']));
$test = $dbo->query($query, 0);
// attempt to send activation code if once has not recently been sent
if (empty($test)) {
    $code = PommoSubscriber::getActCode($subscriber);
    if (PommoHelperMessages::sendMessage(array('to' => $subscriber['email'], 'code' => $code, 'type' => 'activate'))) {
        $smarty->assign('sent', true);
        // timestamp this activation email
        $query = "\n\t\t\tINSERT INTO " . $dbo->table['scratch'] . "\n\t\t\tSET\n\t\t\t\t`type`=1,\n\t\t\t\t`int`=%i";
        $query = $dbo->prepare($query, array($subscriber['id']));
        $dbo->query($query);
        // remove ALL activation email timestamps older than 2 minutes
        $query = "\n\t\t\tDELETE FROM \n\t\t\t\t" . $dbo->table['scratch'] . "\n\t\t\tWHERE\n\t\t\t\t`type`=1\n\t\t\t\tAND `time` < (NOW() - INTERVAL 2 MINUTE)";
        $query = $dbo->prepare($query, array());
        $dbo->query($query);
    }
} else {
    $smarty->assign('sent', false);
}
$smarty->assign('email', $subscriber['email']);
$smarty->display('user/activate.tpl');
Pommo::kill();
コード例 #8
0
ファイル: compose.php プロジェクト: BackupTheBerlios/oos-svn
require '../../../bootstrap.php';
Pommo::requireOnce($pommo->_baseDir . 'inc/helpers/mailings.php');
$pommo->init();
$logger =& $pommo->_logger;
$dbo =& $pommo->_dbo;
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
Pommo::requireOnce($pommo->_baseDir . 'inc/classes/template.php');
$smarty = new PommoTemplate();
$smarty->prepareForForm();
if (PommoMailing::isCurrent()) {
    Pommo::kill(sprintf(Pommo::_T('A Mailing is currently processing. Visit the %sStatus%s page to check its progress.'), '<a href="mailing_status.php">', '</a>'));
}
// TODO -- fix stateInit so we don't NEED to supply the defaults that have already been defined
if (isset($_REQUEST['compose'])) {
    /**********************************
    		JSON OUTPUT INITIALIZATION
    	 *********************************/
    Pommo::requireOnce($pommo->_baseDir . 'inc/classes/json.php');
    $json = new PommoJSON();
    $json->success();
}
$dbvalues = PommoAPI::configGet(array('list_fromname', 'list_fromemail', 'list_frombounce', 'list_charset', 'list_wysiwyg'));
// Initialize page state with default values overriden by those held in $_REQUEST
$state =& PommoAPI::stateInit('mailing', array('fromname' => $dbvalues['list_fromname'], 'fromemail' => $dbvalues['list_fromemail'], 'frombounce' => $dbvalues['list_frombounce'], 'list_charset' => $dbvalues['list_charset'], 'wysiwyg' => $dbvalues['list_wysiwyg'], 'mailgroup' => 'all', 'subject' => '', 'body' => '', 'altbody' => ''), $_POST);
$smarty->assign($state);
// assign language (for wysiwyg)
$smarty->assign('lang', $pommo->_slanguage ? $pommo->_slanguage : $pommo->_language);
$smarty->display('admin/mailings/mailing/compose.tpl');
Pommo::kill();
コード例 #9
0
	SETUP TEMPLATE, PAGE
 *********************************/
Pommo::requireOnce($pommo->_baseDir . 'inc/classes/template.php');
$smarty = new PommoTemplate();
$emails =& $pommo->get('emails');
$dupes =& $pommo->get('dupes');
$fields =& PommoField::get();
$flag = FALSE;
foreach ($fields as $field) {
    if ($field['required'] == 'on') {
        $flag = TRUE;
    }
}
if (isset($_GET['continue'])) {
    foreach ($emails as $email) {
        $subscriber = array('email' => $email, 'registered' => time(), 'ip' => $_SERVER['REMOTE_ADDR'], 'status' => 1, 'data' => array());
        if ($flag) {
            $subscriber['flag'] = 9;
        }
        if (!PommoSubscriber::add($subscriber)) {
            die('Error importing subscriber');
        }
    }
    sleep(1);
    die(Pommo::_T('Complete!') . ' <a href="subscribers_import.php">' . Pommo::_T('Return to') . ' ' . Pommo::_T('Import') . '</a>');
}
$smarty->assign('flag', $flag);
$smarty->assign('tally', count($emails));
$smarty->assign('dupes', $dupes);
$smarty->display('admin/subscribers/import_txt.tpl');
Pommo::kill();
コード例 #10
0
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 */
/**********************************
	INITIALIZATION METHODS
*********************************/
require '../../bootstrap.php';
Pommo::requireOnce($pommo->_baseDir . 'inc/helpers/mailings.php');
$pommo->init();
$logger =& $pommo->_logger;
$dbo =& $pommo->_dbo;
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
Pommo::requireOnce($pommo->_baseDir . 'inc/classes/template.php');
$smarty = new PommoTemplate();
$smarty->assign('returnStr', Pommo::_T('Mailings Page'));
/** SET PAGE STATE
 * limit	- # of mailings per page
 * sort		- Sorting of Mailings [subject, mailgroup, subscriberCount, started, etc.]
 * order	- Order Type (ascending - ASC /descending - DESC)
 */
// Initialize page state with default values overriden by those held in $_REQUEST
$state =& PommoAPI::stateInit('mailings_history', array('limit' => 10, 'sort' => 'end', 'order' => 'desc', 'page' => 1), $_REQUEST);
/**********************************
	VALIDATION ROUTINES
*********************************/
if (!is_numeric($state['limit']) || $state['limit'] < 1 || $state['limit'] > 1000) {
    $state['limit'] = 10;
}
if ($state['order'] != 'asc' && $state['order'] != 'desc') {
    $state['order'] = 'asc';
コード例 #11
0
ファイル: process.php プロジェクト: BackupTheBerlios/oos-svn
Pommo::requireOnce($pommo->_baseDir . 'inc/helpers/validate.php');
Pommo::requireOnce($pommo->_baseDir . 'inc/helpers/subscribers.php');
$pommo->init(array('authLevel' => 0, 'noSession' => true));
$logger =& $pommo->_logger;
$dbo =& $pommo->_dbo;
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
Pommo::requireOnce($pommo->_baseDir . 'inc/classes/template.php');
$smarty = new PommoTemplate();
// attempt to detect if referer was set
//  TODO; enable HTTP_REFERER after stripping out ?input= tags. These will continually repeat
//$referer = (!empty($_POST['bmReferer'])) ? $_POST['bmReferer'] : $_SERVER['HTTP_REFERER'];
$referer = !empty($_POST['bmReferer']) ? $_POST['bmReferer'] : $pommo->_http . $pommo->_baseUrl . 'user/subscribe.php';
// append stored input
$smarty->assign('referer', $referer . '?input=' . urlencode(serialize($_POST)));
/**********************************
	VALIDATE INPUT
 *********************************/
if (empty($_POST['pommo_signup'])) {
    Pommo::redirect('login.php');
}
$subscriber = array('email' => $_POST['Email'], 'registered' => time(), 'ip' => $_SERVER['REMOTE_ADDR'], 'status' => 1, 'data' => @$_POST['d']);
// ** check for correct email syntax
if (!PommoHelper::isEmail($subscriber['email'])) {
    $logger->addErr(Pommo::_T('Invalid Email Address'));
}
// ** check if email already exists in DB ("duplicates are bad..")
if (PommoHelper::isDupe($subscriber['email'])) {
    $logger->addErr(Pommo::_T('Email address already exists. Duplicates are not allowed.'));
    $smarty->assign('dupe', TRUE);
コード例 #12
0
/**********************************
	INITIALIZATION METHODS
 *********************************/
require '../../bootstrap.php';
Pommo::requireOnce($pommo->_baseDir . 'inc/helpers/import.php');
Pommo::requireOnce($pommo->_baseDir . 'inc/helpers/subscribers.php');
Pommo::requireOnce($pommo->_baseDir . 'inc/helpers/fields.php');
$pommo->init(array('keep' => TRUE));
$logger =& $pommo->_logger;
$dbo =& $pommo->_dbo;
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
Pommo::requireOnce($pommo->_baseDir . 'inc/classes/template.php');
$smarty = new PommoTemplate();
$smarty->assign('returnStr', Pommo::_T('Import'));
$preview = $pommo->get('preview');
// find the most columns in a row
$cols = 0;
foreach ($preview as $row) {
    $c = count($row);
    if ($c > $cols) {
        $cols = $c;
    }
}
$smarty->assign('excludeUnsubscribed', isset($_REQUEST['excludeUnsubscribed']) ? true : false);
$smarty->assign('preview', $preview);
$smarty->assign('colNum', $cols);
$smarty->assign('fields', PommoField::get());
$smarty->display('admin/subscribers/import_csv.tpl');
Pommo::kill();
コード例 #13
0
 * poMMo is free software; you can redistribute it and/or modify 
 * it under the terms of the GNU General Public License as published 
 * by the Free Software Foundation; either version 2, or any later version.
 * 
 * poMMo is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty
 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
 * the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with program; see the file docs/LICENSE. If not, write to the
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 */
// Progress bar modified from the works of Juha Suni <*****@*****.**>
/**********************************
	INITIALIZATION METHODS
 *********************************/
require '../../bootstrap.php';
Pommo::requireOnce($pommo->_baseDir . 'inc/helpers/mailings.php');
$pommo->init();
$logger =& $pommo->_logger;
$dbo =& $pommo->_dbo;
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
Pommo::requireOnce($pommo->_baseDir . 'inc/classes/template.php');
$smarty = new PommoTemplate();
$mailing = current(PommoMailing::get(array('active' => TRUE)));
$smarty->assign('mailing', $mailing);
$smarty->display('admin/mailings/mailing_status.tpl');
Pommo::kill();
コード例 #14
0
 if ($_REQUEST['ruleType'] == 'field') {
     $field = current(PommoField::get(array('id' => $_REQUEST['fieldID'])));
     $logic = isset($_REQUEST['logic']) && $_REQUEST['logic'] != "0" ? $_REQUEST['logic'] : false;
     $type = $_REQUEST['type'] == 'or' ? 'or' : 'and';
     $values = array();
     // check to see if we're editing [logic is passed *only* when edit button is clicked]
     if ($logic) {
         foreach ($group['rules'] as $rule) {
             if ($rule['logic'] == $logic && $rule['field_id'] == $_REQUEST['fieldID']) {
                 $values[] = $field['type'] == 'date' ? PommoHelper::timeFromStr($rule['value']) : $rule['value'];
             }
         }
     }
     $firstVal = empty($values) ? false : array_shift($values);
     $logic = $logic ? PommoRules::getEnglish(array($logic)) : PommoRules::getEnglish(end(PommoRules::getLegal($group, array($field))));
     $smarty->assign('type', $type);
     $smarty->assign('field', $field);
     $smarty->assign('logic', $logic);
     $smarty->assign('values', $values);
     $smarty->assign('firstVal', $firstVal);
     $smarty->display('admin/subscribers/ajax/rule.field.tpl');
     Pommo::kill();
 } elseif ($_REQUEST['ruleType'] == 'group') {
     $match = PommoGroup::getNames($_REQUEST['fieldID']);
     $key = key($match);
     $smarty->assign('match_name', $match[$key]);
     $smarty->assign('match_id', $key);
     $smarty->display('admin/subscribers/ajax/rule.group.tpl');
     Pommo::kill();
 }
 break;
コード例 #15
0
$logger =& $pommo->_logger;
$dbo =& $pommo->_dbo;
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
Pommo::requireOnce($pommo->_baseDir . 'inc/classes/template.php');
$smarty = new PommoTemplate();
$smarty->prepareForForm();
/**********************************
	JSON OUTPUT INITIALIZATION
 *********************************/
Pommo::requireOnce($pommo->_baseDir . 'inc/classes/json.php');
$json = new PommoJSON();
$success = false;
if (isset($_POST['skip']) || isset($_POST['template']) && !is_numeric($_POST['template'])) {
    $success = true;
} elseif (isset($_POST['load'])) {
    $template = current(PommoMailingTemplate::get(array('id' => $_POST['template'])));
    $pommo->_session['state']['mailing']['body'] = $template['body'];
    $pommo->_session['state']['mailing']['altbody'] = $template['altbody'];
    $success = true;
} elseif (isset($_POST['delete'])) {
    $msg = PommoMailingTemplate::delete($_POST['template']) ? Pommo::_T('Template Deleted') : Pommo::_T('Error with deletion.');
    $json->add('callbackFunction', 'deleteTemplate');
    $json->add('callbackParams', array('id' => $_POST['template'], 'msg' => $msg));
} else {
    $smarty->assign('templates', PommoMailingTemplate::getNames());
    $smarty->display('admin/mailings/mailing/templates.tpl');
    Pommo::kill();
}
$json->serve($success);
コード例 #16
0
ファイル: index.php プロジェクト: BackupTheBerlios/oos-svn
            Pommo::requireOnce($pommo->_baseDir . 'inc/helpers/maintenance.php');
            PommoHelperMaintenance::perform();
        }
        $pommo->_auth->login($_POST['username']);
        Pommo::redirect($pommo->_http . $_POST['referer']);
    } else {
        $logger->addMsg(Pommo::_T('Failed login attempt. Try again.'));
    }
} elseif (!empty($_POST['resetPassword'])) {
    // TODO -- visit this function later
    // Check if a reset password request has been received
    // check that captcha matched
    if (!isset($_POST['captcha'])) {
        // generate captcha
        $captcha = substr(md5(rand()), 0, 4);
        $smarty->assign('captcha', $captcha);
    } elseif ($_POST['captcha'] == $_POST['realdeal']) {
        // user inputted captcha matched. Reset password
        Pommo::requireOnce($pommo->_baseDir . 'inc/helpers/pending.php');
        Pommo::requireOnce($pommo->_baseDir . 'inc/helpers/messages.php');
        // see if there is already a pending request for the administrator [subscriber id == 0]
        if (PommoPending::isPending(0)) {
            $input = urlencode(serialize(array('adminID' => TRUE, 'Email' => $pommo->_config['admin_email'])));
            Pommo::redirect($pommo->_http . $pommo->_baseUrl . 'user/pending.php?input=' . $input);
        }
        // create a password change request, send confirmation mail
        $subscriber = array('id' => 0);
        $code = PommoPending::add($subscriber, 'password');
        PommoHelperMessages::sendMessage(array('to' => $pommo->_config['admin_email'], 'code' => $code, 'type' => 'password'));
        $smarty->assign('captcha', FALSE);
    } else {
コード例 #17
0
	INITIALIZATION METHODS
*********************************/
require '../../bootstrap.php';
Pommo::requireOnce($pommo->_baseDir . 'inc/classes/sql.gen.php');
Pommo::requireOnce($pommo->_baseDir . 'inc/helpers/groups.php');
Pommo::requireOnce($pommo->_baseDir . 'inc/helpers/fields.php');
Pommo::requireOnce($pommo->_baseDir . 'inc/helpers/rules.php');
$pommo->init();
$logger =& $pommo->_logger;
$dbo =& $pommo->_dbo;
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
Pommo::requireOnce($pommo->_baseDir . 'inc/classes/template.php');
$smarty = new PommoTemplate();
$smarty->assign('returnStr', Pommo::_T('Groups Page'));
// Initialize page state with default values overriden by those held in $_REQUEST
$state =& PommoAPI::stateInit('groups_edit', array('group' => 0), $_REQUEST);
$groups =& PommoGroup::get();
$fields =& PommoField::get();
$group =& $groups[$state['group']];
if (empty($group)) {
    Pommo::redirect('subscribers_groups.php');
}
$rules = PommoSQL::sortRules($group['rules']);
$rules['and'] = PommoSQL::sortLogic($rules['and']);
$rules['or'] = PommoSQL::sortLogic($rules['or']);
foreach ($rules as $key => $a) {
    if ($key == 'include' || $key == 'exclude') {
        foreach ($a as $k => $gid) {
            $rules[$key][$k] = $groups[$gid]['name'];
コード例 #18
0
ファイル: mailings.php プロジェクト: shakatakshak/poMMo-v5-FR
Pommo::requireOnce($pommo->_baseDir . 'inc/helpers/mailings.php');
Pommo::requireOnce($pommo->_baseDir . 'inc/helpers/subscribers.php');
$config = PommoAPI::configGet('public_history');
if ($config['public_history'] == 'on') {
    $pommo->init(array('authLevel' => 0));
} else {
    Pommo::redirect('login.php');
}
$logger =& $pommo->_logger;
$dbo =& $pommo->_dbo;
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
Pommo::requireOnce($pommo->_baseDir . 'inc/classes/template.php');
$smarty = new PommoTemplate();
$smarty->assign('title', $pommo->_config['site_name'] . ' - ' . Pommo::_T('Mailing History'));
/** SET PAGE STATE
 * limit	- # of mailings per page
 * sort		- Sorting of Mailings [subject, started]
 * order	- Order Type (ascending - ASC /descending - DESC)
 */
// Initialize page state with default values overriden by those held in $_REQUEST
$state =& PommoAPI::stateInit('mailings_history', array('limit' => 100, 'sort' => 'finished', 'order' => 'asc', 'page' => 1), $_REQUEST);
// if mail_id is passed, display the mailing.
if (isset($_GET['mail_id']) && is_numeric($_GET['mail_id'])) {
    $input = current(PommoMailing::get(array('id' => $_GET['mail_id'])));
    // attempt personalizations of body/subject
    if (isset($_GET['email']) && isset($_GET['code'])) {
        $subscriber = current(PommoSubscriber::get(array('email' => $_GET['email'], 'status' => 1)));
        if ($_GET['code'] == PommoSubscriber::getActCode($subscriber)) {
            Pommo::requireOnce($pommo->_baseDir . 'inc/helpers/personalize.php');
コード例 #19
0
ファイル: login.php プロジェクト: BackupTheBerlios/oos-svn
/**********************************
	INITIALIZATION METHODS
*********************************/
require '../bootstrap.php';
Pommo::requireOnce($pommo->_baseDir . 'inc/helpers/pending.php');
$pommo->init(array('authLevel' => 0, 'noSession' => true));
$logger =& $pommo->_logger;
$dbo =& $pommo->_dbo;
session_start();
// required by smartyValidate. TODO -> move to prepareForForm() ??
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
Pommo::requireOnce($pommo->_baseDir . 'inc/classes/template.php');
$smarty = new PommoTemplate();
$smarty->assign('title', $pommo->_config['site_name'] . ' - ' . Pommo::_T('subscriber logon'));
$smarty->prepareForForm();
if (!SmartyValidate::is_registered_form() || empty($_POST)) {
    // ___ USER HAS NOT SENT FORM ___
    SmartyValidate::connect($smarty, true);
    SmartyValidate::register_validator('email', 'Email', 'isEmail', false, false, 'trim');
    $formError = array();
    $formError['email'] = Pommo::_T('Invalid email address');
    $smarty->assign('formError', $formError);
    // Assign email to form if pre-provided
    if (isset($_REQUEST['Email'])) {
        $smarty->assign('Email', $_REQUEST['Email']);
    } elseif (isset($_REQUEST['email'])) {
        $smarty->assign('Email', $_REQUEST['email']);
    }
} else {
コード例 #20
0
	INITIALIZATION METHODS
*********************************/
require '../../bootstrap.php';
Pommo::requireOnce($pommo->_baseDir . 'inc/helpers/import.php');
$pommo->init();
$logger =& $pommo->_logger;
$dbo =& $pommo->_dbo;
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
Pommo::requireOnce($pommo->_baseDir . 'inc/classes/template.php');
$smarty = new PommoTemplate();
//Pommo::kill('Importing and Exporting is temporarily disabled until PR15');
// Maximum File Size (in MB)
$max_file_size = 2;
$smarty->assign('maxSize', $max_file_size * 1024 * 1024);
// Filename (in $_FILES array)
$fname = "csvfile";
if (isset($_POST['submit'])) {
    // POST exists -- set pointer to content
    $fp = false;
    $box = false;
    if (!empty($_FILES[$fname]['tmp_name'])) {
        $fp =& fopen($_FILES[$fname]['tmp_name'], "r");
    } elseif (!empty($_POST['box'])) {
        $str =& $_POST['box'];
        // wrap $c as a file stream -- requires PHP 4.3.2
        //  for early versions investigate using tmpfile() -- efficient?
        stream_wrapper_register("pommoCSV", "PommoCSVStream") or Pommo::kill('Failed to register pommoCSV');
        $fp = fopen("pommoCSV://str", "r+");
        $box = true;
コード例 #21
0
Pommo::requireOnce($pommo->_baseDir . 'inc/helpers/fields.php');
$pommo->init();
$logger =& $pommo->_logger;
$dbo =& $pommo->_dbo;
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
Pommo::requireOnce($pommo->_baseDir . 'inc/classes/template.php');
$smarty = new PommoTemplate();
$smarty->prepareForForm();
// add field if requested, redirect to its edit page on success
if (!empty($_POST['field_name'])) {
    $field = PommoField::make(array('name' => $_POST['field_name'], 'type' => $_POST['field_type'], 'prompt' => 'Field Prompt', 'required' => 'off', 'active' => 'off'));
    $id = PommoField::add($field);
    if ($id) {
        $smarty->assign('added', $id);
    } else {
        $logger->addMsg(Pommo::_T('Error with addition.'));
    }
}
// check for a deletion request
if (!empty($_GET['delete'])) {
    $field = PommoField::get(array('id' => $_GET['field_id']));
    $field =& current($field);
    if (count($field) === 0) {
        $logger->addMsg(Pommo::_T('Error with deletion.'));
    } else {
        $affected = PommoField::subscribersAffected($field['id']);
        if (count($affected) > 0 && empty($_GET['dVal-force'])) {
            $smarty->assign('confirm', array('title' => Pommo::_T('Confirm Action'), 'nourl' => $_SERVER['PHP_SELF'] . '?field_id=' . $_GET['field_id'], 'yesurl' => $_SERVER['PHP_SELF'] . '?field_id=' . $_GET['field_id'] . '&delete=TRUE&dVal-force=TRUE', 'msg' => sprintf(Pommo::_T('Currently, %1$s subscribers have a non empty value for %2$s. All Subscriber data relating to this field will be lost.'), '<b>' . count($affected) . '</b>', '<b>' . $field['name'] . '</b>')));
            $smarty->display('admin/confirm.tpl');
コード例 #22
0
 * This file is part of poMMo (http://www.pommo.org)
 * 
 * poMMo is free software; you can redistribute it and/or modify 
 * it under the terms of the GNU General Public License as published 
 * by the Free Software Foundation; either version 2, or any later version.
 * 
 * poMMo is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty
 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
 * the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with program; see the file docs/LICENSE. If not, write to the
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 */
/**********************************
	INITIALIZATION METHODS
 *********************************/
require '../../../bootstrap.php';
$pommo->init();
$logger =& $pommo->_logger;
$dbo =& $pommo->_dbo;
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
Pommo::requireOnce($pommo->_baseDir . 'inc/classes/template.php');
$smarty = new PommoTemplate();
@($status = is_numeric($_REQUEST['status']) ? $_REQUEST['status'] : 1);
$smarty->assign('status', $status);
$smarty->display('admin/subscribers/ajax/subscriber_del.tpl');
Pommo::kill();
コード例 #23
0
ファイル: pending.php プロジェクト: BackupTheBerlios/oos-svn
        $msg = Pommo::_T('subscription request');
        $pending['type'] = 'confirm';
        // normalize for PommoHelperMessages::sendMessage
        break;
    case "change":
        $msg = Pommo::_T('record update request');
        $pending['type'] = 'update';
        // normalize for PommoHelperMessages::sendMessage
        break;
    case "password":
        $msg = Pommo::_T('password change request');
        break;
    default:
        Pommo::redirect('login.php?badPendingType=TRUE');
}
// check if user wants to reconfirm or cancel their request
if (!empty($_POST)) {
    if (isset($_POST['reconfirm'])) {
        Pommo::requireOnce($pommo->_baseDir . 'inc/helpers/messages.php');
        PommoHelperMessages::sendMessage(array('to' => $input['Email'], 'code' => $pending['code'], 'type' => $pending['type']));
    } elseif (isset($_POST['cancel'])) {
        if (PommoPending::cancel($pending)) {
            $logger->addMsg(sprintf(Pommo::_T('Your %s has been cancelled.'), $msg));
        }
    }
    $smarty->assign('nodisplay', TRUE);
} else {
    $logger->addMsg(sprintf(Pommo::_T('Your %s is still pending. To complete this request, please review the confirmation email sent to %s.'), $msg, $input['Email']));
}
$smarty->display('user/pending.tpl');
Pommo::kill();
コード例 #24
0
ファイル: admin.php プロジェクト: BackupTheBerlios/oos-svn
 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
 * the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with program; see the file docs/LICENSE. If not, write to the
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 */
/**********************************
	INITIALIZATION METHODS
 *********************************/
$lang = false;
if (isset($_POST['lang'])) {
    define('_poMMo_lang', $_POST['lang']);
    $lang = true;
}
require '../bootstrap.php';
$pommo->init();
$logger =& $pommo->_logger;
$dbo =& $pommo->_dbo;
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
Pommo::requireOnce($pommo->_baseDir . 'inc/classes/template.php');
$smarty = new PommoTemplate();
$smarty->assign('header', array('main' => 'poMMo ' . $pommo->_config['version'], 'sub' => sprintf(Pommo::_T('Powerful mailing list software for %s'), $pommo->_config['list_name'])));
if ($lang) {
    $logger->addErr(Pommo::_T('You have changed the language for this session. To make this the default language, you must update your config.php file.'));
}
$smarty->assign('lang', $pommo->_slanguage ? $pommo->_slanguage : $pommo->_language);
$smarty->display('admin/admin.tpl');
Pommo::kill();
コード例 #25
0
 * This file is part of poMMo (http://www.pommo.org)
 * 
 * poMMo is free software; you can redistribute it and/or modify 
 * it under the terms of the GNU General Public License as published 
 * by the Free Software Foundation; either version 2, or any later version.
 * 
 * poMMo is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty
 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
 * the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with program; see the file docs/LICENSE. If not, write to the
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 */
/**********************************
	INITIALIZATION METHODS
 *********************************/
require '../../../bootstrap.php';
Pommo::requireOnce($pommo->_baseDir . 'inc/helpers/fields.php');
$pommo->init();
$logger =& $pommo->_logger;
$dbo =& $pommo->_dbo;
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
Pommo::requireOnce($pommo->_baseDir . 'inc/classes/template.php');
$smarty = new PommoTemplate();
$smarty->assign('fields', PommoField::get());
$smarty->display('admin/subscribers/ajax/subscriber_edit.tpl');
Pommo::kill();
コード例 #26
0
        $mailing = current(PommoMailing::get(array('id' => $_REQUEST['mailings'])));
        // change group name to ID
        $groups = PommoGroup::getNames();
        $gid = 'all';
        foreach ($groups as $group) {
            if ($group['name'] == $mailing['group']) {
                $gid = $group['id'];
            }
        }
        PommoAPI::stateReset(array('mailing'));
        // if this is a plain text mailing, switch body + altbody.
        if ($mailing['ishtml'] == 'off') {
            $mailing['altbody'] = $mailing['body'];
            $mailing['body'] = null;
        }
        // Initialize page state with default values overriden by those held in $_REQUEST
        $state =& PommoAPI::stateInit('mailing', array('fromname' => $mailing['fromname'], 'fromemail' => $mailing['fromemail'], 'frombounce' => $mailing['frombounce'], 'list_charset' => $mailing['charset'], 'mailgroup' => $gid, 'subject' => $mailing['subject'], 'body' => $mailing['body'], 'altbody' => $mailing['altbody']));
        Pommo::redirect($pommo->_baseUrl . 'admin/mailings/mailings_start.php');
        break;
    case 'delete':
        $deleted = PommoMailing::delete($mailingIDS);
        $logger->addMsg(Pommo::_T('Please Wait') . '...');
        $params = $json->encode(array('ids' => $mailingIDS));
        $smarty->assign('callbackFunction', 'deleteMailing');
        $smarty->assign('callbackParams', $params);
        break;
    default:
        $logger->AddErr('invalid call');
        break;
}
$smarty->display('admin/rpc.tpl');
コード例 #27
0
ファイル: install.php プロジェクト: BackupTheBerlios/oos-svn
$pommo->init(array('authLevel' => 0, 'install' => TRUE));
session_start();
// required by smartyValidate. TODO -> move to prepareForForm() ??
$logger =& $pommo->_logger;
$dbo =& $pommo->_dbo;
$dbo->dieOnQuery(FALSE);
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
Pommo::requireOnce($pommo->_baseDir . 'inc/classes/template.php');
$smarty = new PommoTemplate();
$smarty->prepareForForm();
// Check to make sure poMMo is not already installed.
if (PommoInstall::verify()) {
    $logger->addErr(Pommo::_T('poMMo is already installed.'));
    $smarty->assign('installed', TRUE);
    $smarty->display('install.tpl');
    Pommo::kill();
}
if (isset($_REQUEST['disableDebug'])) {
    unset($_REQUEST['debugInstall']);
} elseif (isset($_REQUEST['debugInstall'])) {
    $smarty->assign('debug', TRUE);
}
if (!SmartyValidate::is_registered_form() || empty($_POST)) {
    // ___ USER HAS NOT SENT FORM ___
    SmartyValidate::connect($smarty, true);
    SmartyValidate::register_validator('list_name', 'list_name', 'notEmpty', false, false, 'trim');
    SmartyValidate::register_validator('site_name', 'site_name', 'notEmpty', false, false, 'trim');
    SmartyValidate::register_validator('site_url', 'site_url', 'isURL');
    SmartyValidate::register_validator('admin_password', 'admin_password', 'notEmpty', false, false, 'trim');
コード例 #28
0
ファイル: pommo.php プロジェクト: shakatakshak/poMMo-v5-FR
 function kill($msg = NULL, $backtrace = FALSE)
 {
     global $pommo;
     // output passed message
     if ($msg || !ob_get_length()) {
         if (empty($pommo->_workDir)) {
             echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">';
             echo '<title>poMMo - Erreur</title>';
             // Very basics added for valid output
             echo '<div><img src="' . $pommo->_baseUrl . 'themes/shared/images/icons/alert.png" alt="alert icon" style="vertical-align: middle; margin-right: 20px;"/> ' . $msg . '</div>';
         } else {
             $logger =& $pommo->_logger;
             $logger->addErr($msg);
             Pommo::requireOnce($pommo->_baseDir . 'inc/classes/template.php');
             $smarty = new PommoTemplate();
             $smarty->assign('fatalMsg', TRUE);
             $smarty->display('message.tpl');
         }
     }
     // output debugging info if enabled (in config.php)
     if ($pommo->_debug) {
         if (is_object($pommo)) {
             Pommo::requireOnce($pommo->_baseDir . 'inc/helpers/debug.php');
             $debug = new PommoHelperDebug();
             $debug->bmDebug();
         }
     }
     if ($backtrace) {
         $backtrace = debug_backtrace();
         echo @'<h2>BACKTRACE</h2>' . '<p>' . @str_ireplace($pommo->_baseDir, '', $backtrace[1]['file']) . ':' . $backtrace[1]['line'] . ' ' . $backtrace[1]['function'] . '()</p>' . '<p>' . @str_ireplace($pommo->_baseDir, '', $backtrace[2]['file']) . ' ' . $backtrace[2]['function'] . '()</p>' . '<p>' . @str_ireplace($pommo->_baseDir, '', $backtrace[3]['file']) . ' ' . $backtrace[3]['function'] . '()</p>';
     }
     // print and clear output buffer
     ob_end_flush();
     // kill script
     die;
 }
コード例 #29
0
 */
/**********************************
	INITIALIZATION METHODS
 *********************************/
require '../../bootstrap.php';
Pommo::requireOnce($pommo->_baseDir . 'inc/helpers/groups.php');
Pommo::requireOnce($pommo->_baseDir . 'inc/helpers/fields.php');
$pommo->init();
$logger =& $pommo->_logger;
$dbo =& $pommo->_dbo;
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
Pommo::requireOnce($pommo->_baseDir . 'inc/classes/template.php');
$smarty = new PommoTemplate();
$smarty->assign('returnStr', Pommo::_T('Subscribers Page'));
/** SET PAGE STATE
 * limit	- The Maximum # of subscribers to show per page
 * sort		- The subscriber field to sort by (email, ip, time_registered, time_touched, status, or field_id)
 * order	- Order Type (ascending - ASC /descending - DESC)
 * info		- (hide/show) Time Registered/Updated, IP address
 * 
 * status	- Filter by subscriber status (active, inactive, pending, all)
 * group	- Filter by group members (groupID or 'all')
 */
// Initialize page state with default values overriden by those held in $_REQUEST
$state =& PommoAPI::stateInit('subscribers_manage', array('limit' => 150, 'sort' => $pommo->_default_subscriber_sort, 'order' => 'asc', 'status' => 1, 'group' => 'all', 'page' => 1, 'search' => false), $_REQUEST);
/**********************************
	VALIDATION ROUTINES
*********************************/
if (!is_numeric($state['limit']) || $state['limit'] < 1 || $state['limit'] > 1000) {
コード例 #30
0
 * 
 * poMMo is free software; you can redistribute it and/or modify 
 * it under the terms of the GNU General Public License as published 
 * by the Free Software Foundation; either version 2, or any later version.
 * 
 * poMMo is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty
 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
 * the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with program; see the file docs/LICENSE. If not, write to the
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 */
/**********************************
	INITIALIZATION METHODS
 *********************************/
require '../../../bootstrap.php';
Pommo::requireOnce($pommo->_baseDir . 'inc/helpers/templates.php');
Pommo::requireOnce($pommo->_baseDir . 'inc/helpers/fields.php');
$pommo->init();
$logger =& $pommo->_logger;
$dbo =& $pommo->_dbo;
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
Pommo::requireOnce($pommo->_baseDir . 'inc/classes/template.php');
$smarty = new PommoTemplate();
$smarty->assign('fields', PommoField::get(array('byName' => true)));
$smarty->display('admin/mailings/mailing/ajax.personalize.tpl');
Pommo::kill();