summaryrefslogtreecommitdiff
path: root/modules/user/user.module
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2008-10-09 00:02:29 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2008-10-09 00:02:29 +0000
commitf841d1a764c4aa6aa6d2a58daa401be615f4e873 (patch)
treeeac1b6d3c4325d926f06e036a337746d03edb9fc /modules/user/user.module
parent72e09d7beb7788a3a1f473c0d7a7a4802a5dc75a (diff)
downloadbrdo-f841d1a764c4aa6aa6d2a58daa401be615f4e873.tar.gz
brdo-f841d1a764c4aa6aa6d2a58daa401be615f4e873.tar.bz2
#142995 by dopry, drewish, quicksketch, jpetso, and flobruit: Adding hook_file_X(). This is an enabler of lots and lots of goodies. See CHANGELOG.txt for more. Awesome work, guys. :)
Diffstat (limited to 'modules/user/user.module')
-rw-r--r--modules/user/user.module6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/user/user.module b/modules/user/user.module
index 4138fd72e..e8d956d0f 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -407,7 +407,7 @@ function user_validate_picture(&$form, &$form_state) {
if ($file = file_save_upload('picture_upload', $validators)) {
// Remove the old picture.
if (isset($form_state['values']['_account']->picture) && file_exists($form_state['values']['_account']->picture)) {
- file_delete($form_state['values']['_account']->picture);
+ file_unmanaged_delete($form_state['values']['_account']->picture);
}
// The image was saved using file_save_upload() and was added to the
@@ -415,7 +415,7 @@ function user_validate_picture(&$form, &$form_state) {
// collector delete the original upload.
$info = image_get_info($file->filepath);
$destination = file_create_path(variable_get('user_picture_path', 'pictures') . '/picture-' . $form['#uid'] . '.' . $info['extension']);
- if ($filepath = file_copy($file->filepath, $destination, FILE_EXISTS_REPLACE)) {
+ if ($filepath = file_unmanaged_copy($file->filepath, $destination, FILE_EXISTS_REPLACE)) {
$form_state['values']['picture'] = $filepath;
}
else {
@@ -1558,7 +1558,7 @@ function _user_edit_submit($uid, &$edit) {
// Delete picture if requested, and if no replacement picture was given.
if (!empty($edit['picture_delete'])) {
if ($user->picture && file_exists($user->picture)) {
- file_delete($user->picture);
+ file_unmanaged_delete($user->picture);
}
$edit['picture'] = '';
}