diff options
author | Sebastien SAUVAGE <sebsauvage@sebsauvage.net> | 2013-03-04 21:14:07 +0100 |
---|---|---|
committer | Sebastien SAUVAGE <sebsauvage@sebsauvage.net> | 2013-03-04 21:14:07 +0100 |
commit | f2cb5f95a9505d0a656990307daaef441505d213 (patch) | |
tree | 969f6017be17632bfe88df7d88886ff69d3c967b | |
parent | 8a80e4fe07c2d116ad87e7d0699859d10229607e (diff) | |
download | Shaarli-f2cb5f95a9505d0a656990307daaef441505d213.tar.gz Shaarli-f2cb5f95a9505d0a656990307daaef441505d213.tar.zst Shaarli-f2cb5f95a9505d0a656990307daaef441505d213.zip |
Check that Shaarli has the right to write in its own directory.
Because some user forget to check this at installation.
-rw-r--r-- | index.php | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -78,6 +78,7 @@ header("Cache-Control: post-check=0, pre-check=0", false); | |||
78 | header("Pragma: no-cache"); | 78 | header("Pragma: no-cache"); |
79 | 79 | ||
80 | // Directories creations (Note that your web host may require differents rights than 705.) | 80 | // Directories creations (Note that your web host may require differents rights than 705.) |
81 | if (!is_writable(realpath(dirname(__FILE__)))) die('<pre>ERROR: Shaarli does not have the right to write in its own directory ('.realpath(dirname(__FILE__)).').</pre>'); | ||
81 | if (!is_dir($GLOBALS['config']['DATADIR'])) { mkdir($GLOBALS['config']['DATADIR'],0705); chmod($GLOBALS['config']['DATADIR'],0705); } | 82 | if (!is_dir($GLOBALS['config']['DATADIR'])) { mkdir($GLOBALS['config']['DATADIR'],0705); chmod($GLOBALS['config']['DATADIR'],0705); } |
82 | if (!is_dir('tmp')) { mkdir('tmp',0705); chmod('tmp',0705); } // For RainTPL temporary files. | 83 | if (!is_dir('tmp')) { mkdir('tmp',0705); chmod('tmp',0705); } // For RainTPL temporary files. |
83 | if (!is_file($GLOBALS['config']['DATADIR'].'/.htaccess')) { file_put_contents($GLOBALS['config']['DATADIR'].'/.htaccess',"Allow from none\nDeny from all\n"); } // Protect data files. | 84 | if (!is_file($GLOBALS['config']['DATADIR'].'/.htaccess')) { file_put_contents($GLOBALS['config']['DATADIR'].'/.htaccess',"Allow from none\nDeny from all\n"); } // Protect data files. |