[Ataraxis-checkins] SF.net SVN: ataraxis: [22] core
Status: Planning
Brought to you by:
klarinetking
|
From: <kla...@us...> - 2006-07-31 01:50:54
|
Revision: 22 Author: klarinetking Date: 2006-07-30 18:50:37 -0700 (Sun, 30 Jul 2006) ViewCVS: http://svn.sourceforge.net/ataraxis/?rev=22&view=rev Log Message: ----------- More work on the layout. We really need to change the colours. Modified Paths: -------------- core/common.inc.php core/inc/classes/class.auth.db.php core/inc/classes/class.session.php core/inc/functions.inc.php core/index.php core/login.php core/templates/footer.inc.tpl core/templates/header.inc.tpl core/templates/indexBody.inc.tpl core/templates/loginForm.inc.tpl core/templates/stylesheet.css Added Paths: ----------- core/templates/searchForm.inc.tpl Modified: core/common.inc.php =================================================================== --- core/common.inc.php 2006-07-30 17:16:14 UTC (rev 21) +++ core/common.inc.php 2006-07-31 01:50:37 UTC (rev 22) @@ -5,6 +5,8 @@ * @package core */ +$startTime = microtime(); + $rootPath = './'; /** Modified: core/inc/classes/class.auth.db.php =================================================================== --- core/inc/classes/class.auth.db.php 2006-07-30 17:16:14 UTC (rev 21) +++ core/inc/classes/class.auth.db.php 2006-07-31 01:50:37 UTC (rev 22) @@ -41,7 +41,7 @@ public function check ($username, $password) { - $sql = "SELECT * + $sql = "SELECT `username`, `password`, `user_id` FROM `users` WHERE `username` = '$username' AND `password` = '$password' Modified: core/inc/classes/class.session.php =================================================================== --- core/inc/classes/class.session.php 2006-07-30 17:16:14 UTC (rev 21) +++ core/inc/classes/class.session.php 2006-07-31 01:50:37 UTC (rev 22) @@ -125,10 +125,10 @@ * * Destroys a previously created session. * - * @access private + * @access public */ - private function destroySession ($sid) + public function destroySession ($sid) { $sql = "DELETE FROM `sessions` WHERE (`session_id` = '$sid')"; Modified: core/inc/functions.inc.php =================================================================== --- core/inc/functions.inc.php 2006-07-30 17:16:14 UTC (rev 21) +++ core/inc/functions.inc.php 2006-07-31 01:50:37 UTC (rev 22) @@ -16,9 +16,26 @@ function pageHeader ($title) { - global $template; + global $template, $settings; - $template->assign('lTitle', $title); + $template->assign('lTitle', $settings->get('general.sitename') . ' :: ' . $title); + $template->assign('lSiteName', $settings->get('general.sitename')); $template->display('header.inc.tpl'); } + +function pageFooter () +{ + global $template, $startTime; + + $endTime = microtime(); + $totalTime = $endTime - $startTime; + $totalTime = substr($totalTime, 0, 6); + + $template->assign(array( + 'lCopyright' => 'This system powered by the <a href="http://ataraxis.sourceforge.net" target="_blank">Ataraxis Blogging System</a>', + 'vLoadTime' => 'Load Time: ' . $totalTime . 's') + ); + + $template->display('footer.inc.tpl'); +} ?> \ No newline at end of file Modified: core/index.php =================================================================== --- core/index.php 2006-07-30 17:16:14 UTC (rev 21) +++ core/index.php 2006-07-31 01:50:37 UTC (rev 22) @@ -9,6 +9,20 @@ pageHeader('Index'); +if ( $session->loggedOn == TRUE ) +{ + $template->assign('loggedOn', 'True'); +} + +$template->assign(array( + 'vUsername' => $user->info->username, + + 'lLogout' => '(Logout)', + + 'uLogout' => appendSid('./login.php?logout=true')) +); + $template->display('indexBody.inc.tpl'); -$template->display('footer.inc.tpl'); + +pageFooter(); ?> \ No newline at end of file Modified: core/login.php =================================================================== --- core/login.php 2006-07-30 17:16:14 UTC (rev 21) +++ core/login.php 2006-07-31 01:50:37 UTC (rev 22) @@ -11,13 +11,21 @@ $authFactory = new authFactory($registry); $auth = $authFactory->getAuth($registry); -// @todo: clean variables later +if ( isset($_GET['logout']) && !empty($_GET['logout']) && $_GET['logout'] == 'true') +{ + $session->destroySession($_GET['sid']); + echo "Click <a href='./index.php'>here</a> to go back"; +} +else +{ + // @todo: clean variables later -$username = $_POST['loginUsername']; -$password = md5($_POST['loginPassword']); + $username = $_POST['loginUsername']; + $password = md5($_POST['loginPassword']); -$auth->check($username, $password); + $auth->check($username, $password); -$home = appendSid('./index.php'); -echo "Click <a href='$home'>here</a> to go back"; + $home = appendSid('./index.php'); + echo "Click <a href='$home'>here</a> to go back"; +} ?> \ No newline at end of file Modified: core/templates/footer.inc.tpl =================================================================== --- core/templates/footer.inc.tpl 2006-07-30 17:16:14 UTC (rev 21) +++ core/templates/footer.inc.tpl 2006-07-31 01:50:37 UTC (rev 22) @@ -1,3 +1,16 @@ - + + <div id="footer"> + <p> + {$lCopyright} + </p> + <p> + {$vLoadTime} + </p> + <p> + <a href="{$uAdmin}">{$lAdmin}</a> + </p> + </div> + </div> + </div> </body> </html> \ No newline at end of file Modified: core/templates/header.inc.tpl =================================================================== --- core/templates/header.inc.tpl 2006-07-30 17:16:14 UTC (rev 21) +++ core/templates/header.inc.tpl 2006-07-31 01:50:37 UTC (rev 22) @@ -10,6 +10,6 @@ <body> <div id="header"> <h1> - This is the header + {$lSiteName} </h1> </div> \ No newline at end of file Modified: core/templates/indexBody.inc.tpl =================================================================== --- core/templates/indexBody.inc.tpl 2006-07-30 17:16:14 UTC (rev 21) +++ core/templates/indexBody.inc.tpl 2006-07-31 01:50:37 UTC (rev 22) @@ -1,3 +1,4 @@ + <div id="wrapper1"> <div id="wrapper2"> <div id="maincol"> @@ -3,25 +4,33 @@ <div id="leftcol"> <p> - This is the left column + What should go here? </p> + <p> + I think maybe a blogroll + </p> + <p> + Possibly links to other pages + </p> </div> <div id="rightcol"> <p> -{include file="loginForm.inc.tpl"} - + {if $loggedOn == True} + Welcome {$vUsername}<br /> + <a href="{$uLogout}">{$lLogout}</a> + {else} + {include file="loginForm.inc.tpl"} + {/if} </p> + <p> + Probably the archives over here, but that can change + </p> + <p> + {include file="searchForm.inc.tpl"} + </p> </div> - <div id="centercol"> <p> - This is the center column + Main posts in here, duh </p> </div> - </div> - <div id="footer"> - <p> - This is the footer - </p> - </div> - </div> - </div> \ No newline at end of file + </div> \ No newline at end of file Modified: core/templates/loginForm.inc.tpl =================================================================== --- core/templates/loginForm.inc.tpl 2006-07-30 17:16:14 UTC (rev 21) +++ core/templates/loginForm.inc.tpl 2006-07-31 01:50:37 UTC (rev 22) @@ -1,6 +1,6 @@ - <form action="login.php" method="POST"> - <b>Username</b><input type="text" name="loginUsername"><br /> - <b>Password</b><input type="password" name="loginPassword"><br /> - <input type="submit" name="loginSubmit" value="Login"> - <input type="reset" name="loginReset" value="Reset"> - </form> \ No newline at end of file +<form action="login.php" method="POST"> + <b>Username</b><input type="text" name="loginUsername"><br /> + <b>Password</b><input type="password" name="loginPassword"><br /> + <input type="submit" name="loginSubmit" value="Login"> + <input type="reset" name="loginReset" value="Reset"> +</form> \ No newline at end of file Added: core/templates/searchForm.inc.tpl =================================================================== --- core/templates/searchForm.inc.tpl (rev 0) +++ core/templates/searchForm.inc.tpl 2006-07-31 01:50:37 UTC (rev 22) @@ -0,0 +1,5 @@ +<form action="search.php" method="POST"> + <b>Search Query</b><input type="text" name="searchQuery"><br /> + <input type="submit" name="searchSubmit" value="Search"> + <input type="reset" name="searchReset" value="Reset"> +</form> \ No newline at end of file Modified: core/templates/stylesheet.css =================================================================== --- core/templates/stylesheet.css 2006-07-30 17:16:14 UTC (rev 21) +++ core/templates/stylesheet.css 2006-07-31 01:50:37 UTC (rev 22) @@ -127,5 +127,5 @@ margin: 0; padding: 1% 0; text-align: center; - color: #CCC; + color: #FFFFFF; } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |