Location: PHPKode > projects > chillyCMS > chillyCMS/admin/index.php
<?php
//#################################################################################################
//	Backend startpage
//#################################################################################################
//	chillyCMS - Content Management System
//	Copyright (C) 2008
//	Stefanie Wiegand <hide@address.com> & Johannes Cox <hide@address.com>
//	
//	This program is licensed under the GPL 3.0 license. For more information see LICENSE.txt.
//#################################################################################################
define('DOIT',true);

require_once("../core/session.backend.include.php");

//if not installed, send user to inatallation routine
if(!defined("DB_HOST")) {
	header("Location: ../installation/index.php");
	exit(0);
}

//check whether to update the updater (cannot be done within the updater)
if (is_dir(PATH.'/tmp/newupdater')) {
	$page->debug('Updating updater...');
	$error = false;
	//copy new files over old files
	$src = PATH.'/tmp/newupdater/tools.include.php';
	if (file_exists($src)) {
		$dest = PATH.'/admin/tools.include.php';
		$page->debug('Copying tools.include.php...');
		if (!copy($src, $dest)) { $error = true; }
	}
	$src = PATH.'/tmp/newupdater/tools.site.php';
	if (file_exists($src)) {
		$dest = PATH.'/admin/tools.site.php';
		$page->debug('Copying tools.site.php...');
		if (!copy($src, $dest)) { $error = true; }
	}
	if (!$error) {
		delete_recursively(PATH.'/tmp/oldupdater');
		delete_recursively(PATH.'/tmp/newupdater');
		$page->debug('Updater updated','success');
	} else {
		$page->debug('Error updating updater','error');
	}
}

if (isset($_POST["action"])) {
	if ($_POST["action"]=="delete") {
		//delete installation folder
		if (delete_recursively(PATH."/installation")) { $msg=array($l_gen["msg_delinstdir_ok"],"good"); }
		else { $msg=array($l_gen["msg_delinstdir_err"],"bad"); }
	}
}
if (isset($_GET["nicetry"])) { $msg = array($l_gen["msg_nicetry_err"],"bad"); } else { $msg = false; }

$page->print_head();

$page->add("\t<h1>$l_gen[txt_welcome]</h1><br />\n".
"\t<p>$l_gen[txt_welcometo]</p><br />\n".
"\t<a href='help.site.php'><b>$l_gen[txt_help]</b></a><br /><br />\n");
if(is_dir(PATH."/installation")) { $handle = opendir(PATH."/installation"); }
//delete installation folder button
if (isset($handle) && $handle) {
	$page->add("\t<p>$l_gen[txt_delete_instdir]</p><br />\n".
	"\t<form method='post' action='index.php'>\n".
	"\t\t<input type='hidden' name='action' value='delete'></input>\n".
	"\t\t<input type='submit' class=\"button\" value='$l_gen[lbl_deletebutton]'></input>\n".
	"\t</form><br />\n");
}
$page->print_body($msg);
?>
Return current item: chillyCMS