|
Here are updated patches for both 1.8.3+ and 1.9Beta2 (current as of today). The patch allows the admin to:
The code assumes the image files are named 'chosen-profile-field.extension'. Extensive checks are made to ensure everythings ok before using the picture files. Also, the proposed changes allow authentication plugin to easily set user images from external sources (ldap, database, etc.). I'm attaching two files: the big patch ready to be applied, and a patch series with broken down changes and comments (so it's easier to review). Saludos. Iñaki. Iñaki - Thanks for the patches. I will give them a shot and see what happens but what you describe sounds wonderful. A tweak or check that I can see some admins requesting is the ability to choose whether to overwrite an existing image if it exists. I can imagine where the admin may want to assign an image regardless of whether the user had previously uploaded one or not and also wanting to say here is a default image; however, if the user already uploaded one let them use it. Does that make sense and seem practical? Peace - Anthony
> A tweak or check that I can see some admins requesting is the ability to choose whether to overwrite an existing image if it exists.
That should be really easy to add. I'll give it a go Saludos. Iñaki. Martin - Does adding the ability to upload user pics en masse (by the Moodle administrator) seem like something that you would like to see in HEAD? I think it would make a nice addition to Moodle 2.0. Peace - Anthony
By the way, I added the ability to choose whether to overwrite an existing image if it exists, but I forgot to upload the patches here. They have been sitting at my laptop nearly 2 weeks :-o. So here they go.
Saludos. Iñaki. Excellent - I'll put it on my desktop and hopefully get to testing it soon. Peace - Anthony
Iñaki - I've tested this on my test server (Moodle 1.8) with production data and it worked like a champ. I wonder if Martin might consider allowing these patches into 1.9 as they go along nicely with the improved user management features from the GSoC work. Peace - Anthony
I see the upload users form has been converted to moodleforms. Before adding this to 1.9 I think we should convert uploadpicture.php to use moodleforms too. I'll be a bit busy the following days, but will give it a go as time permits.
Saludos. Iñaki. It was easier than I expected, so I'm attaching a full patch against 1.9beta4 (current as of today). If Martin or anybody else needs the broken down patch series (to better analyze the changes) I can upload them on request.
Saludos. Iñaki. Iñaki - Thanks for the great work. My +1 for getting this into Moodle 1.9 (hopefully). Administratively it is a huge time saver. Peace - Anthony
Martin - I did some testing of uploading a bunch of user pics using the patch here on 1.9 and it looks pretty good. As mentioned, I think this goes along nicely with some of the other 1.9 improvements for dealing with importing users en masse. I applied the 1.8 patch to my Dallas production server and it was a big time saver. Iñaki's patch for 1.9 should make this pretty easy to drop in to 1.9 if you are interested. Peace - Anthony
Great, nice little timesaver! I've checked it out and checked it in.
Thanks for this nice little feature
Documentation here: http://docs.moodle.org/en/Upload_user_pictures Just tested. Works like a charm. Nice one, cheers.
Upload an updated version of the patch for 1.8 (current as of today), so interested people can use it (the previous patch was missing the ability to process zip files with nested directories).
Saludos. Iñaki. Hi,
Thanks so much for this great feature. I applied the patch for 1.8.7 and it was unable to add pictures via idnumber. When I uploaded the zip file I got lots of messages saying that there was no username that fit that number (the idnumber). When I edited the uploadpicture.php and eliminated id and username from the $userfields array I was able to upload the zip file fine. It works wonderfully for me now, but I imagine others may have the same problem I did. Thanks again for the cool patch! David Tested, works well. Thanks!
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MDL-4520requests that the /lib/gdlib.php save_profile_image function be able to accept a URL of an image and is another possible improvement related to improving the ability and ease of which images can be added. It may be good to work on these issues together.