SF.net SVN: postfixadmin:[759] trunk
Brought to you by:
christian_boltz,
gingerdog
From: <Seb...@us...> - 2009-11-06 19:16:33
|
Revision: 759 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=759&view=rev Author: Sebastian2009 Date: 2009-11-06 19:16:14 +0000 (Fri, 06 Nov 2009) Log Message: ----------- - accidentially deleted header.php. Needed for setup - add some error checks. Modified Paths: -------------- trunk/common.php trunk/setup.php Added Paths: ----------- trunk/templates/header.php Modified: trunk/common.php =================================================================== --- trunk/common.php 2009-11-05 15:03:11 UTC (rev 758) +++ trunk/common.php 2009-11-06 19:16:14 UTC (rev 759) @@ -63,6 +63,9 @@ spl_autoload_register('postfixadmin_autoload'); //***** +if(!is_file("$incpath/smarty.inc.php")) { + die("smarty.inc.php is missing! Sonething is wrong..."); +} require_once ("$incpath/smarty.inc.php"); //***** /* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ Modified: trunk/setup.php =================================================================== --- trunk/setup.php 2009-11-05 15:03:11 UTC (rev 758) +++ trunk/setup.php 2009-11-06 19:16:14 UTC (rev 759) @@ -143,6 +143,17 @@ } // +// Check if templates directory is writable +// + +if (!is_writeable($incpath.'/templates_c')) +{ + print "<li><b>Error: The subdirectory templates_c is not writable.</b><br />\n"; + print "Please make it writable.<br />\n"; + $error =+ 1; +} + +// // Check if there is support for at least 1 database // if (($f_mysql_connect == 0) and ($f_mysqli_connect == 0) and ($f_pg_connect == 0)) Added: trunk/templates/header.php =================================================================== --- trunk/templates/header.php (rev 0) +++ trunk/templates/header.php 2009-11-06 19:16:14 UTC (rev 759) @@ -0,0 +1,62 @@ +<?php if( !defined('POSTFIXADMIN') ) die( "This file cannot be used standalone." ); ?> +<?php +@header ("Expires: Sun, 16 Mar 2003 05:00:00 GMT"); +@header ("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT"); +@header ("Cache-Control: no-store, no-cache, must-revalidate"); +@header ("Cache-Control: post-check=0, pre-check=0", false); +@header ("Pragma: no-cache"); +@header ("Content-Type: text/html; charset=UTF-8"); +?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<?php +if (file_exists (realpath ("../".$CONF['theme_css']))) { + print "<link rel=\"stylesheet\" type=\"text/css\" href=\"../".htmlentities($CONF['theme_css'])."\" />\n"; +} else { + print "<link rel=\"stylesheet\" type=\"text/css\" href=\"".htmlentities($CONF['theme_css'])."\" />\n"; +} +?> +<title>Postfix Admin - <?php print $_SERVER['HTTP_HOST']; ?></title> +</head> +<body> +<div id="login_header"> +<?php +if (file_exists (realpath ("../".$CONF['theme_logo']))) +{ + print "<img id=\"login_header_logo\" src=\"../".htmlentities($CONF['theme_logo'])."\" />\n"; +} else { + print "<img id=\"login_header_logo\" src=\"".htmlentities($CONF['theme_logo'])."\" />\n"; +} + +if (($CONF['show_header_text'] == "YES") and ($CONF['header_text'])) +{ + print "<h2>" . $CONF['header_text'] . "</h2>\n"; +} +?> +</div> + +<?php +if(isset($_SESSION['flash'])) { + if(isset($_SESSION['flash']['info'])) { + echo '<ul class="flash-info">'; + foreach($_SESSION['flash']['info'] as $msg) { + echo "<li>$msg</li>"; + } + echo '</ul>'; + } + if(isset($_SESSION['flash']['error'])) { + echo '<ul class="flash-error">'; + foreach($_SESSION['flash']['error'] as $msg) { + echo "<li>$msg</li>"; + } + echo '</ul>'; + } + /* nuke it from orbit. It's the only way to be sure. */ + $_SESSION['flash'] = array(); +} + +/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |