예제 #1
0
 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');
         }
     }
 }
예제 #2
0
파일: login.php 프로젝트: arieh/tree-forum
	<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 
echo $login->getKey();
?>
"/>
		 		<input type='hidden' id='hash' name='hash' value='' />
		 	</dd>
		 </dl>
		 </fieldset>
		 </form>
		
		<script type='text/javascript' src='js/sha1.js'></script>
		<script type='text/javascript' src='js/loginForm.js'></script>
		<script type='text/javascript' src='js/mootools-1.2.1-core.js'></script>
		<script type='text/javascript'>
		<!--//
		$('login-form').addEvent('submit',function(){setEncryption()});
		//-->