forked from Cavemanon/cavepaintings
Merge pull request #863 from jellykells/jellykells/owner_view_unapproved
Allow image owner to view their unapproved images
This commit is contained in:
commit
476808db4b
@ -193,7 +193,7 @@ class Approval extends Extension
|
|||||||
{
|
{
|
||||||
global $user, $config;
|
global $user, $config;
|
||||||
|
|
||||||
if ($config->get_bool(ApprovalConfig::IMAGES) && $image->approved===false && !$user->can(Permissions::APPROVE_IMAGE)) {
|
if ($config->get_bool(ApprovalConfig::IMAGES) && $image->approved===false && !$user->can(Permissions::APPROVE_IMAGE) && $user->id!==$image->owner_id) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -277,6 +277,12 @@ class CommentList extends Extension
|
|||||||
) {
|
) {
|
||||||
$image = null; // this is "clever", I may live to regret it
|
$image = null; // this is "clever", I may live to regret it
|
||||||
}
|
}
|
||||||
|
if (
|
||||||
|
Extension::is_enabled(ApprovalInfo::KEY) && !is_null($image) &&
|
||||||
|
$image->approved!==true
|
||||||
|
) {
|
||||||
|
$image = null;
|
||||||
|
}
|
||||||
if (!is_null($image)) {
|
if (!is_null($image)) {
|
||||||
$comments = $this->get_comments($image->id);
|
$comments = $this->get_comments($image->id);
|
||||||
$images[] = [$image, $comments];
|
$images[] = [$image, $comments];
|
||||||
|
Loading…
Reference in New Issue
Block a user