<html>
<head>
<style>
BODY {
margin: 0px;
font-family: sans-serif;
font-size: 12px;
}
TABLE {
font-family: sans-serif;
font-size: 12px;
}
H1 {
font-size: 9.5pt;
font-family: dingbats, tahoma, sans-serif, tahoma, helvetica;
color: #6999cb;
font-weight: bold;
}
H7 {
font-size: 9.5pt;
font-family: dingbats, tahoma, sans-serif, arial, helvetica;
color: #c99924;
font-weight: bold;
}
H2 {
font-size: 9.5pt;
font-family: dingbats, tahoma, sans-serif, arial, helvetica;
color: #6999cb;
font-weight: normal;
}
H3 {
font-size: 9.5pt;
font-family: dingbats, tahoma, sans-serif, arial, helvetica;
color: #6999cb;
font-weight: normal;
font-style: oblique;
}
TABLE.panel {
border-color:black;
border-style:solid;
border-width:1px ;
background-color: #84b0da;
padding:3px ;
width:600px;
}
TD.panel {
border-color: #5c8dbf;
border-style: solid;
border-width: 1px;
background-color: #fdfbf7;
padding: 6px;
vertical-align:top;
}
.textbox {
border-color:#96969d;
border-width:1px;
border-style:solid;
padding: 2px;
background: white;
}
DIV.submission {
background: #e9ddc2;
padding:4px;
border: solid 0px #8a4545;
height: 25px;
}
</style>
<title>Synergiser Installation</title>
</head>
<body style="background:gray;"><br/><br/>
<table class='panel' align='center'><tr><td class='panel'>
<h1>Synergiser Installation</h1>
<?php
function chmod_R($path, $filemode) {
if (!is_dir($path))
return chmod($path, $filemode);
$dh = opendir($path);
while ($file = readdir($dh)) {
if($file != '.' && $file != '..') {
$fullpath = $path.'/'.$file;
//echo $fullpath;
if(!is_dir($fullpath)) {
@chmod($fullpath, $filemode);
} else {
if (@!chmod_R($fullpath, $filemode))
return FALSE;
}
}
}
closedir($dh);
if(@chmod($path, $filemode))
return TRUE;
else
return FALSE;
}
?>
<?php if ($_GET['install']=="yes") {
echo "Installing Synergiser...";
include("./pcltar.lib.php");
PclTarExtract("./install.tar.gz", "./");
echo "Setting Permissions...";
chmod_R(".",0777);
echo "<b>OK</b>";
echo "<br/>";
if (file_exists('synergy/admin_style.css')) {
echo "<b>Synergiser has been extracted.</b>";
?>
<br/>
Congratulations! Synergiser has been installed.
<br/><br/>
<b> What to do now</b>: Firstly, <a href='index.php'>go to your site</a> and familiarize yourself with the admin panel (instructions on the default page). Then, you <B>MUST</b> make sure you <b>remove this install.php file!!</b> If not, your site could be erased by a malicious individual.
<br/><br/>
<?php
}
else {
echo "<B>I Cannot detect a synergiser installation... perhaps something went wrong</b>";
exit;
}
}
else {
?>
<p> To install Synergiser, please read the license below, and check you meet all requirements.</p>
<iframe src="http://www.gnu.org/licenses/gpl.txt" class='textbox' width=99% height=200px></iframe><br/>
<h2>Checking Requirements...</h2>
<?php
$compatible=true;
$version = explode('.', phpversion());
if ($version[0]=="4") {
if ($version[1]=="0") {
echo "Checking PHP Version..." . phpversion() . ".. <font color='red'>NOT COMPATIBLE</font>";
$compatible=false;
}
else
{
echo "Checking PHP Version..." . phpversion() . ".. <b>OK</b>";
}
}
if ($version[0]="5") {
echo "Checking PHP Version..." . phpversion() . ".. <b>OK</b>";
}
if (($version[0]!=5) && ($version[0]!=4)) {
echo "Checking PHP Version..." . phpversion() . ".. <font color='red'>NOT COMPATIBLE</font>";
$compatible=false;
}
echo "<br/>";
if (function_exists("curl_version")) {
$curl = curl_version();
echo "Checking if libcURL exists and can be accessed by PHP...Version " . $curl['version'] . "... <b>OK</b>";
}
else
{
echo "Checking if libcURL exists and can be accessed by PHP...<font color=red>Not Detected. RSS Module will fail</font>";
}
echo "<br/>";
if (function_exists("gzopen")) {
echo "Checking if zlib exists and can be accessed by PHP... <b>OK</b>";
}
else
{
echo "Checking if zlib exists and can be accessed by PHP... Not Detected. TinyMCE Editor will be slower to load.";
}
/**
* Get which version of GD is installed, if any.
*
* Returns the version (1 or 2) of the GD extension.
*/
function gdVersion($user_ver = 0)
{
if (! extension_loaded('gd')) { return; }
static $gd_ver = 0;
// Just accept the specified setting if it's 1.
if ($user_ver == 1) { $gd_ver = 1; return 1; }
// Use the static variable if function was called previously.
if ($user_ver !=2 && $gd_ver > 0 ) { return $gd_ver; }
// Use the gd_info() function if possible.
if (function_exists('gd_info')) {
$ver_info = gd_info();
preg_match('/\d/', $ver_info['GD Version'], $match);
$gd_ver = $match[0];
return $match[0];
}
// If phpinfo() is disabled use a specified / fail-safe choice...
if (preg_match('/phpinfo/', ini_get('disable_functions'))) {
if ($user_ver == 2) {
$gd_ver = 2;
return 2;
} else {
$gd_ver = 1;
return 1;
}
}
// ...otherwise use phpinfo().
ob_start();
phpinfo(8);
$info = ob_get_contents();
ob_end_clean();
$info = stristr($info, 'gd version');
preg_match('/\d/', $info, $match);
$gd_ver = $match[0];
return $match[0];
} // End gdVersion()
if ($gdv = gdVersion()) {
if ($gdv >=2) {
echo "<br/>Checking if GD exists and can be accessed by PHP...Version 2...<b>OK</b><br/>";
} else {
echo "<br/>Checking if GD exists and can be accessed by PHP...Version 1...Image Manager will be Disabled<br/>";
}
} else {
echo "<br/>Checking if GD exists and can be accessed by PHP...Not Found...Image Manager will be Disabled<br/>";
}
if (is_writable(getcwd())) {
echo "Checking if current directory is writable.. <b>OK</b>";
}
else
{
echo "Checking if current directory is writable.. <font color=red><b>Directory not writable. You may need to change permissions using <span style='font-family:monospace;'>chmod</span> or an FTP client.</b></font>";
$compatible=false;
}
echo "<br/>";
if (ini_get('register_globals')) {
echo "Checking if register_globals is off...<font color=red>Register globals is on. This may be a security risk</font>";
}
else
{
echo "Checking if register_globals is off...<b>OK</b>";
}
echo "<br/>";
?>
<script language='javascript'>
<!--
document.write('Checking Javascript..... <b>OK</b>');
-->
</script>
<noscript>
<b>Javascript is not enabled. Synergiser's administration requires Javascript.</b>
</noscript>
<br/>
If you see all <b>OK</b> above, you are ready to start installing.<br/>
<p><b>Note: Synergiser will install itself as soon as you click the button. Ensure you have everything set up to your liking beforehand.</b><br/><br/>
<div class='submission'>
<?php
if (!$compatible) {
echo "Your system is not compatible and therefore Synergiser will not install.";
}
else
{
echo "<input type='button' style='font-weight:bold;float:right;' value='Install!' onClick=\"document.location='install.php?install=yes';\">";
}
}
?>
</td></tr></table>
</body>
</html>