diff options
author | Dries Buytaert <dries@buytaert.net> | 2005-11-12 09:23:50 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2005-11-12 09:23:50 +0000 |
commit | 64a617c208c02b6360d16d0960eebc67839d4dc8 (patch) | |
tree | 85c5429fd910b7b543acf978faabd8f78611ea0e /modules | |
parent | 7dd24bec5c65462a095fd5a011e75113aab3714c (diff) | |
download | brdo-64a617c208c02b6360d16d0960eebc67839d4dc8.tar.gz brdo-64a617c208c02b6360d16d0960eebc67839d4dc8.tar.bz2 |
- Patch #26249 by Morbus: improved handling of temporary files/directory.
If your module uses variable_get('file_directory_temp', ...) or
variable_get('file_directory_path', ...) please update it to use the new
API.
A list of affected modules is available at http://drupal.org/node/26249#comment-54194.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/system.module | 6 | ||||
-rw-r--r-- | modules/system/system.module | 6 | ||||
-rw-r--r-- | modules/user.module | 2 | ||||
-rw-r--r-- | modules/user/user.module | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/modules/system.module b/modules/system.module index 6454945ec..fb15d4076 100644 --- a/modules/system.module +++ b/modules/system.module @@ -317,7 +317,7 @@ function system_view_general() { // File system: $form['files'] = array('#type' => 'fieldset', '#title' => t('File system settings'), '#collapsible' => TRUE, '#collapsed' => TRUE); - $directory_path = variable_get('file_directory_path', 'files'); + $directory_path = file_directory_path(); file_check_directory($directory_path, FILE_CREATE_DIRECTORY, 'file_directory_path'); $form['files']['file_directory_path'] = array( @@ -325,7 +325,7 @@ function system_view_general() { '#description' => t('A file system path where the files will be stored. This directory has to exist and be writable by Drupal. If the download method is set to public this directory has to be relative to Drupal installation directory, and be accessible over the web. When download method is set to private this directory should not be accessible over the web. Changing this location after the site has been in use will cause problems so only change this setting on an existing site if you know what you are doing.') ); - $directory_temp = variable_get('file_directory_temp', ini_get('upload_tmp_dir')); + $directory_temp = file_directory_temp(); file_check_directory($directory_temp, FILE_CREATE_DIRECTORY, 'file_directory_temp'); $form['files']['file_directory_temp'] = array( @@ -961,7 +961,7 @@ function system_site_settings($module = NULL) { * Menu callback; display theme configuration for entire site and individual themes. */ function system_theme_settings($key = '') { - $directory_path = variable_get('file_directory_path', 'files'); + $directory_path = file_directory_path(); file_check_directory($directory_path, FILE_CREATE_DIRECTORY, 'file_directory_path'); // Default settings are defined in theme_get_settings() in includes/theme.inc diff --git a/modules/system/system.module b/modules/system/system.module index 6454945ec..fb15d4076 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -317,7 +317,7 @@ function system_view_general() { // File system: $form['files'] = array('#type' => 'fieldset', '#title' => t('File system settings'), '#collapsible' => TRUE, '#collapsed' => TRUE); - $directory_path = variable_get('file_directory_path', 'files'); + $directory_path = file_directory_path(); file_check_directory($directory_path, FILE_CREATE_DIRECTORY, 'file_directory_path'); $form['files']['file_directory_path'] = array( @@ -325,7 +325,7 @@ function system_view_general() { '#description' => t('A file system path where the files will be stored. This directory has to exist and be writable by Drupal. If the download method is set to public this directory has to be relative to Drupal installation directory, and be accessible over the web. When download method is set to private this directory should not be accessible over the web. Changing this location after the site has been in use will cause problems so only change this setting on an existing site if you know what you are doing.') ); - $directory_temp = variable_get('file_directory_temp', ini_get('upload_tmp_dir')); + $directory_temp = file_directory_temp(); file_check_directory($directory_temp, FILE_CREATE_DIRECTORY, 'file_directory_temp'); $form['files']['file_directory_temp'] = array( @@ -961,7 +961,7 @@ function system_site_settings($module = NULL) { * Menu callback; display theme configuration for entire site and individual themes. */ function system_theme_settings($key = '') { - $directory_path = variable_get('file_directory_path', 'files'); + $directory_path = file_directory_path(); file_check_directory($directory_path, FILE_CREATE_DIRECTORY, 'file_directory_path'); // Default settings are defined in theme_get_settings() in includes/theme.inc diff --git a/modules/user.module b/modules/user.module index 76d29ef02..904ac2015 100644 --- a/modules/user.module +++ b/modules/user.module @@ -1777,7 +1777,7 @@ function user_configure() { $form['pictures'] = array('#type' => 'fieldset', '#title' => t('Pictures')); $form['pictures']['user_pictures'] = array('#type' => 'radios', '#title' => t('Picture support'), '#default_value' => variable_get('user_pictures', 0), '#options' => array(t('Disabled'), t('Enabled')), '#description' => t('Enable picture support.')); - $form['pictures']['user_picture_path'] = array('#type' => 'textfield', '#title' => t('Picture image path'), '#default_value' => variable_get('user_picture_path', 'pictures'), '#size' => 30, '#maxlength' => 255, '#description' => t('Subdirectory in the directory "%dir" where pictures will be stored.', array('%dir' => variable_get('file_directory_path', 'files') .'/'))); + $form['pictures']['user_picture_path'] = array('#type' => 'textfield', '#title' => t('Picture image path'), '#default_value' => variable_get('user_picture_path', 'pictures'), '#size' => 30, '#maxlength' => 255, '#description' => t('Subdirectory in the directory "%dir" where pictures will be stored.', array('%dir' => file_directory_path() .'/'))); $form['pictures']['user_picture_default'] = array('#type' => 'textfield', '#title' => t('Default picture'), '#default_value' => variable_get('user_picture_default', ''), '#size' => 30, '#maxlength' => 255, '#description' => t('URL of picture to display for users with no custom picture selected. Leave blank for none.')); $form['pictures']['user_picture_dimensions'] = array('#type' => 'textfield', '#title' => t('Picture maximum dimensions'), '#default_value' => variable_get('user_picture_dimensions', '85x85'), '#size' => 15, '#maxlength' => 10, '#description' => t('Maximum dimensions for pictures.')); $form['pictures']['user_picture_file_size'] = array('#type' => 'textfield', '#title' => t('Picture maximum file size'), '#default_value' => variable_get('user_picture_file_size', '30'), '#size' => 15, '#maxlength' => 10, '#description' => t('Maximum file size for pictures, in kB.')); diff --git a/modules/user/user.module b/modules/user/user.module index 76d29ef02..904ac2015 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -1777,7 +1777,7 @@ function user_configure() { $form['pictures'] = array('#type' => 'fieldset', '#title' => t('Pictures')); $form['pictures']['user_pictures'] = array('#type' => 'radios', '#title' => t('Picture support'), '#default_value' => variable_get('user_pictures', 0), '#options' => array(t('Disabled'), t('Enabled')), '#description' => t('Enable picture support.')); - $form['pictures']['user_picture_path'] = array('#type' => 'textfield', '#title' => t('Picture image path'), '#default_value' => variable_get('user_picture_path', 'pictures'), '#size' => 30, '#maxlength' => 255, '#description' => t('Subdirectory in the directory "%dir" where pictures will be stored.', array('%dir' => variable_get('file_directory_path', 'files') .'/'))); + $form['pictures']['user_picture_path'] = array('#type' => 'textfield', '#title' => t('Picture image path'), '#default_value' => variable_get('user_picture_path', 'pictures'), '#size' => 30, '#maxlength' => 255, '#description' => t('Subdirectory in the directory "%dir" where pictures will be stored.', array('%dir' => file_directory_path() .'/'))); $form['pictures']['user_picture_default'] = array('#type' => 'textfield', '#title' => t('Default picture'), '#default_value' => variable_get('user_picture_default', ''), '#size' => 30, '#maxlength' => 255, '#description' => t('URL of picture to display for users with no custom picture selected. Leave blank for none.')); $form['pictures']['user_picture_dimensions'] = array('#type' => 'textfield', '#title' => t('Picture maximum dimensions'), '#default_value' => variable_get('user_picture_dimensions', '85x85'), '#size' => 15, '#maxlength' => 10, '#description' => t('Maximum dimensions for pictures.')); $form['pictures']['user_picture_file_size'] = array('#type' => 'textfield', '#title' => t('Picture maximum file size'), '#default_value' => variable_get('user_picture_file_size', '30'), '#size' => 15, '#maxlength' => 10, '#description' => t('Maximum file size for pictures, in kB.')); |