The modification will change the function save_profile_image() allowing it to take a URL argument. This means in turn that enrolment scripts and other automatic ways of creating users will be able to suck profile photos into Moodle, if they're available at a URL.
Description
There's a little bit of discussion here (including diff output):
http://moodle.org/mod/forum/discuss.php?d=36405
The modification will change the function save_profile_image() allowing it to take a URL argument. This means in turn that enrolment scripts and other automatic ways of creating users will be able to suck profile photos into Moodle, if they're available at a URL.
As part of the MDL-11752 work, we decoupled the uploading of the profile images, and the processing of those image files. As a result, we can now get the profile images from anywhere (from an external URL, an LDAP directory, etc.), put them in a temporary file in moodledata and use the following code to assign the picture to the user. $id is the user id, and $originalfile is the path to the (temporary) profile image file
$destination = create_profile_image_destination($id, 'user');
if ($destination === false) {
// do whatever you need to handle the error.
}
Iñaki Arenaza added a comment - 31/May/08 11:25 PM As part of the MDL-11752 work, we decoupled the uploading of the profile images, and the processing of those image files. As a result, we can now get the profile images from anywhere (from an external URL, an LDAP directory, etc.), put them in a temporary file in moodledata and use the following code to assign the picture to the user. $id is the user id, and $originalfile is the path to the (temporary) profile image file
$destination = create_profile_image_destination($id, 'user');
if ($destination === false) {
// do whatever you need to handle the error.
}
$success = process_profile_image($originalfile, $destination);
So I'd say we can close this bug as fixed. Dan?
Saludos. Iñaki.
MDL-11752work, we decoupled the uploading of the profile images, and the processing of those image files. As a result, we can now get the profile images from anywhere (from an external URL, an LDAP directory, etc.), put them in a temporary file in moodledata and use the following code to assign the picture to the user. $id is the user id, and $originalfile is the path to the (temporary) profile image file$destination = create_profile_image_destination($id, 'user');
if ($destination === false) { // do whatever you need to handle the error. }
$success = process_profile_image($originalfile, $destination);
So I'd say we can close this bug as fixed. Dan?
Saludos. Iñaki.