commit
c0974ba6ce
5 changed files with 7 additions and 7 deletions
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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]),
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
These files can be overriden by placing files in
|
||||
themes/$your_theme/filename.foo. For example if
|
||||
themes/$your_theme/static/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
|
||||
|
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Reference in a new issue