From 2284461dedce7b1562f75dffa7ec615a8e4f319d Mon Sep 17 00:00:00 2001 From: bradymiller Date: Thu, 19 Feb 2009 08:49:53 +0000 Subject: [PATCH] remove directory checking, no longer required --- setup.php | 104 ++++++++++++++++++++++++++------------------------------------ 1 file changed, 44 insertions(+), 60 deletions(-) diff --git a/setup.php b/setup.php index 3fb2ecd77..04a7764cd 100644 --- a/setup.php +++ b/setup.php @@ -10,6 +10,10 @@ $upgrade = 0; $defhost = 'localhost'; $state = $_POST["state"]; +//If having problems with file and directory permission +// checking, then can be manually disabled here. +$checkPermissions = "TRUE"; + //Below section is only for variables that require a path. // The $manualPath variable can be edited by 3rd party // installation scripts to manually set path. (this will @@ -31,7 +35,7 @@ $gaclSetupScript1 = $manualPath."gacl/setup.php"; $gaclSetupScript2 = $manualPath."acl_setup.php"; //These are files and dir checked before install for -// existence and correct permissions. +// correct permissions. $writableFileList = array($conffile, $conffile2, $gaclConfigFile1, $gaclConfigFile2); $writableDirList = array($docsDirectory, $billingDirectory, $gaclWritableDirectory, $requiredDirectory1, $requiredDirectory2); @@ -571,74 +575,54 @@ echo "
  • Detailed installation instructions can be found in the 'INSTALL' manual file.
  • "; -echo "

    We will now ensure correct file permissions and directories before starting installation:

    \n"; -echo "Ensuring following files are world-writable...
    \n"; -$errorWritable = 0; -foreach ($writableFileList as $tempFile) { - if (is_writable($tempFile)) { - echo "'".realpath($tempFile)."' file is ready.
    \n"; +if ($checkPermissions == "TRUE") { + echo "

    We will now ensure correct file and directory permissions before starting installation:

    \n"; + echo "Ensuring following files are world-writable...
    \n"; + $errorWritable = 0; + foreach ($writableFileList as $tempFile) { + if (is_writable($tempFile)) { + echo "'".realpath($tempFile)."' file is ready.
    \n"; + } + else { + echo "

    UNABLE to open file '".realpath($tempFile)."' for writing.
    \n"; + echo "(configure file permissions; see below for further instructions)

    \n"; + $errorWritable = 1; + } } - else { - echo "

    UNABLE to open file '".realpath($tempFile)."' for writing.
    \n"; - echo "(configure file permissions; see below for further instructions)

    \n"; - $errorWritable = 1; + if ($errorWritable) { + echo "

    You can't proceed until all above files are ready (world-writable).
    \n"; + echo "In linux, recommend changing file permissions with the 'chmod 666 filename' command.
    \n"; + echo "Fix above file permissions and then click the 'Check Again' button to re-check files.
    \n"; + echo "


    \n"; + break; } -} -if ($errorWritable) { - echo "

    You can't proceed until all above files are ready (world-writable).
    \n"; - echo "In linux, recommend changing file permissions with the 'chmod 666 filename' command.
    \n"; - echo "Fix above file permissions and then click the 'Check Again' button to re-check files.
    \n"; - echo "


    \n"; - break; -} -echo "
    Ensuring following directories exist...
    \n"; -$errorWritable = 0; -foreach ($writableDirList as $tempDir) { - if (file_exists($tempDir)) { - echo "'".realpath($tempDir)."' directory exists.
    \n"; - } - else { - $tempPath = realpath($tempDir); - if ($tempPath == "") { - //this is a fix specific to microsoft windows - $tempPath = realpath('./').DIRECTORY_SEPARATOR.$tempDir; - $tempPath = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $tempPath); + echo "
    Ensuring following directories have proper permissions...
    \n"; + $errorWritable = 0; + foreach ($writableDirList as $tempDir) { + if (is_writable($tempDir)) { + echo "'".realpath($tempDir)."' directory is ready.
    \n"; + } + else { + echo "

    UNABLE to open directory '".realpath($tempDir)."' for writing by web server.
    \n"; + echo "(configure directory permissions; see below for further instructions)

    \n"; + $errorWritable = 1; } - echo "

    UNABLE to find directory '".$tempPath."'.
    \n"; - echo "(please create directory; see below for further instructions)

    \n"; - $errorWritable = 1; - } -} -if ($errorWritable) { - echo "

    You can't proceed until all above directories exist.
    \n"; - echo "In linux, recommend using the 'mkdir directory_name' command
    \n"; - echo "Add above marked directories and then click the 'Check Again' button to re-check for directories.
    \n"; - echo "


    \n"; - break; -} - -echo "
    Ensuring following directories have proper permissions...
    \n"; -$errorWritable = 0; -foreach ($writableDirList as $tempDir) { - if (is_writable($tempDir)) { - echo "'".realpath($tempDir)."' directory is ready.
    \n"; } - else { - echo "

    UNABLE to open directory '".realpath($tempDir)."' for writing by web server.
    \n"; - echo "(configure directory permissions; see below for further instructions)

    \n"; - $errorWritable = 1; + if ($errorWritable) { + echo "

    You can't proceed until all directories are ready.
    \n"; + echo "In linux, recommend changing owners of these directories to the web server. For example, in many linux OS's the web server user is 'apache', 'nobody', or 'www-data'. So if 'apache' were the web server user name, could use the command 'chown -R apache:apache directory_name' command.
    \n"; + echo "Fix above directory permissions and then click the 'Check Again' button to re-check directories.
    \n"; + echo "


    \n"; + break; } + + echo "
    All required files and directories have been verified. Click to continue installation.
    \n"; } -if ($errorWritable) { - echo "

    You can't proceed until all directories are ready.
    \n"; - echo "In linux, recommend changing owners of these directories to the web server. For example, in many linux OS's the web server user is 'apache', 'nobody', or 'www-data'. So if 'apache' were the web server user name, could use the command 'chown -R apache:apache directory_name' command.
    \n"; - echo "Fix above directory permissions and then click the 'Check Again' button to re-check directories.
    \n"; - echo "


    \n"; - break; +else { + echo "
    Click to continue installation.
    \n"; } -echo "
    All required files and directories have been verified. Click to continue installation.
    \n"; echo "


    "; -- 2.11.4.GIT