This commit is contained in:
NottyNoz 2023-03-16 22:29:45 -04:00
parent 6bf7d63a29
commit 48c3eae6b9
5 changed files with 6 additions and 6 deletions

View File

@ -76,7 +76,7 @@ class PrivateImage extends Extension
throw new SCoreException("Post not found.");
}
if ($image->owner_id!=$user->can(Permissions::SET_OTHERS_PRIVATE_IMAGES)) {
throw new SCoreException("Cannot set another user's image to private.");
throw new SCoreException("Cannot set another user's image to public.");
}
self::publicize_image($image_id);
@ -114,7 +114,7 @@ class PrivateImage extends Extension
{
global $user, $page;
if ($event->image->private===true && $event->image->owner_id!=$user->id && !$user->can(Permissions::SET_OTHERS_PRIVATE_IMAGES)) {
if ($event->image->private==true && $event->image->owner_id!=$user->id && !$user->can(Permissions::SET_OTHERS_PRIVATE_IMAGES)) {
$page->set_mode(PageMode::REDIRECT);
$page->set_redirect(make_link("post/list"));
}
@ -221,7 +221,7 @@ class PrivateImage extends Extension
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
{
global $user;
if ($user->can(Permissions::SET_PRIVATE_IMAGE) && $user->id==$event->image->owner_id) {
if (($user->can(Permissions::SET_PRIVATE_IMAGE) && $user->id==$event->image->owner_id) || $user->can(Permissions::SET_OTHERS_PRIVATE_IMAGES)) {
$event->add_part($this->theme->get_image_admin_html($event->image));
}
}

View File

@ -10,7 +10,7 @@ class PrivateImageTheme extends Themelet
{
public function get_image_admin_html(Image $image): string
{
if ($image->private===false) {
if ($image->private==false) {
$html = SHM_SIMPLE_FORM(
'privatize_image/'.$image->id,
INPUT(["type"=>'hidden', "name"=>'image_id', "value"=>$image->id]),

View File

@ -13,7 +13,7 @@ class QRImageInfo extends ExtensionInfo
public string $url = "http://seemslegit.com";
public array $authors = ["Zach Hall"=>"zach@sosguy.net"];
public string $license = self::LICENSE_GPLV2;
public string $description = "Turns BBCode into HTML";
public string $description = "Shows a QR Code for downloading a post to cell phones";
public ?string $documentation =
"Shows a QR Code for downloading a post to cell phones.
Based on Artanis's Link to Post Extension <artanis.00@gmail.com>

View File

@ -1,4 +1,4 @@
These files can be overriden by placing files in
themes/$your_theme/filename.foo. For example if
you want your theme "radiance" to have a custom
favicon, place it in themes/radiance/favicon.ico
favicon, place it in themes/radiance/static/favicon.ico

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB