Beispiel #1
0
                PommoHelperMessages::notify($notices, $subscriber, 'pending', $comments);
            }
            if ($config['site_confirm']) {
                Pommo::redirect($config['site_confirm']);
            }
        } else {
            $smarty->assign('back', TRUE);
            // delete the subscriber
            PommoSubscriber::delete($id);
        }
    }
} else {
    // no email confirmation required
    if (!PommoSubscriber::add($subscriber)) {
        $logger->addErr('Error adding subscriber! Please contact the administrator.');
        $smarty->assign('back', TRUE);
    } else {
        // send/print welcome message
        PommoHelperMessages::sendMessage(array('to' => $subscriber['email'], 'type' => 'subscribe'));
        $subscriber['registered'] = date("F j, Y, g:i a", $subscriber['registered']);
        if ($comments || isset($notices['subscribe']) && $notices['subscribe'] == 'on') {
            PommoHelperMessages::notify($notices, $subscriber, 'subscribe', $comments);
        }
        // redirect
        if ($config['site_success']) {
            Pommo::redirect($config['site_success']);
        }
    }
}
$smarty->display('user/process.tpl');
Pommo::kill();
Beispiel #2
0
if (PommoPending::perform($pending)) {
    Pommo::requireOnce($pommo->_baseDir . 'inc/helpers/messages.php');
    // get subscriber info
    Pommo::requireOnce($pommo->_baseDir . 'inc/helpers/subscribers.php');
    $subscriber = current(PommoSubscriber::get(array('id' => $pending['subscriber_id'])));
    switch ($pending['type']) {
        case "add":
            // send/print welcome message
            PommoHelperMessages::sendMessage(array('to' => $subscriber['email'], 'type' => 'subscribe'));
            if (isset($notices['subscribe']) && $notices['subscribe'] == 'on') {
                PommoHelperMessages::notify($notices, $subscriber, 'subscribe');
            }
            if (!empty($config['site_success'])) {
                Pommo::redirect($config['site_success']);
            }
            break;
        case "change":
            if (isset($notices['update']) && $notices['update'] == 'on') {
                PommoHelperMessages::notify($notices, $subscriber, 'update');
            }
            $logger->addMsg(Pommo::_T('Your records have been updated.'));
            break;
        case "password":
            break;
        default:
            $logger->addMsg('Unknown Pending Type.');
            break;
    }
}
$smarty->display('user/confirm.tpl');
Pommo::kill();