[Lambda-cvs] lambda authenticate.php,NONE,1.1 logout.php,NONE,1.1 overview.php,NONE,1.1 sidebar.php,
Status: Pre-Alpha
Brought to you by:
ariejan
From: Ariejan de V. <ar...@us...> - 2004-07-08 09:52:18
|
Update of /cvsroot/lambda/lambda In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14548 Modified Files: index.php stylesheet.css Added Files: authenticate.php logout.php overview.php sidebar.php siteheader.php Log Message: * Added *very* basic GUI * Added client/admin login and logout functionality * Updated stylesheet --- NEW FILE: sidebar.php --- <?php /** * GUI Sidebar - Navigation and messages to user * @package Lambda * @author Ariejan de Vroom <ar...@la...> * @copyright Copyright (C) 2004 Project Lambda * @version $Id: sidebar.php,v 1.1 2004/07/08 09:52:04 ariejan Exp $ * @link http://lambdahq.net */ include('includes/bootstrap.php'); if(!$session->login()) { header("Location: index.php"); } $content = "Sidebar"; $template->show("sidebar.tpl"); ?> Index: index.php =================================================================== RCS file: /cvsroot/lambda/lambda/index.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** index.php 7 Jul 2004 14:46:14 -0000 1.5 --- index.php 8 Jul 2004 09:52:04 -0000 1.6 *************** *** 13,21 **** if(!$session->login()) { ! $content = $template->fetch("login_box.tpl"); } else { ! header("Location: my.php"); } ! $template->show("page.tpl"); ?> \ No newline at end of file --- 13,21 ---- if(!$session->login()) { ! header("Location: authenticate.php"); } else { ! $template->show("guiframe.tpl"); } ! ?> \ No newline at end of file --- NEW FILE: authenticate.php --- <?php /** * Authenticate a client or admin. * @package Lambda * @author Ariejan de Vroom <ar...@la...> * @copyright Copyright (C) 2004 Project Lambda * @version $Id: authenticate.php,v 1.1 2004/07/08 09:52:04 ariejan Exp $ * @link http://lambdahq.net */ require_once('includes/bootstrap.php'); /* Form was not submitted. Show login form */ if(!isset($_POST['submit'])) { $content = $template->fetch("login_box.tpl"); } else { /* Form was submitted. Authenticate as admin or client */ /* Verify that both fields have been filled out */ if(empty($_POST['loginname']) || empty($_POST['password'])) { /* Show an error message */ $content = "<div class='error'>Please enter both your login name and password.</div>"; } else { /* Move loginname and password to local variables. MD5 Encrypt password */ $loginname = $_POST['loginname']; $password = md5($_POST['password']); /* Create a new instance of lambdeClient and try to authenticate the client */ $client = new lambdaClient(); if($client->authenticate($loginname, $password)) { /* Valid user */ $session->register_client($client); header("Location: index.php"); } else { /* Invalid user */ $content = "<div class='error'>Invalid login/password combination!</div>"; } } } $template->show("page.tpl"); ?> --- NEW FILE: logout.php --- <?php /** * Logout a client * @package Lambda * @author Ariejan de Vroom <ar...@la...> * @copyright Copyright (C) 2004 Project Lambda * @version $Id: logout.php,v 1.1 2004/07/08 09:52:04 ariejan Exp $ * @link http://lambdahq.net */ include('includes/bootstrap.php'); if(!$session->login()) { header("Location: index.php"); } $session->logout(); header("Location: index.php"); ?> --- NEW FILE: overview.php --- <?php /** * GUI Site header. General info about Lambda * @package Lambda * @author Ariejan de Vroom <ar...@la...> * @copyright Copyright (C) 2004 Project Lambda * @version $Id: overview.php,v 1.1 2004/07/08 09:52:04 ariejan Exp $ * @link http://lambdahq.net */ include('includes/bootstrap.php'); if(!$session->login()) { header("Location: index.php"); } $content = "<h1>".$client->get('name')."</h1>"; $template->show("page.tpl"); ?> --- NEW FILE: siteheader.php --- <?php /** * GUI Site header. General info about Lambda * @package Lambda * @author Ariejan de Vroom <ar...@la...> * @copyright Copyright (C) 2004 Project Lambda * @version $Id: siteheader.php,v 1.1 2004/07/08 09:52:04 ariejan Exp $ * @link http://lambdahq.net */ include('includes/bootstrap.php'); if(!$session->login()) { header("Location: index.php"); } $content = "<div class='header'>Project Lambda</div>" ."<div class='headerlinks'><a href='logout.php' target='_top'>Logout (".$client->get('login').")</a></div>"; $template->show("siteheader.tpl"); ?> Index: stylesheet.css =================================================================== RCS file: /cvsroot/lambda/lambda/stylesheet.css,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** stylesheet.css 7 Jul 2004 14:46:14 -0000 1.1 --- stylesheet.css 8 Jul 2004 09:52:04 -0000 1.2 *************** *** 4,6 **** --- 4,22 ---- font-size: 11px; color: #000000; + } + .header { + font-size: 24px; + font-weight: bolder; + } + .headerlinks { + float: right; + } + .error { + border: 1px solid #CC0000; + background-color: #FFFFCC; + padding: 5px; + margin: 5px; + font-weight: bold; + color: #FF0000; + font-size: 12px; } \ No newline at end of file |