Location: PHPKode > projects > ACollab > install/include/step4.php
<?php
/****************************************************************************************/
/* ACollab                                                                              */
/****************************************************************************************/
/* Copyright (c) 2002-2005  Adaptive Technology Resource Centre / University of Toronto */
/*                                                                                      */
/* http://atutor.ca/acollab                                                             */
/*                                                                                      */
/* This program is free software. You may redistribute it and/or                        */
/* modify it under the terms of the GNU General Public License                          */
/* as published by the Free Software Foundation; either version 2 of the License,       */
/* or (at your option) any later version.                                               */
/*                                                                                      */
/* This program is distributed in the hope that it will be useful, but                  */
/* WITHOUT ANY WARRANTY; without even the implied warranty of                           */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                                 */
/* See the GNU General Public License for more details.                                 */
/*                                                                                      */
/* You may access the GNU General Public License at:                                    */
/* http://www.opensource.org/licenses/gpl-license.php                                   */
/*                                                                                      */
/* You may contact the Adaptive Technology Resource Centre at                           */
/* Robarts Library, University of Toronto                                               */
/* 130 St. George Street, Toronto, Ontario, Canada M5S 1A5                              */
/* Further contact information is available at http://www.utoronto.ca/atrc/             */
/****************************************************************************************/
/* Programmer:                                                                          */
/* Joel Kronenberg - ATRC                                                               */
/****************************************************************************************/
// $Id: step4.php 464 2005-03-09 20:23:57Z shozubq $

if (!defined('AC_INCLUDE_PATH')) { exit; }

print_progress($step);

	unset($errors);

    $writeable = array('include/config.inc.php', 'chat/', 'chat/msgs/', 'chat/users/', 'chat/tran/', 'chat/admin.settings', $_POST['step3']['upload_dir']);

    foreach ($writeable as $file) {
        if (!is_dir('../'.$file)) {
            if ( file_exists('../'.$file) ) {
                @chmod('../'.$file, 0666);
                if (!is_writeable('../'.$file)) {
					$errors[] = '<b>'.$file . '</b> is not writeable.';
                }else{
                    $progress[] = '<b>'.$file.'</b> is writeable.';
                }
            }
        } else {
            @chmod('../'.$file, 0777);
            if (!is_writeable('../'.$file)) {
				$errors[] = '<b>'.$file . '</b> is not writeable.';
            }else{
                $progress[] = '<b>'.$file.'</b> is writeable.';
            }
        }
    }

echo '<form action="'.$_SERVER['PHP_SELF'].'" method="post" name="form">';

if (isset($errors)) {
	if (isset($progress)) {
		print_feedback($progress);
	}
	print_errors($errors);

	echo'<input type="hidden" name="step" value="'.$step.'" />';

	unset($_POST['step']);
	unset($_POST['action']);
	print_hidden($step);

	echo '<p><strong>Note:</strong> To change permissions on Unix use <kbd>chmod a+rwx</kbd> then the file or directory name.</p>';

	echo '<p align="center"><input type="submit" class="button" value=" Try Again " name="retry" />';

} else {
	echo '<input type="hidden" name="step" value="'.($step+1).'" />';

	unset($_POST['step']);
	unset($_POST['action']);
	print_hidden($step);

	require('include/config_template.php');
		
	$comments = '/*'.str_pad(' This file was generated by the ACollab '.$new_version. ' installation script.', 70, ' ').'*/
/*'.str_pad(' File generated '.date('Y-m-d H:m:i'), 70, ' ').'*/';

	write_config_file('../include/config.inc.php', $comments);
	$progress[] =  'Data has been saved successfully.';

	@chmod('../include/config.inc.php', 0444);

	if (substr($_POST['step3']['upload_dir'], -1) != '/') {
		$slash = '/';
	}
	for($i=1; $i<10; $i++) {
		@mkdir(urldecode($_POST['step3']['upload_dir']).$slash.$i);
	}

	print_feedback($progress);

	echo '<p align="center"><input type="submit" class="button" value=" Next ยป " name="submit" />';
}

?>

</form>
Return current item: ACollab