Example #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();
$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();
	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'));
$smarty->assign('mps', $config['throttle_MPS'] * 60);
$smarty->assign('bps', $config['throttle_BPS'] / 1024);
$smarty->assign('dp', $config['throttle_DP']);
$smarty->assign('dmpp', $config['throttle_DMPP']);
$smarty->assign('dbpp', $config['throttle_DBPP'] / 1024);
$smarty->display('admin/setup/config/ajax.throttle.tpl');
Pommo::kill();
Example #3
0
// Test the servers
$addServer = FALSE;
$smtpStatus = array();
for ($i = 1; $i < 5; $i++) {
    if (empty($smtp[$i])) {
        if (!$addServer) {
            $addServer = $i;
        }
        continue;
    }
    $test[$i] = new PHPMailer();
    $test[$i]->Host = empty($smtp[$i]['host']) ? null : $smtp[$i]['host'];
    $test[$i]->Port = empty($smtp[$i]['port']) ? null : $smtp[$i]['port'];
    if (!empty($smtp[$i]['auth']) && $smtp[$i]['auth'] == 'on') {
        $test[$i]->SMTPAuth = TRUE;
        $test[$i]->Username = empty($smtp[$i]['user']) ? null : $smtp[$i]['user'];
        $test[$i]->Password = empty($smtp[$i]['pass']) ? null : $smtp[$i]['pass'];
    }
    if (@$test[$i]->SmtpConnect()) {
        $smtpStatus[$i] = TRUE;
        $test[$i]->SmtpClose();
    } else {
        $smtpStatus[$i] = FALSE;
    }
}
$smarty->assign('addServer', $addServer);
$smarty->assign('smtpStatus', $smtpStatus);
$smarty->assign('smtp', $smtp);
$smarty->assign('throttle_SMTP', $smtpConfig['throttle_SMTP']);
$smarty->display('admin/setup/config/ajax.smtp.tpl');
Pommo::kill();
 * Copyright (C) 2005, 2006, 2007, 2008  Brice Burgess <*****@*****.**>
 * 
 * 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();
$smarty->display('admin/subscribers/admin_subscribers.tpl');
Pommo::kill();
    }
    if ($nbre_resultats >= 1) {
        $titre_aff = "Tableau récapitulatif des statistiques d'ouverture par campagne";
        $aff_resultat = "";
        while ($row2 = $allclicktracking->fetch()) {
            $aff_resultat .= "<tr>";
            $aff_resultat .= "\r\n                    <td style=\"text-align:center;\">{$row2['mailing_id']}<br /><input name=\"checkbox[]\" type=\"checkbox\" value=\"mailing_id={$row2['mailing_id']}\" /></td>\r\n                    <td><a href='tracking_opening_datas.php?mailing_id={$row2['mailing_id']}&amp;visitesparcampagne={$row2['messages_ouverts']}' title=\"Voir les détails de cette campagne\">" . $row2[subject] . "</a></td>\r\n                    <td>{$row2['started']}</td>\r\n                    <td>" . $row2[mailgroup] . "</td>\r\n                    <td>{$row2['sent']}</td>\r\n                    <td>{$row2['messages_ouverts']}</td>\r\n                    <td>{$row2['taux_ouvertures']}%</td>\r\n                    <td>{$row2['latence']}</td>\r\n                    </tr>";
        }
    }
    /* Initialisation de la requete de suppression de lignes */
    if (isset($_POST['supprimer'])) {
        $checkbox = $_POST['checkbox'];
        for ($i = 0; $i < count($checkbox); $i++) {
            $requete_supprimer = "DELETE FROM " . $prefix . "opentracking WHERE " . $checkbox[$i];
            $resultat_suppression = $id_connex->query($requete_supprimer);
        }
        if ($resultat_suppression) {
            echo "<meta http-equiv=\"refresh\" content=\"0;URL=tracking_opening_menu.php\">";
        }
    }
}
/* Si la requete réussit, revenir sur la meme page... */
$smarty->assign_by_ref('nbre_lignes', $nbre_lignes);
$smarty->assign_by_ref('nbre_resultats', $nbre_resultats);
$smarty->assign_by_ref('titre_aff', $titre_aff);
$smarty->assign_by_ref('aff_resultat', $aff_resultat);
$smarty->assign_by_ref('page', $page);
$smarty->assign_by_ref('groupes', $groupes);
$smarty->assign_by_ref('affichagedesliensdespages', $affichagedesliensdespages);
$smarty->display('admin/mailings/tracking_opening_menu.tpl');
Pommo::kill();
/* if(isset($group_name)){
$titre_aff = "Tous les clics enregistr&eacute;s depuis les messages envoy&eacute;s au groupe <span style=\"color:orange\">".utf8_encode($group_name)."</span>";
} */
/**************************************
 * AFFICHAGE PAR EMAIL MEMBRE
 **************************************/
if (isset($email)) {
    $titre_aff = "Messages ouverts depuis l'adresse <span style=\"color:orange\">" . $email . "</span>";
}
/**************************************
 * TABLEAU DES RESULTATS
 **************************************/
$aff_resultat = "";
while ($row = $result->fetch()) {
    $aff_resultat .= "<tr>";
    $aff_resultat .= "<td>{$row['mailing_id']}</td><td><a href='tracking_opening_by_criteria.php?mailing_id={$row['mailing_id']}' title=\"Voir les statistiques d'ouverture de ce message\">" . $row[subject] . "</a></td><td><a href='tracking_opening_by_criteria.php?group_name=" . urlencode(addslashes($row[mailgroup])) . "' title=\"Voir les messages ouverts depuis ce groupe\">" . $row[mailgroup] . "</a></td><td>{$row['started']}</td><td>{$row['openingtime']}</td><td>{$row['latence']}</td><td><a href='tracking_opening_by_criteria.php?email={$row['email']}' title=\"Voir les messages ouverts depuis cette adresse\">{$row['email']}</a></td></tr>";
}
$result = NULL;
$smarty->assign_by_ref('nbre_resultats', $nbre_resultats);
$smarty->assign_by_ref('titre_aff', $titre_aff);
$smarty->assign_by_ref('aff_resultat', $aff_resultat);
$smarty->assign_by_ref('criteria', $criteria);
$smarty->assign_by_ref('mailing_id', $mailing_id);
$smarty->assign_by_ref('email', $email);
$smarty->assign_by_ref('group_name_utf8', $group_name_utf8);
$smarty->assign_by_ref('total_resultats', $total_resultats);
$smarty->assign_by_ref('page', $page);
$smarty->assign_by_ref('groupes', $groupes);
$smarty->assign_by_ref('affichagedesliensdespages', $affichagedesliensdespages);
$smarty->display('admin/mailings/tracking_opening_by_criteria.tpl');
Pommo::kill();
Example #7
0
        $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();
Example #8
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
 *********************************/
$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();
        $processus = "<div style=\"margin-top:7px; margin-bottom:7px;\"><span style=\"color:green; font-weight:bold;\">Opération terminée avec succès !</span></div>";
    }
    /* 5- Procédure d'annulation */
    if (isset($_POST['annuler']) and $_POST['annuler'] == 1) {
        $supprimer_donnees_intermediaires = "DELETE FROM " . $prefix . "insertions";
        $suppression_donnees_intermediaires = $id_connex->query($supprimer_donnees_intermediaires);
        $processus = "<div style=\"margin-top:7px; margin-bottom:7px;\"><span style=\"color:green; font-weight:bold;\">Annulation de tous les processus en cours : OK.</span></div>";
    }
} else {
    echo "<meta http-equiv=\"refresh\" content=\"0;URL=tracking_opening_menu.php\">";
}
// Si les variables $_GET ne sont pas définies, revenir sur la rubrique principale...
$smarty->assign_by_ref('visitesparcampagne', $visitesparcampagne);
$smarty->assign_by_ref('nbre_resultats', $nbre_resultats);
$smarty->assign_by_ref('titre_aff', $titre_aff);
$smarty->assign_by_ref('aff_resultat', $aff_resultat);
$smarty->assign_by_ref('affichagedesliensdespages', $affichagedesliensdespages);
$smarty->assign_by_ref('urlpage', $urlpage);
$smarty->assign_by_ref('title_page', $title_page);
$smarty->assign_by_ref('mailing_id', $mailing_id);
$smarty->assign_by_ref('page', $page);
$smarty->assign_by_ref('groupes', $groupes);
$smarty->assign_by_ref('champs', $champs);
$smarty->assign_by_ref('champ', $champ);
$smarty->assign_by_ref('idchamp', $idchamp);
$smarty->assign_by_ref('nomduchamp', $nomduchamp);
$smarty->assign_by_ref('valeurdechamp', $valeurdechamp);
$smarty->assign_by_ref('valeursduchamp', $valeursduchamp);
$smarty->assign_by_ref('processus', $processus);
$smarty->display('admin/mailings/tracking_opening_datas.tpl');
Pommo::kill();
Example #10
0
            }
            $matches2 = array();
            preg_match('/\\[\\[[^\\]]+]]/', $input['altbody'], $matches2);
            if (!empty($matches2)) {
                $pAltBody = PommoHelperPersonalize::search($input['altbody']);
                $input['altbody'] = PommoHelperPersonalize::replace($input['altbody'], $subscriber, $pAltBody);
            }
            $matches3 = array();
            preg_match('/\\[\\[[^\\]]+]]/', $input['subject'], $matches3);
            if (!empty($matches3)) {
                $pSubject = PommoHelperPersonalizeTitle::search($input['subject']);
                $input['subject'] = PommoHelperPersonalizeTitle::replace($input['subject'], $subscriber, $pSubject);
            }
        }
        $smarty->assign($input);
        $smarty->display('inc/mailing.tpl');
        Pommo::kill();
    }
}
/**********************************
	VALIDATION ROUTINES
*********************************/
if (!is_numeric($state['limit']) || $state['limit'] < 10 || $state['limit'] > 200) {
    $state['limit'] = 100;
}
if ($state['order'] != 'asc' && $state['order'] != 'desc') {
    $state['order'] = 'asc';
}
if ($state['sort'] != 'start' && $state['sort'] != 'subject') {
    $state['sort'] = 'start';
}
            $i = 1;
            while (($data = fgetcsv($fp, 2048, ',', '"')) !== FALSE) {
                array_push($a, $data);
                if ($i > 9) {
                    // only get first 10 lines -- move file
                    break;
                }
                $i++;
            }
            // save file for access after assignments
            if ($box) {
                // when PHP5 is widespread, switch to file_put_contents()  && use the $fp stream
                if (!($handle = fopen($pommo->_workDir . '/import.csv', 'w'))) {
                    Pommo::kill('Could not write to temp CSV file (' . $pommo->_workDir . '/import.csv)');
                }
                if (fwrite($handle, $_POST['box']) === FALSE) {
                    Pommo::kill('Could not write to temp CSV file (' . $pommo->_workDir . '/import.csv)');
                }
                fclose($handle);
            } else {
                move_uploaded_file($_FILES[$fname]['tmp_name'], $pommo->_workDir . '/import.csv') or Pommo::kill('Could not write to temp CSV file (' . $pommo->_workDir . '/import.csv)');
            }
            $pommo->set(array('preview' => $a));
            Pommo::redirect('import_csv.php' . (isset($_REQUEST['excludeUnsubscribed']) ? '?excludeUnsubscribed=true' : ''));
        } else {
            $logger->addErr('Unknown Import Type');
        }
    }
}
$smarty->display('admin/subscribers/subscribers_import.tpl');
Pommo::kill();
Example #12
0
} 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 {
        // captcha did not match
        $logger->addMsg(Pommo::_T('Captcha did not match. Try again.'));
    }
}
// referer (used to return user to requested page upon login success)
$smarty->assign('referer', isset($_REQUEST['referer']) ? $_REQUEST['referer'] : $pommo->_baseUrl . 'admin/admin.php');
$smarty->display('index.tpl');
die;
Example #13
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();
Example #14
0
 * Copyright (C) 2005, 2006, 2007, 2008  Brice Burgess <*****@*****.**>
 * 
 * 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();
$smarty->display('admin/setup/admin_setup.tpl');
Pommo::kill();
Example #15
0
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();
Example #16
0
        // 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');
Example #17
0
    $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');
            Pommo::kill();
        } else {
            PommoField::delete($field['id']) ? Pommo::redirect($_SERVER['PHP_SELF']) : $logger->addMsg(Pommo::_T('Error with deletion.'));
        }
    }
}
// Get array of fields. Key is ID, value is an array of the demo's info
$fields = PommoField::get(array('byName' => FALSE));
if (!empty($fields)) {
    $smarty->assign('fields', $fields);
}
$smarty->display('admin/setup/setup_fields.tpl');
Pommo::kill();
 * 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
$smarty->prepareForSubscribeForm();
// assign referer since this is an embedded form
$smarty->assign('referer', htmlspecialchars($_SERVER['PHP_SELF']));
$smarty->display('subscribe/form.mini.tpl');
Example #19
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
 *********************************/
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');
Example #20
0
 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;
 }
 * 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();
Example #22
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);
Example #23
0
 * Copyright (C) 2005, 2006, 2007, 2008  Brice Burgess <*****@*****.**>
 * 
 * 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();
$smarty->display('admin/setup/setup_form.tpl');
Pommo::kill();
Example #24
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();
// subscription forms will be activated from this template
$smarty->prepareForSubscribeForm();
$smarty->display('admin/setup/form_embed.tpl');
Pommo::kill();
 * 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();
Example #26
0
$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'];
        }
    }
}
$smarty->assign('fields', $fields);
$smarty->assign('legalFieldIDs', PommoRules::getLegal($group, $fields));
$smarty->assign('legalGroups', PommoRules::getLegalGroups($group, $groups));
$smarty->assign('group', $group);
$smarty->assign('logicNames', PommoRules::getEnglish());
$smarty->assign('rules', $rules);
$smarty->assign('tally', PommoGroup::tally($group));
$smarty->assign('ruleCount', count($rules['and']) + count($rules['or']) + count($rules['include']) + count($rules['exclude']));
$smarty->assign('getURL', $_SERVER['PHP_SELF'] . '?group_id=' . $group['id']);
$smarty->assign('t_include', Pommo::_T('INCLUDE'));
$smarty->display('admin/subscribers/groups_edit.tpl');
Pommo::kill();
Example #27
0
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');
    SmartyValidate::register_validator('admin_password2', 'admin_password:admin_password2', 'isEqual');
Example #28
0
$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');
    $json = new PommoJSON();
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;
}
if (!is_numeric($state['group']) && $state['group'] != 'all') {
    $state['group'] = 'all';
}
if (isset($_REQUEST['searchClear'])) {
    $state['search'] = false;
} elseif (isset($_REQUEST['searchField']) && (is_numeric($_REQUEST['searchField']) || $_REQUEST['searchField'] == 'email' || $_REQUEST['searchField'] == 'ip' || $_REQUEST['searchField'] == 'time_registered' || $_REQUEST['searchField'] == 'time_touched')) {
    $_REQUEST['searchString'] = trim($_REQUEST['searchString']);
    $state['search'] = empty($_REQUEST['searchString']) ? false : array('field' => $_REQUEST['searchField'], 'string' => trim($_REQUEST['searchString']));
}
/**********************************
	DISPLAY METHODS
*********************************/
// Get the *empty* group [no member IDs. 3rd arg is set TRUE]
$group = new PommoGroup($state['group'], $state['status'], $state['search']);
// Calculate and Remember number of pages for this group/status combo
$state['pages'] = is_numeric($group->_tally) && $group->_tally > 0 ? ceil($group->_tally / $state['limit']) : 0;
$smarty->assign('state', $state);
$smarty->assign('tally', $group->_tally);
$smarty->assign('groups', PommoGroup::get());
$smarty->assign('fields', PommoField::get());
$smarty->display('admin/subscribers/subscribers_manage.tpl');
Pommo::kill();
Example #30
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(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
$smarty->prepareForSubscribeForm();
$smarty->display('subscribe/subscribe.tpl');
Pommo::kill();