Author Topic: Limit upload to certain directories  (Read 10627 times)

0 Members and 1 Guest are viewing this topic.

Offline Andrew

  • album.pl Hacker
  • ****
  • Posts: 114
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • WHITEWATER!
Limit upload to certain directories
« on: July 15, 2002, 18:18:33 »
Ok here is another idiot proofing request.  Would it be possible to create a feature which would present only the folders the admin chooses to potential uploaders?

In other words I have some directories that only I want to upload to.  It would be most excellent if those galleries were not even visible to the users on the upload page.

Thanks Mike...hope your weekend went well!

Andrew
« Last Edit: December 31, 1969, 19:00:00 by 1039064400 »

Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re: Limit upload to certain directories
« Reply #1 on: July 15, 2002, 18:31:27 »
Roger, I'll see if I can think of a reasonable way to do this...

Thanks
« Last Edit: December 31, 1969, 19:00:00 by 1039064400 »

Offline Andrew

  • album.pl Hacker
  • ****
  • Posts: 114
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • WHITEWATER!
Re: Limit upload to certain directories
« Reply #2 on: July 29, 2002, 00:34:49 »
Wow Mike!

Looks like traffic is picking up here!  You script is getting pretty dang popular....no wonder.


I was curious whether you had considered this feature very seriously yet.....and I would like to ask if perhaps I might suggest an addition to it.  

It would make this feature even better if with per member upload enabled...that the members were allowed to have thier own folder in EACH of the directories presented for uploading.

I understand that your project has grown pretty substancially here and that you might not be able to act on requests as quickly as you have in the past.....just checking in.

Oh and great work on the fix for the thumbnails....I don't think even a three second wait is that long.

Thanks,

Andrew
« Last Edit: December 31, 1969, 19:00:00 by 1039064400 »

Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re: Limit upload to certain directories
« Reply #3 on: July 29, 2002, 05:46:36 »
Hi Andrew,

It's good to remind me of these things some times.  ;)

I'm not sure what the best way to go here is. My first thought was to have a .htaccess (or equivalent) file in each dir, that defines who can do what.

But that means when uploading, you'd have to scan all of these files. (On the other hand, a recursive directory scan is already performed, so this wouldn't "cost" much more...)

The other option is to create a centrally located "permissions" file that would allow you to set permissions on specifc albums.

Any thoughts on what you would prefer? (Anyone?)
« Last Edit: December 31, 1969, 19:00:00 by 1039064400 »

Offline Bytes_U

  • album.pl Donor
  • album.pl Contributor
  • ***
  • Posts: 75
  • Karma: +0/-0
  • Oh no... not again?
Re: Limit upload to certain directories
« Reply #4 on: July 29, 2002, 08:46:32 »
Quote
...The other option is to create a centrally located "permissions" file that would allow you to set permissions on specifc albums.

Any thoughts on what you would prefer? (Anyone?)

I vote central permissions file ;)
« Last Edit: December 31, 1969, 19:00:00 by 1039064400 »

Offline Andrew

  • album.pl Hacker
  • ****
  • Posts: 114
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • WHITEWATER!
Re: Limit upload to certain directories
« Reply #5 on: July 29, 2002, 18:29:10 »
Hey Mike,

Hmmm...After thinking about this long and hard....I decided I need to think about it longer and harder.

This is a pretty convoluted deal really.  Before I could say yes, the permissions file is the way to go, I guess I would have to understand how you planned to implement it.

Would it be a variable text file, initially written to during the directory scan you mention?  Would admin set flags on this variable file causing  respective folders, documented therein, to be "invisible on upload tree"? Could the admin do this via a checkbox on the "update titles and descriptions" or "edit" screens?  Would an approach of this type require that a directory ID and directory display name be necessary when creating each folder?

Would it be possible to make a top level folder invisible or closed on the user upload directory tree but keep the subfolders, if appropriately flagged, visible or open to uploading?


I am not a big fan of HT access at least not for the gallery..... if I understand what it is.......that is the little gray user password screen right?


Maybe this idea is to much of a hassle to implement...I realize it may be outside the scope of the sript Mike.

Andrew

« Last Edit: December 31, 1969, 19:00:00 by 1039064400 »

Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re: Limit upload to certain directories
« Reply #6 on: July 30, 2002, 06:29:14 »
Hi Andrew,

Good thoughts. My referene to .htaccess was actually just as an example. (So I wouldn't actually be using .htaccess to ask for a password - it's not server independant.) I'd use a similar file directories that needed to be controlled (maybe a file called rights.txt or something).

Anyway, I think central is the way to go probably, but it means that when directories are renamed that'll break the rights you've assigned them...
« Last Edit: December 31, 1969, 19:00:00 by 1039064400 »

Offline Andrew

  • album.pl Hacker
  • ****
  • Posts: 114
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • WHITEWATER!
Re: Limit upload to certain directories
« Reply #7 on: July 30, 2002, 18:47:53 »
Right Mike.....

As you are aware I don't know what the hell I am talking about....

Anyway...in response to your last post here...Yes...that is why I suggested that a checkbox be instituted on the Update descriptions/Create Album and on the Edit screens.  

I am not quite sure how you aim to populate the folder referances in the Permissions file.  Would this files population be manual or would it be automatic?

Andrew

« Last Edit: December 31, 1969, 19:00:00 by 1039064400 »

Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re: Limit upload to certain directories
« Reply #8 on: July 31, 2002, 05:40:24 »
These things usually start manual and become automatic as I evolve them a bit more.  ;D

It would probably end up in the album admin menu, as a "Hide from Upload" or "Show on Upload" item depending on the album's current status. Let me run through some info here...

Central
  • Central no_uploads.txt file in root album simply contains list of all album names where uploads are not permitted.
  • Can be effective on album and all it's sub-albums.


Local
  • Works by checking for the presence of a "no_upload.txt" file. File is empty, so presence or absence determines if uploads are allowed to this dir.
  • Moved/renamed albums will still work


Ok, so it's not much info yet... :) As you can see, each has a benefit and a drawback.
« Last Edit: December 31, 1969, 19:00:00 by 1039064400 »

Offline Andrew

  • album.pl Hacker
  • ****
  • Posts: 114
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • WHITEWATER!
Re: Limit upload to certain directories
« Reply #9 on: August 05, 2002, 15:13:41 »

Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re: Limit upload to certain directories
« Reply #10 on: August 05, 2002, 17:17:28 »
Your wish is granted... :)

Just replace you album.pl and any album that has no_upload.txt in it (can be an empty file) will not show in the upload list.

Enjoy!

Edit: I know it's not as fancy as your idea above, but it's a start! :)

Offline Andrew

  • album.pl Hacker
  • ****
  • Posts: 114
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • WHITEWATER!
Re: Limit upload to certain directories
« Reply #11 on: August 05, 2002, 19:04:30 »
Hehehe....well grand schemes are my forte....it's just implementing them that is the catch!

Thanks a bunch buddy....I really appreciate it!!!!

Andrew
« Last Edit: December 31, 1969, 19:00:00 by 1039064400 »

Offline tcultice

  • album.pl User
  • *
  • Posts: 16
  • Karma: +0/-0
  • Offical Walleye Junkie
    • ohio-walleye.com
Re: Limit upload to certain directories
« Reply #12 on: August 06, 2002, 09:54:49 »
Hi Mike & Guys,


  Was wondering if it would be possible to add a "valid extentions" field in the config for each album? Would be an easy way to not allow uploads to certin albums. Well it seems simple to me, a guy who has never written a single line of code! I would like to only allow uploads to the sub directories and not the main album.

Just a thought

tcultice
« Last Edit: December 31, 1969, 19:00:00 by 1039064400 »

Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re: Limit upload to certain directories
« Reply #13 on: August 06, 2002, 10:23:49 »
You should be able to do that now, just drop a file called no_uploads.txt into your main album directory, and it won't show up on the upload screen any more.

I think the upload section would have to be re-written to honour local extension settings, it's just not flexible enough as it is... :(
« Last Edit: December 31, 1969, 19:00:00 by 1039064400 »

Offline tcultice

  • album.pl User
  • *
  • Posts: 16
  • Karma: +0/-0
  • Offical Walleye Junkie
    • ohio-walleye.com
Re: Limit upload to certain directories
« Reply #14 on: August 06, 2002, 14:08:03 »
Thanks for the reply Mike,

  Let me make sure I understand you before I go pullin on wires and pushin buttons.

Just create a  blank file on notepad or similar, called "no_upload.txt" and drop  it into my main album dir where all my sub dir's are?    

Thanks

tcultice
« Last Edit: December 31, 1969, 19:00:00 by 1039064400 »