diff options
author | Sebastien SAUVAGE <sebsauvage@sebsauvage.net> | 2013-03-04 21:26:06 +0100 |
---|---|---|
committer | Sebastien SAUVAGE <sebsauvage@sebsauvage.net> | 2013-03-04 21:26:06 +0100 |
commit | 979d6334e75568fd92222ccfd6c9a3f943916d71 (patch) | |
tree | 843c0289bf427f9c65fd445dc62ad6728f18cd03 /index.php | |
parent | f2cb5f95a9505d0a656990307daaef441505d213 (diff) | |
download | Shaarli-979d6334e75568fd92222ccfd6c9a3f943916d71.tar.gz Shaarli-979d6334e75568fd92222ccfd6c9a3f943916d71.tar.zst Shaarli-979d6334e75568fd92222ccfd6c9a3f943916d71.zip |
Added second check to write rights.
(Because on some hosts is_writable() is not reliable.)
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -82,6 +82,8 @@ if (!is_writable(realpath(dirname(__FILE__)))) die('<pre>ERROR: Shaarli does not | |||
82 | 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); } |
83 | 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. |
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. | 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. |
85 | // Second check to see if Shaarli can write in its directory, because on some hosts is_writable() is not reliable. | ||
86 | if (!is_file($GLOBALS['config']['DATADIR'].'/.htaccess')) die('<pre>ERROR: Shaarli does not have the right to write in its own directory ('.realpath(dirname(__FILE__)).').</pre>'); | ||
85 | if ($GLOBALS['config']['ENABLE_LOCALCACHE']) | 87 | if ($GLOBALS['config']['ENABLE_LOCALCACHE']) |
86 | { | 88 | { |
87 | if (!is_dir($GLOBALS['config']['CACHEDIR'])) { mkdir($GLOBALS['config']['CACHEDIR'],0705); chmod($GLOBALS['config']['CACHEDIR'],0705); } | 89 | if (!is_dir($GLOBALS['config']['CACHEDIR'])) { mkdir($GLOBALS['config']['CACHEDIR'],0705); chmod($GLOBALS['config']['CACHEDIR'],0705); } |