fixes
This commit is contained in:
parent
6bf7d63a29
commit
48c3eae6b9
5 changed files with 6 additions and 6 deletions
|
@ -76,7 +76,7 @@ class PrivateImage extends Extension
|
||||||
throw new SCoreException("Post not found.");
|
throw new SCoreException("Post not found.");
|
||||||
}
|
}
|
||||||
if ($image->owner_id!=$user->can(Permissions::SET_OTHERS_PRIVATE_IMAGES)) {
|
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);
|
self::publicize_image($image_id);
|
||||||
|
@ -114,7 +114,7 @@ class PrivateImage extends Extension
|
||||||
{
|
{
|
||||||
global $user, $page;
|
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_mode(PageMode::REDIRECT);
|
||||||
$page->set_redirect(make_link("post/list"));
|
$page->set_redirect(make_link("post/list"));
|
||||||
}
|
}
|
||||||
|
@ -221,7 +221,7 @@ class PrivateImage extends Extension
|
||||||
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
|
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
|
||||||
{
|
{
|
||||||
global $user;
|
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));
|
$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
|
public function get_image_admin_html(Image $image): string
|
||||||
{
|
{
|
||||||
if ($image->private===false) {
|
if ($image->private==false) {
|
||||||
$html = SHM_SIMPLE_FORM(
|
$html = SHM_SIMPLE_FORM(
|
||||||
'privatize_image/'.$image->id,
|
'privatize_image/'.$image->id,
|
||||||
INPUT(["type"=>'hidden', "name"=>'image_id', "value"=>$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 string $url = "http://seemslegit.com";
|
||||||
public array $authors = ["Zach Hall"=>"zach@sosguy.net"];
|
public array $authors = ["Zach Hall"=>"zach@sosguy.net"];
|
||||||
public string $license = self::LICENSE_GPLV2;
|
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 =
|
public ?string $documentation =
|
||||||
"Shows a QR Code for downloading a post to cell phones.
|
"Shows a QR Code for downloading a post to cell phones.
|
||||||
Based on Artanis's Link to Post Extension <artanis.00@gmail.com>
|
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
|
These files can be overriden by placing files in
|
||||||
themes/$your_theme/filename.foo. For example if
|
themes/$your_theme/filename.foo. For example if
|
||||||
you want your theme "radiance" to have a custom
|
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