thibaud-rohmer / PhotoShow

A free web gallery in PHP with drag-n-drop support
http://www.photoshow-gallery.com
502 stars 151 forks source link

[patch] Show admin forms (upload, create, rename, delete) for uploaders #293

Open ortolot opened 8 years ago

ortolot commented 8 years ago

Hello,

I am testing PhotoShow in order to package it for Debian, and I noticed this issue. There is a specific group named “uploaders”, which is meant to allow non-admin people to upload (and create, rename and delete, according toAdminUpload.php:upload() and Admin.php:move() and delete()). But the corresponding forms, in the info side bar, are only shown for admin users.

I fixed this issue with two commits (the second one is in fact for showing empty directories to uploaders, which is useful since they can upload to them and make them non-empty); you can integrate them by merging git://git.ortolo.eu/pkg-photoshow.git#contrib/fix-for-uploaders or http://git.ortolo.eu/git/pkg-photoshow.git#contrib/fix-for-uploaders:

git pull git://git.ortolo.eu/pkg-photoshow.git contrib/fix-for-uploaders
git pull http://git.ortolo.eu/git/pkg-photoshow.git contrib/fix-for-uploaders
ortolot commented 8 years ago

(without this, uploaders are mostly useless, since they have no way to upload, create, rename and delete, appart from hacking to make the proper HTTP calls by hand, and are therefore little more than unprivileged users)

ortolot commented 8 years ago

(By the way, sorry not to be using the specific GitHub pull request form, as I am using my own Git repository, and GitHub does not seem to support external repositories. That is, it does not seem possible to create dedicated pull requests using the specific forms, but I can always tell you that you can do a git pull from my repository, which is what I did here. :-) After all, GitHub did not invent pull requests, they only created a dedicated form for pull requests from GitHub to GitHub.)

LudovicRousseau commented 8 years ago

Tanguy, I don't know what is wrong with your git server but the URL http://git.ortolo.eu/git/pkg-photoshow.git#contrib/fix-for-uploaders just display a blank page for me.

If you do not want to push your branch at github (github is evil?) maybe you should give the direct URL to the patches like http://git.ortolo.eu/pkg-photoshow.git/commitdiff/b698956fcc0d32d876d33736728b4071167ffd61

PS: Thanks to package PhotoShow for Debian.

ortolot commented 8 years ago

Ludovic Rousseau, 2015-08-13 04:53-0700:

Tanguy, I don't know what is wrong with your git server but the URL http://git.ortolo.eu/git/pkg-photoshow.git#contrib/fix-for-uploaders just display a blank page for me.

Well, this is expected: this is a Git URL, not a Web page. It is meant to be git pulled:

 $ git pull http://git.ortolo.eu/git/pkg-photoshow.git \
            contrib/fix-for-uploaders

(unfortunately Git does not accept the URL fragment notation to specify the branch, so my usage of it is just a convention)

Corresponding browser page is http://git.ortolo.eu/pkg-photoshow.git/shortlog/refs/heads/contrib/fix-for-uploaders.

I initially planned to add the patch files to this bug report, but GitHub only seem to allow attaching images, not patches!

As a side note, I would like to have identical base URL for Git over HTTP as for Git Web browsing, but I did not find a clean solution for that yet. But anyway, branch URLs would always be different, so this is off topic.

PS: Thanks to package PhotoShow for Debian.

This is not done yet, stay tuned! I am still half in holiday, so with the time I have available, I just started to work on PhotoShow itself, not yet on the packaging, but that will come.