summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2005-09-06 19:22:50 +0000
committerDries Buytaert <dries@buytaert.net>2005-09-06 19:22:50 +0000
commit298b403bf1611ef70f600c563c8f06eb4ceaafc3 (patch)
treed13ad3e6c1880a898a70d5909731c3c898e25fe5 /modules
parent7f08b766aa3c831ba9f35e2e3504152dc84e7599 (diff)
downloadbrdo-298b403bf1611ef70f600c563c8f06eb4ceaafc3.tar.gz
brdo-298b403bf1611ef70f600c563c8f06eb4ceaafc3.tar.bz2
- Patch #18252 by tostinni: don't try creating the picture directory when picture support is not enabled.
Diffstat (limited to 'modules')
-rw-r--r--modules/user.module8
-rw-r--r--modules/user/user.module8
2 files changed, 10 insertions, 6 deletions
diff --git a/modules/user.module b/modules/user.module
index e3a17dbe0..3179b7b69 100644
--- a/modules/user.module
+++ b/modules/user.module
@@ -1364,9 +1364,11 @@ function user_configure_settings() {
$group .= form_textarea(t('Body of password recovery e-mail'), 'user_mail_pass_body', _user_mail_text('pass_body'), 60, 15, t('Customize the body of the forgotten password e-mail.') .' '. t('Available variables are:') .' %username, %site, %login_url, %uri, %uri_brief, %mailto, %login_uri, %edit_uri.');
$output .= form_group(t('User email settings'), $group);
- // Picture settings.
- file_check_directory(file_create_path(variable_get('user_picture_path', 'pictures')), 1, 'user_picture_path');
-
+ // If picture support is enabled, check whether the picture directory exists:
+ if (variable_get('user_pictures', 0)) {
+ file_check_directory(file_create_path(variable_get('user_picture_path', 'pictures')), 1, 'user_picture_path');
+ }
+
$group = form_radios(t('Picture support'), 'user_pictures', variable_get('user_pictures', 0), array(t('Disabled'), t('Enabled')), t('Enable picture support.'));
$group .= form_textfield(t('Picture image path'), 'user_picture_path', variable_get('user_picture_path', 'pictures'), 30, 255, t('Subdirectory in the directory "%dir" where pictures will be stored.', array('%dir' => variable_get('file_directory_path', 'files') .'/')));
$group .= form_textfield(t('Default picture'), 'user_picture_default', variable_get('user_picture_default', ''), 30, 255, t('URL of picture to display for users with no custom picture selected. Leave blank for none.'));
diff --git a/modules/user/user.module b/modules/user/user.module
index e3a17dbe0..3179b7b69 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -1364,9 +1364,11 @@ function user_configure_settings() {
$group .= form_textarea(t('Body of password recovery e-mail'), 'user_mail_pass_body', _user_mail_text('pass_body'), 60, 15, t('Customize the body of the forgotten password e-mail.') .' '. t('Available variables are:') .' %username, %site, %login_url, %uri, %uri_brief, %mailto, %login_uri, %edit_uri.');
$output .= form_group(t('User email settings'), $group);
- // Picture settings.
- file_check_directory(file_create_path(variable_get('user_picture_path', 'pictures')), 1, 'user_picture_path');
-
+ // If picture support is enabled, check whether the picture directory exists:
+ if (variable_get('user_pictures', 0)) {
+ file_check_directory(file_create_path(variable_get('user_picture_path', 'pictures')), 1, 'user_picture_path');
+ }
+
$group = form_radios(t('Picture support'), 'user_pictures', variable_get('user_pictures', 0), array(t('Disabled'), t('Enabled')), t('Enable picture support.'));
$group .= form_textfield(t('Picture image path'), 'user_picture_path', variable_get('user_picture_path', 'pictures'), 30, 255, t('Subdirectory in the directory "%dir" where pictures will be stored.', array('%dir' => variable_get('file_directory_path', 'files') .'/')));
$group .= form_textfield(t('Default picture'), 'user_picture_default', variable_get('user_picture_default', ''), 30, 255, t('URL of picture to display for users with no custom picture selected. Leave blank for none.'));