Location: PHPKode > projects > Cadence Guestbook Host > cadence/sources/login.php
<?php

/************************************
 * Cadence
 * Remotely Hosted Guestbook Script.
 * (c) 2006, Dennis Pedrie
 * www.CadenceBook.com
 * login.php
 ***********************************
 * Cadence Guestbook is licensed under
 * a Creative Commons License.
 * More information is available by visiting
 * http://creativecommons.org/licenses/by/3.0/
 * or the LICENSE file in the Cadence Root Folder
 ***********************************/

if(!defined('IN_CADENCE')) {
	trigger_error("You may not access this file directly",E_USER_ERROR);
}

//Clean Vars
$email = $post->clean_var($_POST['email']);
$pass = $post->clean_var($_POST['pass']);
$code = $post->clean_var($_GET['code']);
	
//Login
if($code == 00) {
	//Process Login.
	if($login->dologin($email,$pass)) {
		header("location:index.php?book=". $book);
	}
	else {
		header("location:index.php?book=". $book);
	}
}
	
//Logout
if($code == 01) {
	$login->dologout();
	header("location:index.php?book=". $book);
}

//Approve Comment
if($code == 02) {
	//Header
	$tpl->display($gbook->style .'/header.tpl',$book);
	
	$approve = $post->clean_var(intval($_GET['approve']));
	$id = $db->get_var($q->getappid($approve));
	if($db->num_rows > 0) {
		$db->query($q->approve($id));
		echo "Post Approved. Click <a href='index.php?book=$book'>here</a> to continue.";
	}
	
	//Footer
	$tpl->display($gbook->style .'/footer.tpl');
}
Return current item: Cadence Guestbook Host