remove a whole load of event->user variables that weren't used -- things should be using global user

This commit is contained in:
Shish
2012-08-18 19:45:39 +01:00
parent f3aad43fa3
commit 7dd929e5a8
10 changed files with 23 additions and 25 deletions

View File

@@ -140,6 +140,8 @@ abstract class FormatterExtension extends Extension {
*/
abstract class DataHandlerExtension extends Extension {
public function onDataUpload(DataUploadEvent $event) {
global $user;
if($this->supported_ext($event->type) && $this->check_contents($event->tmpname)) {
if(!move_upload_to_archive($event)) return;
send_event(new ThumbnailGenerationEvent($event->hash, $event->type));
@@ -178,15 +180,14 @@ abstract class DataHandlerExtension extends Extension {
if(is_null($image)) {
throw new UploadException("Data handler failed to create image object from data");
}
$iae = new ImageAdditionEvent($event->user, $image);
$iae = new ImageAdditionEvent($image);
send_event($iae);
$event->image_id = $iae->image->id;
// Rating Stuff.
if(!empty($event->metadata['rating'])){
global $user;
$rating = $event->metadata['rating'];
send_event(new RatingSetEvent($image, $user, $rating));
send_event(new RatingSetEvent($image, $rating));
}
// Locked Stuff.