<?PHP
session_start();
if(isset($_GET['clearcache'])) {
session_destroy();
header("Location:install.php");
}
if(isset($_POST['doc_root'])) {
$_SESSION['doc_root'] = $_POST['doc_root'];
}
else
{
$_SESSION['doc_root'] = substr($_SERVER['PATH_TRANSLATED'],0,strlen($_SERVER['PATH_TRANSLATED']) - 19);
}
$continue = 0;
function CheckMe($setting) {
if($setting) {
$answer = "<STRONG><FONT COLOR=GREEN>YES</STRONG></FONT>";
} else {
$answer = "<STRONG><FONT COLOR=RED>NO</STRONG></FONT>";
$continue = 1;
}
return $answer;
}
function check_perms($path,$perm)
{
$configmod = substr(sprintf('%o', fileperms($path)), -4);
if($configmod != $perm) {
echo "<tr style=background-color:#fd7a7a;\">";
echo "<td style=\"border:0px;\">". $path ."</td>";
echo "<td style=\"border:0px;\">$perm</td>";
echo "<td style=\"border:0px;\">$configmod</td>";
echo "</tr>";
global $continue;
$continue = 1;
}
else
{
echo "<tr style=background-color:#91f587;\">";
echo "<td style=\"border:0px;\">". $path ."</td>";
echo "<td style=\"border:0px;\">$perm</td>";
echo "<td style=\"border:0px;\">$configmod</td>";
echo "</tr>";
}
return $continue;
}
$gd = function_exists("imagecreatefromjpeg");
$imap = function_exists("imap_open");
$mysql = function_exists("mysql_connect");
?>
<style type="text/css">
<!--
.style4 {
color: #FF0000;
font-weight: bold;
}
-->
</style>
<div align="center">
<p>ShoutCONTROL Installer</p>
<p><strong>Check 1: Installed Libraries </strong><br>
This check will make sure that all the needed PHP libraries are installed. </p>
<pre><table width="260" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="240"> </td>
<td width="20"> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td>MySQL Libraries .......</td>
<td><?=CheckMe($mysql)?></td>
</tr>
</table>
</pre>
<p><strong>Check 2: Physical Paths </strong><br>
This check makes sure that your install directory is the correct directory. <br>
Most of the time this can be auto detected, but if it's not, make sure to manually change it below.
<br />
<strong>WARNING</strong>: This directive <strong>MUST</strong> end with a trailing /! <br>
</p>
Root Directory: <br>
<form method="post" action="install.php">
<input name="doc_root" type="text" id="doc_root" value="<?= $_SESSION['doc_root'] ?>" size="80">
<input type="submit" name="Submit" value="Change">
</form>
<p> </p>
<p><strong>Check 3: Folders Writable </strong><br>
This check makes sure that all the folders have the correct permissions.<br>
If one of your folders does not have the correct permissions, you can change it by using the command CHMOD.<br>
We've tried to automatically do this for you, but if it didn't work, it will show below.</p>
<p><strong>IN ORDER FOR THE SCRIPTS TO WORK, YOU MUST RECURSIVELY CHMOD THE ROOT DIRECTORY 0777! </strong></p>
<table width="75%" border="0" cellspacing="0" cellpadding="3" style="text-align:center;">
<tr>
<th style="border:0px;"><b>File Name</b></th>
<th style="border:0px;"><b>Needed Chmod</b></th>
<th style="border:0px;"><b>Current Chmod</b></th>
</tr>
<?php
chmod($_SESSION['doc_root']."","0777");
chmod($_SESSION['doc_root']."bin/sc_nix/sc_serv","0777");
chmod($_SESSION['doc_root']."bin/conf/default.conf","0777");
chmod($_SESSION['doc_root']."bin/conf","0777");
check_perms($_SESSION['doc_root']."","0777");
?>
</table>
<?PHP
if($continue != "1") {
?>
<p> </p>
<form name="form1" method="post" action="install2.php">
<label>
<input type="submit" name="Submit2" value="Step 2: DB Config ->">
</label>
</form>
<p>
<?PHP
} else {
?>
</p>
<p class="style4">You need to fix any errors on this page before continuing. </p>
<p></p>
<?PHP
}
?>
</div>