예제 #1
0
 function sendWebcastRegistrationAdmin($orderInfo)
 {
     $objEmailer = new Emailer();
     $objLayout = new LayoutModel();
     $objTemplate = new TemplatesModel();
     $objSettings = Settings::getInstance();
     $adminEmail = $objSettings->getEntry('admin', 'admin-email');
     $layoutInfo = $objLayout->loadLayout(28);
     $template = $objTemplate->loadTemplateFromKeyname('email-webcastregistration-admin');
     $this->view->assign('orderInfo', $orderInfo);
     $objEmailer->setFrom('*****@*****.**');
     $objEmailer->addTo($adminEmail);
     $objEmailer->setSubject('WEBCAST PURCHASE');
     // render template
     $this->view->assign('content', $this->view->fetch('fromstring:' . $template['content']));
     $this->view->assign('sidebar_left', $this->view->fetch('fromstring:' . $template['left_sidebar']));
     $this->view->assign('sidebar_right', $this->view->fetch('fromstring:' . $template['right_sidebar']));
     $objEmailer->setBody($this->view->fetch('fromstring:' . $layoutInfo['code']), true);
     $objEmailer->sendMail();
     return true;
 }
예제 #2
0
 function actionLogin($params = '')
 {
     if (!empty($params['email']) && !empty($params['password'])) {
         if ($this->objAuthentication->login($params['email'], $params['password'])) {
             //no errors, continue to home
             /*$objDispatcher = new Dispatcher;
             		$objDispatcher->setController('Forum');
             		$objDispatcher->setAction('Index');
             		$objDispatcher->setParams($params);
             		$objDispatcher->dispatch();*/
             $this->actionIndex($params);
         } else {
             $this->view->assign('errorMsg', 'Unable to login, try again.');
             $this->view->assign('content', $this->view->fetch('tpl/community/login.tpl'));
             $this->finish();
         }
     } else {
         if (!empty($params['createAccount']) && $params['createAccount'] == 1) {
             $errorMessages = array();
             $objValidator = new Validator();
             $objValidator->reset();
             $objValidator->validateEmail($params['create_email']);
             $objValidator->validatePassword($params['create_password']);
             $objValidator->passwordsMatch($params['create_password'], $params['create_password2']);
             $objValidator->validateName($params['create_displayName']);
             if ($objValidator->hasError || empty($params['create_terms'])) {
                 $error = $objValidator->getError();
                 if (empty($params['create_terms'])) {
                     $error[] = 'You must agree to the Terms of Use to make an account';
                 }
                 $this->view->assign('errorMessages', $error);
                 $this->view->assign('created', false);
             } else {
                 $userData = array();
                 $userData['email'] = $params['create_email'];
                 $userData['password'] = $params['create_password'];
                 $userData['displayName'] = $params['create_displayName'];
                 $userModel = new UserModel();
                 $created = $userModel->createUser($userData);
                 if (!empty($created)) {
                     $this->view->assign('created', true);
                     $objEmail = new Emailer();
                     $objEmail->setFrom(CONTACT_EMAIL);
                     $objEmail->setSubject('Retail Roar Community account created');
                     $objEmail->addTO($userData['email']);
                     $objEmail->setBody($this->view->fetch('emails/communitysignup.tpl'), true);
                     $sent = $objEmail->sendMail();
                 } else {
                     $this->view->assign('created', false);
                     $this->view->assign('errorMessages', $userModel->errorMsg);
                 }
                 $this->view->assign('submitted', true);
             }
             $this->view->assign('content', $this->view->fetch('tpl/community/login.tpl'));
             $this->finish();
         } else {
             if ($this->objAuthentication->loggedIn()) {
                 $this->view->assign('content', 'Already logged in.');
                 $this->finish();
             } else {
                 $this->view->assign('content', $this->view->fetch('tpl/community/login.tpl'));
                 $this->finish();
             }
         }
     }
 }
예제 #3
0
파일: bento.php 프로젝트: ngardner/BentoCMS
    $controller = 'Error';
    $action = 'Permission';
}
// start up
try {
    $objSettings->loadSettings();
    $objDispatcher->setDirectory('backend');
    $objDispatcher->setController($controller);
    $objDispatcher->setAction($action);
    $objDispatcher->setParams($params);
    $objDispatcher->dispatch();
} catch (Exception $e) {
    $objEmail = new Emailer();
    $objEmail->addTO(ERROR_EMAIL);
    $objEmail->setFrom(ERROR_EMAIL);
    $objEmail->setSubject('FATAL ERROR | Exception thrown on ' . URL);
    $objEmail->setBody('Fatal Exception! ' . $e->getMessage());
    $objEmail->sendMail();
    die('Error<br/>' . $e->getMessage() . '<br/><a href="http://' . URL . '">' . PRODUCT_NAME . '</a>');
}
// time to clean up
$dbQueries = $objDatabase->getNumbQueries();
$objDatabase->disconnect();
//end timer
$endTime = microtime(true);
// calc render details
$totalSeconds = number_format($endTime - $startTime, 3);
$totalMemory = number_format(memory_get_peak_usage() / 1024, 2);
// speed / queries / memory report
// if you uncomment this ajax requests / rss / xml responses will be corrupt
//echo "\r\n".'<!--'."\r\n".'Took '.$totalSeconds.' seconds, '.$dbQueries.' database queries, and '.$totalMemory.'KB of memory'."\r\n".'-->';