init() public static method

* init called by page to load page state, populate config, and track authentication.
public static init ( $args = [] )
Exemplo n.º 1
0
 *  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();
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'));
Exemplo n.º 2
0
 * 
 * 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_support', TRUE);
require 'bootstrap.php';
Pommo::init(array('install' => TRUE));
$logger =& Pommo::$_logger;
// start error logging
Pommo::logErrors();
// ignore user abort
ignore_user_abort(true);
require_once Pommo::$_baseDir . 'classes/Pommo_Mail_Ctl.php';
$code = empty($_GET['code']) ? null : $_GET['code'];
$spawn = !isset($_GET['spawn']) ? 0 : $_GET['spawn'] + 1;
trigger_error('Testing Log, Spawn #' . $spawn);
$fileContent = "<?php die(); ?>\n[code] = {$code}\n[spawn] = {$spawn}\n";
if (!($handle = fopen(Pommo::$_workDir . '/mailing.test.php', 'w'))) {
    die('Unable to write to test file');
}
if (fwrite($handle, $fileContent) === FALSE) {
    die('Unable to write to test file');
Exemplo n.º 3
0
 * 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.
 */
// TODO -> Add auto firewalling [DOS protection] scripts here.. ie. if Bad/no code received by same IP 3 times, temp/perm ban.
//  If page is being bombed/DOSed... temp shutdown. should all be handled inside @ _IS_VALID or fireup(); ..
/**********************************
	INITIALIZATION METHODS
*********************************/
require 'bootstrap.php';
require_once Pommo::$_baseDir . 'classes/Pommo_Pending.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';
$view = new Pommo_Template();
if (empty($_GET['code'])) {
    $logger->addMsg(Pommo::_T('No code given.'));
    $view->display('user/confirm');
    Pommo::kill();
}
// lookup code
$pending = Pommo_Pending::get($_GET['code']);
if (!$pending) {
Exemplo n.º 4
0
 *  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(array('authLevel' => 0));
$logger = Pommo::$_logger;
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
require_once Pommo::$_baseDir . 'classes/Pommo_Template.php';
$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.";
}
Exemplo n.º 5
0
 *  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(array('keep' => TRUE));
$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.');
Exemplo n.º 6
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');
Exemplo n.º 7
0
 * 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
*********************************/
$serial = empty($_GET['serial']) ? time() : addslashes($_GET['serial']);
require '../bootstrap.php';
require_once Pommo::$_baseDir . 'classes/Pommo_Mta.php';
Pommo::init(array('sessionID' => $serial, 'keep' => TRUE, 'authLevel' => 0));
$logger = Pommo::$_logger;
$dbo = Pommo::$_dbo;
// don't die on query so we can capture logs'
// NOTE: Be extra careful to check the success of queries/methods!
$dbo->dieOnQuery(FALSE);
// turn logging off unless verbosity is 1
if (Pommo::$_verbosity > 1) {
    $dbo->debug(FALSE);
}
// start error logging
Pommo::logErrors();
/**********************************
    STARTUP ROUTINES
 *********************************/
$config = Pommo_Api::configGet(array('list_exchanger', 'maxRuntime', 'smtp_1', 'smtp_2', 'smtp_3', 'smtp_4', 'throttle_SMTP', 'throttle_MPS', 'throttle_BPS', 'throttle_DP', 'throttle_DMPP', 'throttle_DBPP'));
Exemplo n.º 8
0
 * 
 * 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_Install.php';
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);
Exemplo n.º 9
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
 *********************************/
define('_poMMo_support', TRUE);
$maxRunTime = 80;
if (ini_get('safe_mode')) {
    $maxRunTime = ini_get('max_execution_time') - 10;
} else {
    set_time_limit(0);
}
ignore_user_abort(true);
require 'bootstrap.php';
Pommo::init(array('noSession' => TRUE));
$code = empty($_GET['code']) ? null : $_GET['code'];
if (!($handle = fopen(Pommo::$_workDir . '/mailing.test.php', 'w'))) {
    die('Unable to write to test file');
}
for ($i = 0; $i <= 90; $i += 5) {
    $fileContent = "<?php die(); ?>\n[code] = {$code}\n[time] = {$i}\n";
    rewind($handle);
    if (fwrite($handle, $fileContent) === FALSE) {
        die('Unable to write to test file');
    }
    sleep(5);
}
fclose($handle);
die;
Exemplo n.º 10
0
 *  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';
require_once Pommo::$_baseDir . 'classes/Pommo_Mailing.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();
$current = Pommo_Mailing::isCurrent();
if (empty($_POST)) {
    // ___ USER HAS NOT SENT FORM ___
    $vMsg = array();
    $vMsg['email'] = Pommo::_T('Invalid email address');
    $view->assign('vMsg', $vMsg);
} else {
    // ___ USER HAS SENT FORM ___