assign() публичный Метод

* assign Saves value so it is available to the view
public assign ( $name, $value = null )
Пример #1
0
require 'bootstrap.php';
require_once Pommo::$_baseDir . 'classes/Pommo_Fields.php';
Pommo::init();
$logger = Pommo::$_logger;
$dbo = Pommo::$_dbo;
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
require_once Pommo::$_baseDir . 'classes/Pommo_Template.php';
$view = new Pommo_Template();
// add field if requested, redirect to its edit page on success
if (!empty($_POST['field_name'])) {
    $field = Pommo_Fields::make(array('name' => $_POST['field_name'], 'type' => $_POST['field_type'], 'prompt' => 'Field Prompt', 'required' => 'off', 'active' => 'off'));
    $id = Pommo_Fields::add($field);
    if ($id) {
        $view->assign('added', $id);
    } else {
        $logger->addMsg(Pommo::_T('Error with addition.'));
    }
}
// check for a deletion request
if (!empty($_GET['delete'])) {
    $field = Pommo_Fields::get(array('id' => $_GET['field_id']));
    $field =& current($field);
    if (count($field) === 0) {
        $logger->addMsg(Pommo::_T('Error with deletion.'));
    } else {
        $affected = Pommo_Fields::subscribersAffected($field['id']);
        if (count($affected) > 0 && empty($_GET['dVal-force'])) {
            $view->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>')));
            $view->display('admin/confirm');
Пример #2
0
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) 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 Pommo.  If not, see <http://www.gnu.org/licenses/>.
 * 
 *  This fork is from https://github.com/soonick/poMMo
 *  Please see docs/contribs for Contributors
 *
 */
/**********************************
	INITIALIZATION METHODS
 *********************************/
require '../bootstrap.php';
Pommo::init();
$logger = Pommo::$_logger;
$dbo = Pommo::$_dbo;
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
require_once Pommo::$_baseDir . 'classes/Pommo_Template.php';
$view = new Pommo_Template();
@($status = is_numeric($_REQUEST['status']) ? $_REQUEST['status'] : 1);
$view->assign('status', $status);
$view->display('admin/subscribers/ajax/subscriber_del');
Пример #3
0
        $mailing = current(Pommo_Mailing::get(array('id' => $_REQUEST['mailings'])));
        // change group name to ID
        $groups = Pommo_Groups::getNames();
        $gid = 'all';
        foreach ($groups as $group) {
            if ($group['name'] == $mailing['group']) {
                $gid = $group['id'];
            }
        }
        Pommo_Api::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 =& Pommo_Api::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 . 'mailings_start.php');
        break;
    case 'delete':
        $deleted = Pommo_Mailing::delete($mailingIDS);
        $logger->addMsg(Pommo::_T('Please Wait') . '...');
        $params = $json->encode(array('ids' => $mailingIDS));
        $view->assign('callbackFunction', 'deleteMailing');
        $view->assign('callbackParams', $params);
        break;
    default:
        $logger->AddErr('invalid call');
        break;
}
$view->display('admin/rpc');
Пример #4
0
$logger = Pommo::$_logger;
$dbo = Pommo::$_dbo;
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
require_once Pommo::$_baseDir . 'classes/Pommo_Template.php';
$view = new Pommo_Template();
// validate field ID
$field = current(Pommo_Fields::get(array('id' => $_REQUEST['field_id'])));
if ($field['id'] != $_REQUEST['field_id']) {
    die('bad field ID');
}
if (empty($_POST)) {
    $vMsg = array();
    $vMsg['field_name'] = $vMsg['field_prompt'] = Pommo::_T('Cannot be empty.');
    $view->assign('vMsg', $vMsg);
} else {
    // ___ USER HAS SENT FORM ___
    /**********************************
    		JSON OUTPUT INITIALIZATION
    	 *********************************/
    require_once Pommo::$_baseDir . 'classes/Pommo_Json.php';
    $json = new Pommo_Json();
    require_once Pommo::$_baseDir . 'classes/Pommo_Validate.php';
    $validator = new Pommo_Validate();
    $validator->setPost($_POST);
    $validator->addData('field_name', 'Other', false);
    $validator->addData('field_prompt', 'Other', false);
    $validator->addData('field_required', 'matchRegex', false, '!^(on|off)$!');
    $validator->addData('field_active', 'matchRegex', false, '!^(on|off)$!');
    if ($result = $validator->checkData()) {
Пример #5
0
Pommo::init();
$logger = Pommo::$_logger;
$dbo = Pommo::$_dbo;
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
require_once Pommo::$_baseDir . 'classes/Pommo_Template.php';
$view = new Pommo_Template();
/**********************************
	JSON OUTPUT INITIALIZATION
 *********************************/
require_once Pommo::$_baseDir . 'classes/Pommo_Json.php';
$json = new Pommo_Json();
$success = false;
if (isset($_POST['skip']) || isset($_POST['template']) && !is_numeric($_POST['template'])) {
    $success = true;
} elseif (isset($_POST['load'])) {
    $template = current(Pommo_Mailing_Template::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 = Pommo_Mailing_Template::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 {
    $view->assign('templates', Pommo_Mailing_Template::getNames());
    $view->display('admin/mailings/mailing/templates');
    Pommo::kill();
}
$json->serve($success);
Пример #6
0
require_once Pommo::$_baseDir . 'classes/Pommo_Validate.php';
require_once Pommo::$_baseDir . 'classes/Pommo_Subscribers.php';
Pommo::init(array('authLevel' => 0, 'noSession' => true));
$logger =& Pommo::$_logger;
$dbo =& Pommo::$_dbo;
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
require_once Pommo::$_baseDir . 'classes/Pommo_Template.php';
$smarty = new Pommo_Template();
// 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 . '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 (!Pommo_Helper::isEmail($subscriber['email'])) {
    $logger->addErr(Pommo::_T('Invalid Email Address'));
}
// ** check if email already exists in DB ("duplicates are bad..")
if (Pommo_Helper::isDupe($subscriber['email'])) {
    $logger->addErr(Pommo::_T('Email address already exists. Duplicates are not allowed.'));
    $smarty->assign('dupe', TRUE);
Пример #7
0
        $msg = Pommo::_T('subscription request');
        $pending['type'] = 'confirm';
        // normalize for Pommo_Helper_Messages::sendMessage
        break;
    case "change":
        $msg = Pommo::_T('record update request');
        $pending['type'] = 'update';
        // normalize for Pommo_Helper_Messages::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'])) {
        require_once Pommo::$_baseDir . 'classes/Pommo_Helper_Messages.php';
        Pommo_Helper_Messages::sendMessage(array('to' => $input['Email'], 'code' => $pending['code'], 'type' => $pending['type']));
    } elseif (isset($_POST['cancel'])) {
        if (Pommo_Pending::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();
Пример #8
0
 *
 */
/**********************************
	INITIALIZATION METHODS
*********************************/
require 'bootstrap.php';
require_once Pommo::$_baseDir . 'classes/Pommo_Mailing.php';
Pommo::init();
$logger = Pommo::$_logger;
$dbo = Pommo::$_dbo;
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
require_once Pommo::$_baseDir . 'classes/Pommo_Template.php';
$view = new Pommo_Template();
$view->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 =& Pommo_Api::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';
Пример #9
0
	INITIALIZATION METHODS
*********************************/
require 'bootstrap.php';
require_once Pommo::$_baseDir . 'classes/Pommo_Sql.php';
require_once Pommo::$_baseDir . 'classes/Pommo_Groups.php';
require_once Pommo::$_baseDir . 'classes/Pommo_Fields.php';
require_once Pommo::$_baseDir . 'classes/Pommo_Rules.php';
Pommo::init();
$logger = Pommo::$_logger;
$dbo = Pommo::$_dbo;
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
require_once Pommo::$_baseDir . 'classes/Pommo_Template.php';
$view = new Pommo_Template();
$view->assign('returnStr', _('Groups Page'));
// Initialize page state with default values overriden by those held in $_REQUEST
$state =& Pommo_Api::stateInit('groups_edit', array('group' => 0), $_REQUEST);
$groups = Pommo_Groups::get();
$fields = Pommo_Fields::get();
$group =& $groups[$state['group']];
if (empty($group)) {
    Pommo::redirect('subscribers_groups.php');
}
$rules = Pommo_Sql::sortRules($group['rules']);
$rules['and'] = Pommo_Sql::sortLogic($rules['and']);
$rules['or'] = Pommo_Sql::sortLogic($rules['or']);
foreach ($rules as $key => $a) {
    if ($key == 'include' || $key == 'exclude') {
        foreach ($a as $k => $gid) {
            $rules[$key][$k] = $groups[$gid]['name'];
Пример #10
0
    } else {
        $group = Pommo_Groups::make(array('name' => $_POST['group_name']));
        $id = Pommo_Groups::add($group);
        $id ? Pommo::redirect("groups_edit.php?group={$id}") : $logger->addMsg(Pommo::_T('Error with addition.'));
    }
}
if (!empty($_GET['delete'])) {
    // make sure it is a valid group
    $group = current(Pommo_Groups::get(array('id' => $_GET['group_id'])));
    if (empty($group)) {
        Pommo::redirect($_SERVER['PHP_SELF']);
    }
    $affected = Pommo_Groups::rulesAffected($group['id']);
    // See if this change will affect any subscribers, if so, confirm the change.
    if ($affected > 1 && empty($_GET['dVal-force'])) {
        $smarty->assign('confirm', array('title' => Pommo::_T('Confirm Action'), 'nourl' => $_SERVER['PHP_SELF'] . '?group_id=' . $_GET['group_id'], 'yesurl' => $_SERVER['PHP_SELF'] . '?group_id=' . $_GET['group_id'] . '&delete=TRUE&dVal-force=TRUE', 'msg' => sprintf(Pommo::_T('%1$s filters belong this group . Are you sure you want to remove %2$s?'), '<b>' . $affected . '</b>', '<b>' . $group['name'] . '</b>')));
        $smarty->display('admin/confirm.tpl');
        Pommo::kill();
    } else {
        // delete group
        if (!Pommo_Groups::delete($group['id'])) {
            $logger->addMsg(Pommo::_T('Group cannot be deleted.'));
        } else {
            $logger->addMsg(sprintf(Pommo::_T('%s deleted.'), $group['name']));
        }
    }
}
// Get array of mailing groups. Key is ID, value is name
$groups = Pommo_Groups::getNames();
$smarty->assign('groups', $groups);
$smarty->display('admin/subscribers/subscribers_groups.tpl');
Пример #11
0
 */
/**********************************
	INITIALIZATION METHODS
 *********************************/
require 'bootstrap.php';
require_once Pommo::$_baseDir . 'classes/Pommo_Csv_Stream.php';
require_once Pommo::$_baseDir . 'classes/Pommo_Subscribers.php';
require_once Pommo::$_baseDir . 'classes/Pommo_Fields.php';
Pommo::init(array('keep' => TRUE));
$logger = Pommo::$_logger;
$dbo = Pommo::$_dbo;
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
require_once Pommo::$_baseDir . 'classes/Pommo_Template.php';
$view = new Pommo_Template();
$view->assign('returnStr', _('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;
    }
}
$view->assign('excludeUnsubscribed', isset($_REQUEST['excludeUnsubscribed']) ? true : false);
$view->assign('preview', $preview);
$view->assign('colNum', $cols);
$view->assign('fields', Pommo_Fields::get());
$view->display('admin/subscribers/import_csv');
Пример #12
0
 * 
 * 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
 *********************************/
require_once Pommo::$_baseDir . 'classes/Pommo_Template.php';
$smarty = new Pommo_Template();
$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();
Пример #13
0
/**********************************
	INITIALIZATION METHODS
*********************************/
require 'bootstrap.php';
require_once Pommo::$_baseDir . 'classes/Pommo_Csv_Stream.php';
Pommo::init();
$logger = Pommo::$_logger;
$dbo = Pommo::$_dbo;
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
require_once Pommo::$_baseDir . 'classes/Pommo_Template.php';
$view = new Pommo_Template();
// Maximum File Size (in MB)
$max_file_size = 2;
$view->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?
        if (!stream_wrapper_register('pommoCSV', 'Pommo_Csv_Stream')) {
            Pommo::kill('Failed to register pommoCSV');
        }
Пример #14
0
 */
// Clears the entire database, resets auto increment values
/**********************************
	INITIALIZATION METHODS
 *********************************/
define('_poMMo_support', TRUE);
require 'bootstrap.php';
Pommo::init();
$dbo =& Pommo::$_dbo;
foreach ($dbo->table as $id => $table) {
    if ($id == 'config' || $id == 'updates' || $id == 'group_criteria' || $id == 'templates' || $id == 'subscriber_update') {
        continue;
    }
    $query = 'DELETE FROM ' . $table;
    if (!$dbo->query($query)) {
        die('ERROR deleting ' . $id);
    }
    $query = "ALTER TABLE " . $table . " AUTO_INCREMENT = 1";
    if (!$dbo->query($query)) {
        die('ERROR setting AUTO_INCREMENT on ' . $id);
    }
}
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
require_once Pommo::$_baseDir . 'classes/Pommo_Template.php';
$smarty = new Pommo_Template();
$message[] = 'Database Reset.';
$smarty->assign('messages', $message);
$smarty->display('support/support.lib.tpl');
Pommo::kill();
Пример #15
0
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) 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 Pommo.  If not, see <http://www.gnu.org/licenses/>.
 * 
 *  This fork is from https://github.com/soonick/poMMo
 *  Please see docs/contribs for Contributors
 *
 */
/**********************************
	INITIALIZATION METHODS
 *********************************/
require '../bootstrap.php';
require_once Pommo::$_baseDir . 'classes/Pommo_Mailing_Template.php';
require_once Pommo::$_baseDir . 'classes/Pommo_Fields.php';
Pommo::init();
$logger = Pommo::$_logger;
$dbo = Pommo::$_dbo;
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
require_once Pommo::$_baseDir . 'classes/Pommo_Template.php';
$view = new Pommo_Template();
$view->assign('fields', Pommo_Fields::get(array('byName' => true)));
$view->display('admin/mailings/mailing/ajax.personalize');
Пример #16
0
 public static function kill($msg = NULL, $backtrace = FALSE)
 {
     // output passed message
     if ($msg) {
         if (empty(self::$_workDir)) {
             echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
                     "http://www.w3.org/TR/html4/strict.dtd">';
             echo '<title>poMMo Error</title>';
             // 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 = self::$_logger;
             $logger->addErr($msg);
             require_once self::$_baseDir . 'classes/Pommo_Template.php';
             $view = new Pommo_Template();
             $view->assign('fatalMsg', TRUE);
             $view->display('message');
         }
     }
     // output debugging info if enabled (in config.php)
     if (self::$_debug) {
         require_once self::$_baseDir . 'classes/Pommo_Helper_Debug.php';
         $debug = new Pommo_Helper_Debug();
         $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;
 }
Пример #17
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';
require_once Pommo::$_baseDir . 'classes/Pommo_Mailing.php';
Pommo::init();
$logger = Pommo::$_logger;
$dbo = Pommo::$_dbo;
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
require_once Pommo::$_baseDir . 'classes/Pommo_Template.php';
$smarty = new Pommo_Template();
$mailing = current(Pommo_Mailing::get(array('active' => TRUE)));
$smarty->assign('mailing', $mailing);
$smarty->display('admin/mailings/mailing_status.tpl');
Пример #18
0
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
 *********************************/
require_once Pommo::$_baseDir . 'classes/Pommo_Template.php';
$smarty = new Pommo_Template();
$smarty->prepareForForm();
// Check to make sure poMMo is not already installed.
if (Pommo_Install::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');
Пример #19
0
 * 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';
require_once Pommo::$_baseDir . 'classes/Pommo_Mailing.php';
Pommo::init();
$logger =& Pommo::$_logger;
$dbo =& Pommo::$_dbo;
if (isset($_REQUEST['mailings'])) {
    if (is_array($_REQUEST['mailings'])) {
        $_REQUEST['mailings'] = $_REQUEST['mailings'][0];
    }
    $mailing = current(Pommo_Mailing::get(array('id' => $_REQUEST['mailings'])));
} else {
    $mailing = Pommo::$_session['state']['mailing'];
}
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
require_once Pommo::$_baseDir . 'classes/Pommo_Template.php';
$smarty = new Pommo_Template();
$smarty->assign($mailing);
$smarty->display('inc/mailing.tpl');
Pommo::kill();
Пример #20
0
        $state =& Pommo_Api::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 . 'mailings_start.php');
        break;
    case 'delete':
        $currentUser = Pommo::$_auth->_username;
        //	We dont want to delete the current user
        $key = array_search($currentUser, $_GET['users']);
        if ($key !== false) {
            unset($_GET['users'][$key]);
        }
        require_once Pommo::$_baseDir . 'classes/Pommo_User.php';
        $pu = new Pommo_User();
        $deleted = $pu->delete($_GET['users']);
        $logger->addMsg(Pommo::_T('Please Wait') . '...');
        $params = $json->encode(array('users' => $_GET['users']));
        $view->assign('callbackFunction', 'deleteUser');
        $view->assign('callbackParams', $params);
        break;
    case 'add':
        require_once Pommo::$_baseDir . 'classes/Pommo_User.php';
        $pu = new Pommo_User();
        if ($pu->save($_POST['user'], $_POST['password'])) {
            echo $_POST['user'];
            return;
        }
        break;
    default:
        $logger->AddErr('invalid call');
        break;
}
$view->display('admin/rpc');
Пример #21
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';
require_once Pommo::$_baseDir . 'classes/Pommo_Fields.php';
Pommo::init();
$logger =& Pommo::$_logger;
$dbo =& Pommo::$_dbo;
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
require_once Pommo::$_baseDir . 'classes/Pommo_Template.php';
$smarty = new Pommo_Template();
$smarty->assign('fields', Pommo_Fields::get());
$smarty->display('admin/subscribers/ajax/subscriber_edit.tpl');
Pommo::kill();
Пример #22
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
 *********************************/
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
 *********************************/
require_once Pommo::$_baseDir . 'classes/Pommo_Template.php';
$smarty = new Pommo_Template();
// subscription forms will be activated from this template
$smarty->prepareForSubscribeForm();
// assign referer since this is an embedded form
$smarty->assign('referer', htmlspecialchars($_SERVER['PHP_SELF']));
$smarty->display('subscribe/form.mini.tpl');
Пример #23
0
 */
/**********************************
	INITIALIZATION METHODS
 *********************************/
require 'bootstrap.php';
require_once Pommo::$_baseDir . 'classes/Pommo_Groups.php';
require_once Pommo::$_baseDir . 'classes/Pommo_Fields.php';
Pommo::init();
$logger = Pommo::$_logger;
$dbo = Pommo::$_dbo;
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
require_once Pommo::$_baseDir . 'classes/Pommo_Template.php';
$view = new Pommo_Template();
$view->assign('returnStr', _('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 =& Pommo_API::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) {
Пример #24
0
$view = new Pommo_Template();
$fatal_error = null;
// Check we have the mysql module installed
if (!extension_loaded('mysql')) {
    $fatal_error[] = "Php mysql module is not installed.";
}
// Check if module is installed
if (!extension_loaded('gettext')) {
    $fatal_error[] = "Php gettext module is not installed.";
}
//Check write permission to the cache directory
if (!is_writable(dirname(__FILE__) . '/cache')) {
    $fatal_error[] = "The cache directory needs to be writable";
}
if ($fatal_error) {
    $view->assign('errors', $fatal_error);
    $view->display('message');
    exit;
}
//	log the user out if requested
if (isset($_GET['logout'])) {
    Pommo::$_auth->logout();
    header('Location: ' . Pommo::$_http . Pommo::$_baseUrl . 'index.php');
}
// 	check if user is already logged in
if (Pommo::$_hasConfigFile && Pommo::$_auth->isAuthenticated()) {
    // If user is authenticated (has logged in), redirect to admin.php
    Pommo::redirect(Pommo::$_http . Pommo::$_baseUrl . 'admin.php');
} elseif (isset($_POST['submit']) && !empty($_POST['username']) && !empty($_POST['password'])) {
    require_once Pommo::$_baseDir . 'classes/Pommo_User.php';
    $user = new Pommo_user();
Пример #25
0
 *  (at your option) 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 Pommo.  If not, see <http://www.gnu.org/licenses/>.
 * 
 *  This fork is from https://github.com/soonick/poMMo
 *  Please see docs/contribs for Contributors
 *
 */
// Progress bar modified from the works of Juha Suni <*****@*****.**>
/**********************************
	INITIALIZATION METHODS
 *********************************/
require 'bootstrap.php';
require_once Pommo::$_baseDir . 'classes/Pommo_Mailing.php';
Pommo::init();
$logger = Pommo::$_logger;
$dbo = Pommo::$_dbo;
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
require_once Pommo::$_baseDir . 'classes/Pommo_Template.php';
$view = new Pommo_Template();
$mailing = current(Pommo_Mailing::get(array('active' => TRUE)));
$view->assign('mailing', $mailing);
$view->display('admin/mailings/mailing_status');
Пример #26
0
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) 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 Pommo.  If not, see <http://www.gnu.org/licenses/>.
 * 
 *  This fork is from https://github.com/soonick/poMMo
 *  Please see docs/contribs for Contributors
 *
 */
/**********************************
	INITIALIZATION METHODS
 *********************************/
require '../bootstrap.php';
require_once Pommo::$_baseDir . 'classes/Pommo_Fields.php';
Pommo::init();
$logger = Pommo::$_logger;
$dbo = Pommo::$_dbo;
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
require_once Pommo::$_baseDir . 'classes/Pommo_Template.php';
$view = new Pommo_Template();
$view->assign('fields', Pommo_Fields::get());
$view->display('admin/subscribers/ajax/subscriber_edit');
Пример #27
0
/**********************************
	INITIALIZATION METHODS
 *********************************/
require 'bootstrap.php';
require_once Pommo::$_baseDir . 'classes/Pommo_Mailing.php';
Pommo::init();
$logger = Pommo::$_logger;
$dbo = Pommo::$_dbo;
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
require_once Pommo::$_baseDir . 'classes/Pommo_Template.php';
$view = new Pommo_Template();
if (Pommo_Mailing::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 . 'setup_configure.php#mailings">', '</a>'));
}
require_once 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');
}
$view->assign('wysiwygJS', $editor);
// translation assignments for dialg titles...
$view->assign('t_personalization', Pommo::_T('Personalization'));
$view->assign('t_testMailing', Pommo::_T('Test Mailing'));
$view->assign('t_saveTemplate', Pommo::_T('Save Template'));
$view->display('admin/mailings/mailings_start');
Пример #28
0
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
require_once Pommo::$_baseDir . 'classes/Pommo_Template.php';
$view = new Pommo_Template();
$emails = Pommo::get('emails');
$dupes = Pommo::get('dupes');
$fields = Pommo_Fields::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 (!Pommo_Subscribers::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>');
}
$view->assign('flag', $flag);
$view->assign('tally', count($emails));
$view->assign('dupes', $dupes);
$view->display('admin/subscribers/import_txt');
Пример #29
0
*********************************/
require '../bootstrap.php';
Pommo::init();
$logger = Pommo::$_logger;
$dbo = Pommo::$_dbo;
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
require_once Pommo::$_baseDir . 'classes/Pommo_Template.php';
$view = new Pommo_Template();
if (empty($_POST)) {
    // no validation for exchanger
    $vMsg = array();
    $vMsg['site_url'] = $vMsg['site_success'] = $vMsg['site_confirm'] = Pommo::_T('Must be a valid URL');
    $vMsg['list_name'] = $vMsg['site_name'] = Pommo::_T('Cannot be empty.');
    $view->assign('vMsg', $vMsg);
    // populate _POST with info from database (fills in form values...)
    $dbVals = Pommo_Api::configGet(array('site_success', 'site_confirm', 'list_exchanger', 'list_confirm'));
    $dbVals['site_url'] = Pommo::$_config['site_url'];
    $dbVals['site_name'] = Pommo::$_config['site_name'];
    $dbVals['list_name'] = Pommo::$_config['list_name'];
    $view->assign($dbVals);
} else {
    // ___ USER HAS SENT FORM ___
    require_once Pommo::$_baseDir . 'classes/Pommo_Validate.php';
    $validator = new Pommo_Validate();
    $validator->setPost($_POST);
    $validator->addData('list_name', 'Other', false);
    $validator->addData('site_name', 'Other', false);
    $validator->addData('site_url', 'Url', false);
    $validator->addData('site_success', 'Url', true);
Пример #30
0
 */
// Clears the entire database, resets auto increment values
/**********************************
	INITIALIZATION METHODS
 *********************************/
define('_poMMo_support', TRUE);
require 'bootstrap.php';
Pommo::init();
$dbo = Pommo::$_dbo;
foreach ($dbo->table as $id => $table) {
    if ($id == 'config' || $id == 'updates' || $id == 'group_criteria' || $id == 'templates' || $id == 'subscriber_update') {
        continue;
    }
    $query = 'DELETE FROM ' . $table;
    if (!$dbo->query($query)) {
        die('ERROR deleting ' . $id);
    }
    $query = 'ALTER TABLE ' . $table . ' AUTO_INCREMENT = 1';
    if (!$dbo->query($query)) {
        die('ERROR setting AUTO_INCREMENT on ' . $id);
    }
}
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
require_once Pommo::$_baseDir . 'classes/Pommo_Template.php';
$view = new Pommo_Template();
$message[] = 'Database Reset.';
$view->assign('messages', $message);
$view->display('support/support');
Pommo::kill();