Moodle

Modify gdlib.php so that URLs as well as filepaths can be used to create profile-images

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.6
  • Fix Version/s: 1.9
  • Component/s: General
  • Labels:
    None
  • Environment:
    All

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.

Issue Links

Activity

Hide
Iñaki Arenaza added a comment -

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.

Show
Iñaki Arenaza added a comment - 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.
Hide
Dan Stowell added a comment -

Don't mind. I'm not doing much Moodle work at the moment so I'm not really partisan...

Show
Dan Stowell added a comment - Don't mind. I'm not doing much Moodle work at the moment so I'm not really partisan...
Hide
Iñaki Arenaza added a comment -

Ok, I'm closing it as fixed then.

Saludos. Iñaki.

Show
Iñaki Arenaza added a comment - Ok, I'm closing it as fixed then. Saludos. Iñaki.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: