Beispiel #1
0
namespace Ventus\Survey;

//============================================================================================
// Session, configuration file, localization constructor
//============================================================================================
require '../includes/php/bootstrap.php';
$SESSION = new \Zend_Session_Namespace('survey', true);
if (\Ventus\Utilities\I18n\Translate::isAllowedLanguage($SESSION->corr_lang)) {
    $l10n->setLanguage($SESSION->corr_lang);
    \Locale::setDefault($SESSION->corr_lang);
}
//============================================================================================
// Model and Header and L10N Includes, Authentication
//============================================================================================
$model = new Unsubscribe($dbo);
require FS_INCLUDES . '/l10n/header-external.php';
//============================================================================================
// Load the content
//============================================================================================
if (!isset($_GET['user']) || !$model->checkUserExists($_GET['user'])) {
    $l10n->addResource(__DIR__ . '/l10n/error.json');
    require_once FS_PHP . '/header-external.php';
    require_once 'views/error.php';
    require_once FS_PHP . '/footer-external.php';
} else {
    $user = $_GET['user'];
    $student = $model->fetchStudentByHashCode($user);
    if (!isset($_GET['page'])) {
        if ($model->checkUnsubscribe($student[0]['student_id'])) {
            header("Location: unsubscribe.php?page=complete&user={$user}");
Beispiel #2
0
 public function addDisplayedInputFilters()
 {
     $this->add(['name' => 'fullName', 'required' => true, 'filters' => [['name' => 'StripTags'], ['name' => 'StringTrim']], 'validators' => [['name' => 'StringLength', 'options' => ['encoding' => 'UTF-8', 'min' => 1, 'max' => 100]]]]);
     $this->add(['name' => 'extra', 'required' => false, 'filters' => [], 'validators' => [['name' => 'DmMailer\\Validator\\Json', 'options' => []]]]);
     parent::addDisplayedInputFilters();
 }
Beispiel #3
0
namespace Ventus\Counselling;

//============================================================================================
// Session, configuration file, localization constructor
//============================================================================================
require '../includes/php/bootstrap.php';
$SESSION = new \Zend_Session_Namespace('internal', true);
if (!isset($SESSION->lang)) {
    $SESSION->lang = DEFAULT_LANGUAGE;
}
\Locale::setDefault($SESSION->lang);
$l10n->setLanguage($SESSION->lang);
//============================================================================================
// Model and Header and L10N Includes, Authentication
//============================================================================================
$model = new Unsubscribe($dbo);
require FS_INCLUDES . '/l10n/header-external.php';
$cron = new \Ventus\Calendar\CronJobs($dbo);
$cron->runAll();
//============================================================================================
// Load the content
//============================================================================================
if (!isset($_GET['hash_link']) || !$model->checkIfStudentExists($_GET['hash_link'])) {
    $l10n->addResource(__DIR__ . '/l10n/error.json');
    require_once FS_PHP . '/header-external.php';
    require_once 'views/error.php';
    require_once FS_PHP . '/footer-external.php';
} else {
    $hash_link = $_GET['hash_link'];
    $student = $model->fetchStudentByHashLink($hash_link);
    if (!isset($_GET['page'])) {
 function testUnsubscribeEmailBlastKey()
 {
     $s = new Supporter(array('supporter_KEY' => 72));
     $u = new Unsubscribe(array('supporter_KEY' => 72, 'email_blast_KEY' => 55));
     $u->db_insert();
     $s->updateUnsubscribeInfo();
     $this->assertEqual($s->data['data__unsub_email_key'], '55');
 }