Skip to content
Browse files

MDL-21174 - exclude deleted users in bulk upload of user profile pict…

…ures.
  • Loading branch information...
1 parent 330cc66 commit 941c3027a7695b3f997c341f7d468712d705d0ed Rossiani Wijaya committed Jan 11, 2010
Showing with 5 additions and 5 deletions.
  1. +5 −5 admin/uploadpicture.php
View
10 admin/uploadpicture.php
@@ -76,10 +76,10 @@
// Create a unique temporary directory, to process the zip file
// contents.
- $zipodir = my_mktempdir($CFG->dataroot.'/temp/', 'usrpic');
- $dstfile = $zipodir.'/images.zip';
-
- if (!$mform->save_file('userfile', $dstfile, true)) {
+ $zipdir = my_mktempdir($CFG->dataroot.'/temp/', 'usrpic');
+ $dstfile = $zipdir.'/images.zip';
+
+ if (!$mform->save_file('userpicturesfile', $dstfile, true)) {
echo $OUTPUT->notification(get_string('uploadpicture_cannotmovezip','admin'));
@remove_dir($zipdir);
} else {
@@ -212,7 +212,7 @@ function process_file ($file, $userfield, $overwrite) {
strlen($extension) - 1);
// userfield names are safe, so don't quote them.
- if (!($user = $DB->get_record('user', array ($userfield => $uservalue)))) {
+ if (!($user = $DB->get_record('user', array ($userfield => $uservalue,'deleted',0)))) {
$a = new Object();
$a->userfield = clean_param($userfield, PARAM_CLEANHTML);
$a->uservalue = clean_param($uservalue, PARAM_CLEANHTML);

0 comments on commit 941c302

Please sign in to comment.
Something went wrong with that request. Please try again.