2 /************************************************************************/
4 /************************************************************************/
5 /* Copyright (c) 2010 */
6 /* Inclusive Design Institute */
8 /* This program is free software. You can redistribute it and/or */
9 /* modify it under the terms of the GNU General Public License */
10 /* as published by the Free Software Foundation. */
11 /************************************************************************/
13 if (!defined('TR_INCLUDE_PATH')) { exit; }
15 if (isset($_POST['submit']) && ($_POST['action'] == 'process')) {
16 unset($_POST['submit']);
23 $file = '../include/config.inc.php';
28 if ( file_exists($file) ) {
30 if (!is_writeable($file)) {
31 $errors[] = '<strong>' . realpath($file) . '</strong> is not writeable.';
33 $progress[] = '<strong>' . realpath($file) . '</strong> is writeable.';
36 $errors[] = '<strong>' . $file . '</strong> does not exist.';
39 print_progress($step);
41 echo '<form action="'.$_SERVER['PHP_SELF'].'" method="post" name="form">';
42 echo ' <input type="hidden" name="action" value="process" />';
45 if (isset($progress)) {
46 print_feedback($progress);
48 print_errors($errors);
50 echo'<input type="hidden" name="step" value="'.$step.'" />';
52 unset($_POST['step']);
53 unset($_POST['action']);
57 echo '<p><strong>Note:</strong> To change permissions on Unix use <kbd>chmod a+rw</kbd> then the file name.</p>';
59 echo '<p align="center"><input type="submit" class="button" value=" Try Again " name="retry" />';
62 require('include/config_template.php');
64 $comments = '/*'.str_pad(' This file was generated by the AContent '.$new_version. ' installation script.', 70, ' ').'*/
65 /*'.str_pad(' File generated '.date('Y-m-d H:m:s'), 70, ' ').'*/';
67 if (!write_config_file('../include/config.inc.php', $comments)) {
68 echo '<input type="hidden" name="step" value="'.$step.'" />';
70 print_feedback($progress);
72 $errors[] = 'include/config.inc.php cannot be written! Please verify that the file exists and is writeable. On Unix issue the command <kbd>chmod a+rw include/config.inc.php</kbd> to make the file writeable. On Windows edit the file\'s properties ensuring that the <kbd>Read-only</kbd> attribute is <em>not</em> checked and that <kbd>Everyone</kbd> access permissions are given to that file.';
73 print_errors($errors);
75 echo '<p><strong>Note:</strong> To change permissions on Unix use <kbd>chmod a+rw</kbd> then the file name.</p>';
77 echo '<p align="center"><input type="submit" class="button" value=" Try Again " name="retry" />';
80 echo '<input type="hidden" name="step" value="'.$step.'" />';
83 $progress[] = 'Data has been saved successfully.';
85 @chmod('../include/config.inc.php', 0444);
87 print_feedback($progress);
89 echo '<p align="center"><input type="submit" class="button" value=" Next » " name="submit" /></p>';