From 0995d62be320ced7c533d805fe887d78741bfbb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Hojtsy?= Date: Sat, 30 Jun 2007 08:17:05 +0000 Subject: #99011 follow up patch my merlinofchaos: inform users if the settings.php or the settings directory in use is not write protected after installation. --- modules/system/system.install | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'modules/system') diff --git a/modules/system/system.install b/modules/system/system.install index 0f4756174..d78e12bec 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -66,12 +66,20 @@ function system_requirements($phase) { // Test settings.php file writability if ($phase == 'runtime') { - if (!drupal_verify_install_file(conf_path() .'/settings.php', FILE_EXIST|FILE_READABLE|FILE_NOT_WRITABLE)) { + $conf_dir = drupal_verify_install_file(conf_path(), FILE_NOT_WRITABLE, 'dir'); + $conf_file = drupal_verify_install_file(conf_path() .'/settings.php', FILE_EXIST|FILE_READABLE|FILE_NOT_WRITABLE); + if (!$conf_dir || !$conf_file) { $requirements['settings.php'] = array( 'value' => $t('Not protected'), 'severity' => REQUIREMENT_ERROR, - 'description' => $t('The file %file is not protected from modifications and poses a security risk. You must change the file\'s permissions to be non-writable.', array('%file' => conf_path() .'/settings.php')), + 'description' => '', ); + if (!$conf_dir) { + $requirements['settings.php']['description'] .= $t('The directory %file is not protected from modifications and poses a security risk. You must change the directory\'s permissions to be non-writable. ', array('%file' => conf_path())); + } + if (!$conf_file) { + $requirements['settings.php']['description'] .= $t('The file %file is not protected from modifications and poses a security risk. You must change the file\'s permissions to be non-writable.', array('%file' => conf_path() .'/settings.php')); + } } else { $requirements['settings.php'] = array( -- cgit v1.2.3