Move image uploader info into the image info editor, make it editable

This commit is contained in:
Shish
2012-02-09 17:03:39 +00:00
parent 7ced04d0d0
commit fbbdc898b0
6 changed files with 137 additions and 74 deletions

View File

@@ -236,6 +236,17 @@ class Image {
return User::by_id($this->owner_id);
}
/**
* Set the image's owner
*/
public function set_owner(User $owner) {
global $database;
if($owner->id != $this->owner_id) {
$database->execute("UPDATE images SET owner_id=:owner_id WHERE id=:id", array("owner_id"=>$owner->id, "id"=>$this->id));
log_info("core-image", "Owner for Image #{$this->id} set to: ".$owner->username);
}
}
/**
* Get this image's tags as an array
*/