protected function executeBefore()
 {
     $this->addTitle('Tree-Forum Example');
     if (TFRouter::getEnv() == 'xhtml') {
         $this->addJS('mootools-1.2.1-core');
         $this->_view->assign('css', $this->_css);
         $this->_view->assign('title', $this->_title);
         $this->_output .= $this->_view->fetch('header' . DIRECTORY_SEPARATOR . 'xhtml' . DIRECTORY_SEPARATOR . 'main.tpl.php');
         if (TFUser::isLoggedIn() == false) {
             $this->addJS('loginForm', 'sha1');
             $userM = new UserM();
             $userM->execute();
             $this->_view->assign('key', $userM->getKey());
             $this->_output .= $this->_view->fetch('header' . DIRECTORY_SEPARATOR . 'xhtml' . DIRECTORY_SEPARATOR . 'menu' . DIRECTORY_SEPARATOR . 'login-form.tpl.php');
         } else {
             $this->_output .= $this->_view->fetch('header' . DIRECTORY_SEPARATOR . 'xhtml' . DIRECTORY_SEPARATOR . 'menu' . DIRECTORY_SEPARATOR . 'main.tpl.php');
         }
     }
 }
Example #2
0
<?php

ob_start();
define("_SEP_", DIRECTORY_SEPARATOR);
define("_DEBUG_", true);
require_once 'autoloader.php';
require_once 'errorHandler.php';
require_once ".." . _SEP_ . "classes" . _SEP_ . "library" . _SEP_ . 'firePHP' . _SEP_ . "fb.php";
NewDao::connect('mysql', ".." . _SEP_ . "configs" . _SEP_ . "db.ini");
NewDao::setLogger(array('FB', 'log'));
session_start();
$login = new UserM(array('action' => 'generate'));
$login->execute();
?>
<!doctype html>
<html>
	<head>
		<title>Login Page</title>
	</head>
	<body>
		 use username:arieh/ pass:12345
		 <form id='login-form' action="user/login" method='post'>
		 <fieldset>
		 <dl>
		 	<dt>user-name:</dt>
		 	<dd><input type='text' name='user-name' id='userName'/></dd>
		 	<dt>password</dt>
		 	<dd><input type='password' name='pass' id='pass' /></dd>
		 	<dd>
		 		<input type='submit' value='login'/>
		 		<input type='hidden' id='tempKey' value = "<?php