<?php
/*
 ########################################################################
#                                                                        #
#           Version 4       /                        /   /               #
#          -----------__---/__---__------__----__---/---/-               #
#           | /| /  /___) /   ) (_ `   /   ) /___) /   /                 #
#          _|/_|/__(___ _(___/_(__)___/___/_(___ _/___/___               #
#                       Free Content / Management System                 #
#                                   /                                    #
#                                                                        #
#                                                                        #
#   Copyright 2005-2006 by webspell.org                                  #
#                                                                        #
#   visit webSPELL.org, webspell.info to get webSPELL for free           #
#   - Script runs under the GNU GENERAL PUBLIC LICENSE                   #
#   - It's NOT allowed to remove this copyright-tag                      #
#   -- http://www.fsf.org/licensing/licenses/gpl.html                    #
#                                                                        #
#   Code based on WebSPELL Clanpackage (Michael Gruber - webspell.at),   #
#   Far Development by Development Team - webspell.org                   #
#                                                                        #
#   visit webspell.org                                                   #
#                                                                        #
 ########################################################################
*/
?>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr align="left" valign="top">
        <td>Checking CHMOD: </td>
        <td rowspan="2"><div style="overflow:scroll;height:450px"><table align="center" border="0" width="100%">
          <tr>
            <td class="item">Checking requirements:</td>
            <td align="left">&nbsp;</td>
          </tr>
          <tr>
            <td class="item">PHP version >= 4.2.0</td>
            <td align="left"><?php echo phpversion() < '4.2' ? '<b><font color="red" size="2">No</font></b>' : '<b><font color="green" size="2">Yes</font></b>';?></td>
          </tr>
          <tr>
            <td class="item">MySQL support</td>
            <td align="left"><?php echo function_exists( 'mysql_connect' ) ? '<b><font color="green" size="2">Available</font></b>' : '<b><font color="red" size="2">Unavailable</font></b>';?></td>
          </tr>
          <tr>
            <td class="item">&nbsp;</td>
            <td align="left">&nbsp;</td>
          </tr>
          <tr>
            <td class="item">_mysql.php </td>
            <td align="left"><?php
	if (@file_exists('../_mysql.php') &&  @is_writable( '../_mysql.php' )){
		echo '<b><font color="green" size="2">Writeable</font></b>';
	} else if (is_writable( '..' )) {
		echo '<b><font color="green" size="2">Writeable</font></b>';
	} else {
		echo '<b><font color="red" size="2">Unwriteable</font></b><br /><span class="small">_mysql.php has to be writeable or webspell cannot be installed.</span>';
    } ?>
            </td>
          </tr>
          <tr>
            <td>_settings.php </td>
            <td align="left"><?php
	if (@file_exists('../_settings.php') &&  @is_writable( '../_settings.php' )){
		echo '<b><font color="green" size="2">Writeable</font></b>';
	} else if (is_writable( '..' )) {
		echo '<b><font color="green" size="2">Writeable</font></b>';
	} else {
		echo '<b><font color="red" size="2">Unwriteable</font></b><br /><span class="small">_settings.php has to be writeable or webspell cannot be installed.</span>';
    } ?>
            </td>
          </tr>
          <tr>
            <td valign="top" class="item">_stylesheet.css </td>
            <td align="left"><?php
	if (@file_exists('../_stylesheet.css') &&  @is_writable( '../_stylesheet.css' )){
		echo '<b><font color="green" size="2">Writeable</font></b>';
	} else if (is_writable( '..' )) {
		echo '<b><font color="green" size="2">Writeable</font></b>';
	} else {
		echo '<b><font color="red" size="2">Unwriteable</font></b><br /><span class="small">_stylesheet.css has to be writeable or webspell will not be working correctly.</span>';
    } ?>
            </td>
          </tr>
          <tr>
            <td colspan="2" valign="top" class="item">&nbsp;</td>
          </tr><tr><td colspan="2" valign="top" class="item"><b>Setting chmod...</b></td><tr>
          	<tr><td colspan="2" valign="top" class="item">
<?php
$chmodfiles = Array('admin/games.php','admin/partners.php','admin/ranks.php','admin/rubrics.php','myprofile.php','admin/styles.php','admin/squads.php','admin/static.php','admin/update.php','demos/','downloads/','upload.php','sponsors.php','partners.php','html/','tmp/','admin/gallery.php','images/gallery/large','images/gallery/thumb','usergallery.php','images/bannerrotation','admin/smileys.php','admin/countries.php','admin/bannerrotation.php','demos.php','install/step06.php','images/flags','images/articles-pics','images/news-pics','images/news-rubrics','images/avatars','images/userpics','images/squadicons','images/partners','images/links','images/linkus','images/games','images/icons/ranks','images/banner','images/clanwar-screens','images/smileys','images/sponsors','_mysql.php','_stylesheet.css');
sort($chmodfiles);
foreach($chmodfiles as $file) {
 echo '-> '.$file.'<br>';
 if(!@chmod('../'.$file, 0777)) $error[]=$file.'<br>';
}
?>        
					</td></tr>
					<tr>
            <td colspan="2" valign="top" class="item">&nbsp;</td>
          </tr>
          <tr>
<?php
if($error) {
	sort($error);
  echo '<td colspan="2" valign="top" class="item"><b>There are some errors.</b> <br>Please ensure, that following folders are completely writeable (CHMOD 777):</td>';
  foreach($error as $value) echo '<tr><td valign="top" class="item"><font color="red" size="2">'.$value.'</font></td><td align="left"></td></tr>';
} else echo '<td colspan="2" valign="top" class="item"><font color="green">Successfully done!</font></td>';
?>		
					</tr>
        </table>
        </div>
       </td>
      </tr>
    </table>
Automatic CHMOD failed! Please set CHMOD 777 to folders and CHMOD 766 to files shown above.
<input type="hidden" name="hp_url" value="<?php echo str_replace('http://','',$_POST['hp_url']); ?>">
  <br><br><a href="javascript:document.ws_install.submit()"><img src="images/continue.gif" width="136" height="28" border="0"></a>