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) { $state['limit'] = 150; } if ($state['order'] != 'asc' && $state['order'] != 'desc') { $state['order'] = 'asc'; } if (!is_numeric($state['sort']) && $state['sort'] != 'email' && $state['sort'] != 'ip' && $state['sort'] != 'time_registered' && $state['sort'] != 'time_touched') { $state['sort'] = 'email'; } if (!is_numeric($state['status'])) { $state['status'] = 1; }
$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 $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
* 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. */ require '../../../bootstrap.php'; Pommo::requireOnce($pommo->_baseDir . 'inc/helpers/subscribers.php'); Pommo::requireOnce($pommo->_baseDir . 'inc/helpers/fields.php'); Pommo::requireOnce($pommo->_baseDir . 'inc/helpers/groups.php'); $pommo->init(); $logger =& $pommo->_logger; $dbo =& $pommo->_dbo; $pommo->toggleEscaping(TRUE); $state =& PommoAPI::stateInit('subscribers_manage'); $fields = PommoField::get(); $ids = FALSE; if (!empty($_POST['ids'])) { $ids = explode(',', $_POST['ids']); } // ====== CSV EXPORT ====== if ($_POST['type'] == 'csv') { if (!$ids) { $group = new PommoGroup($state['group'], $state['status']); $subscribers = $group->members(); } else { $subscribers = PommoSubscriber::get(array('id' => $ids)); } // supply headers $o = '"' . Pommo::_T('Email') . '"';
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']; } }
*/ /********************************** 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; // Remember the Page State $state =& PommoAPI::stateInit('mailings_history'); /********************************** JSON OUTPUT INITIALIZATION *********************************/ Pommo::requireOnce($pommo->_baseDir . 'inc/classes/json.php'); $json = new PommoJSON(); /********************************** PAGINATION AND ORDERING *********************************/ // Get and Remember the requested page if (!empty($_REQUEST['page']) && (is_numeric($_REQUEST['page']) && $_REQUEST['page'] <= $state['pages'])) { $state['page'] = $_REQUEST['page']; } // Get and Remember the sort column if (!empty($_REQUEST['sidx']) && ($_REQUEST['sidx'] == 'start' || $_REQUEST['sidx'] == 'subject')) { $state['sort'] = $_REQUEST['sidx'];
$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');
} $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'); // require once here so that mailer can use Pommo::requireOnce($pommo->_baseDir . 'inc/helpers/personalizetitle.php'); // title personalization $matches1 = array(); preg_match('/\\[\\[[^\\]]+]]/', $input['body'], $matches1); if (!empty($matches1)) { $pBody = PommoHelperPersonalize::search($input['body']);
INITIALIZATION METHODS *********************************/ require '../../../bootstrap.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; /********************************** JSON OUTPUT INITIALIZATION *********************************/ Pommo::requireOnce($pommo->_baseDir . 'inc/classes/json.php'); $json = new PommoJSON(); // Remember the Page State $state =& PommoAPI::stateInit('groups_edit'); // EXAMINE CALL switch ($_REQUEST['call']) { case 'displayRule': /********************************** SETUP TEMPLATE, PAGE *********************************/ Pommo::requireOnce($pommo->_baseDir . 'inc/classes/template.php'); $smarty = new PommoTemplate(); $group = current(PommoGroup::get(array('id' => $state['group']))); if (empty($group)) { die('invalid input'); } if ($_REQUEST['ruleType'] == 'field') { $field = current(PommoField::get(array('id' => $_REQUEST['fieldID']))); $logic = isset($_REQUEST['logic']) && $_REQUEST['logic'] != "0" ? $_REQUEST['logic'] : false;