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

/************************************
 * Cadence
 * Remotely Hosted Guestbook Script.
 * (c) 2006, Dennis Pedrie
 * www.CadenceBook.com
 * admin.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);
}

if($gbook->css_flat == true) {
	$tpl->assign('css',str_replace('{$tpl_path}',"templates/". $gbook->style,file_get_contents("templates/system/admin/styles.css.tpl")));
}
				
// Check Login Status. 
// Eventually, we'll need more authentication checks, but for now this'll do the trick.
if($gbook->is_book_owner == false) {
	header("location:index.php?book={$book}");
	exit;
}

// Set Theme Path
define("ADMIN_THEME","system/admin/");

//Set Variables
$acpact = $_GET['acpact'];

// Start Admin Class
include "class/admin.php";
$admin = new admin;

// Header
$tpl->display(ADMIN_THEME ."header.tpl");

$pages = array(
	'idx',			'posts',
	'users',		'options',
	'themes',);

if(!in_array($acpact, $pages) OR !isset($acpact) OR empty($acpact)) {
	$acpact = "idx";
}

$file = "sources/admin/". $acpact .".php";
if(file_exists($file)) {
	include $file;
}
else {
	trigger_error("Source File Does Not Exist",E_USER_ERROR);
}

// Footer
$tpl->display(ADMIN_THEME ."footer.tpl");
?>
Return current item: Cadence Guestbook Host