/**
  * Generates web page markup
  *
  * @return string view markup
  */
 protected function generateView()
 {
     if (isset($this->view_template)) {
         if ($this->is_view_cached) {
             $cache_key = $this->view_template . self::KEY_SEPARATOR . $this->getCacheKeyString();
             return $this->view_mgr->fetch($this->view_template, $cache_key);
         } else {
             return $this->view_mgr->fetch($this->view_template);
         }
     } else {
         throw new Exception('No view template specified');
     }
 }
Exemple #2
0
        } else {
            if ($od->doesOwnerExist($_POST['email'])) {
                $errormsg = "User account already exists.";
            } else {
                $es = new SmartyThinkTank();
                $es->caching = false;
                $activ_code = rand(1000, 9999);
                $cryptpass = $session->pwdcrypt($_POST['pass2']);
                $server = $_SERVER['HTTP_HOST'];
                $od->create($_POST['email'], $cryptpass, $_POST['country'], $activ_code, $_POST['full_name']);
                $es->assign('apptitle', $THINKTANK_CFG['app_title']);
                $es->assign('server', $server);
                $es->assign('site_root_path', $THINKTANK_CFG['site_root_path']);
                $es->assign('email', urlencode($_POST[email]));
                $es->assign('activ_code', $activ_code);
                $message = $es->fetch('_email.registration.tpl');
                Mailer::mail($_POST['email'], "Activate Your " . $THINKTANK_CFG['app_title'] . " Account", $message);
                echo $message;
                unset($_SESSION['ckey']);
                $successmsg = "Success! Check your email for an activation link.";
            }
        }
        $s->assign('name', $_POST["full_name"]);
        $s->assign('mail', $_POST["email"]);
    }
    $challenge = $captcha->generate($msg);
    $s->assign('captcha', $challenge);
}
if (isset($errormsg)) {
    $s->assign('errormsg', $errormsg);
} elseif (isset($successmsg)) {
Exemple #3
0
$od = DAOFactory::getDAO('OwnerDAO');
$s = new SmartyThinkTank();
$s->caching = false;
if (isset($_POST['Submit']) && $_POST['Submit'] == 'Send') {
    if ($od->doesOwnerExist($_POST['email'])) {
        $newpwd = rand(10000, 99999);
        $server = $_SERVER['HTTP_HOST'];
        $cryptpass = $session->pwdcrypt($newpwd);
        $od->updatePassword($_POST['email'], $cryptpass);
        $es = new SmartyThinkTank();
        $es->caching = false;
        $es->assign('apptitle', $config->getValue('app_title'));
        $es->assign('email', $_POST['email']);
        $es->assign('newpwd', $newpwd);
        $es->assign('server', $server);
        $es->assign('site_root_path', $config->getValue('site_root_path'));
        $message = $es->fetch('_email.forgotpassword.tpl');
        Mailer::mail($_POST['email'], "The " . $config->getValue('app_title') . " Account Details You Requested", $message);
        $successmsg = "Password recovery information has been sent to your email address. <a href=\"login.php\">Sign in.</a>";
    } else {
        $errormsg = "Account does not exist";
    }
}
if (isset($errormsg)) {
    $s->assign('errormsg', $errormsg);
} elseif (isset($successmsg)) {
    $s->assign('successmsg', $successmsg);
}
$db->closeConnection($conn);
$s->assign('site_root_path', $config->getValue('site_root_path'));
$s->display('session.forgot.tpl');
Exemple #4
0
$s = new SmartyThinkTank();
$c = new Crawler();
$conn = $db->getConnection();
// instantiate data access objects
$ud = new UserDAO($db);
$fd = new FollowDAO($db);
$td = new TweetDAO($db);
$c->init();
//TODO error checking here, is tweet in db, etc
$status_id = $_REQUEST['t'];
$s->assign('tweet', $td->getTweet($status_id));
$s->assign('replies', $td->getPublicRepliesToTweet($status_id));
$s->assign('cfg', $cfg);
# clean up
$db->closeConnection($conn);
echo $s->fetch('replies.public.tpl');
/*
$root_path			=  "../uar/includes/";
include $root_path.'environment.php';				# Determine relevant paths
include $root_path.'status_messages.php';			# Turn error code into message
include $root_path.'validate_data.php';				# Validate application data
include $root_path.'api_config.php';				# Configuring the API connection
include $root_path.'database.php';					# Connection to the database
#include $root_path.'sql_queries.php';				# Format the SQL queries
# include smarty
require('smarty/libs/Smarty.class.php');
# get user name from u param, default to ginatrapani
$status_id = $_REQUEST['t'];
# prep db
$db_connection 	= openDB();						# Open database connection
$sql_query		= "select tweet_text, author_username from tweet where status_id=".$status_id.";";	# Retrieve the SQL statements