Disabling image uploads...easily?

phredphish

Joined: 2005-01-25
Posts: 11
Posted: Mon, 2005-03-28 16:35

How do I go about disabling uploading? I'm reaching the size limits on my webserver...and thusly need to limit access to only admins. I don't want to remove the user accounts for users...I just simply want to disable new image uploads.

Thanks,
Andrew

<Please check the G2 FAQ (sticky topic in this forum) before posting!>
----

Gallery URL (optional): http://galleries.palenimbus.com/friends
Gallery version: Latest CVS
Webserver (with version):
Datatabase (with version):
PHP version (eg 4.2.1):
phpinfo URL (optional):
Graphics Toolkit(s):
Operating system:
Web browser/version:
G1 version (for migration bugs):

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2005-03-28 16:48

depends on what permissions you gave your friends and how you organized your groups etc.
i assume you haven't created any groups etc.

1. then go to your top gallery
2. edit permissions,
3. remove the [core] add sub-albums, add sub-items permissions from the All users group. apply the changes to sub-items (i.e. have the checkbox for this checked).

 
phredphish

Joined: 2005-01-25
Posts: 11
Posted: Mon, 2005-03-28 16:59

I do have groups -- but I also have it set to, when a user creates a new sub-album off of the main album, to give ownership rights to that sub-album to the user that created it. I don't want to take away permissions (only to have to go through and repermission everything later), I'd like to just disable the upload page/applets...but there isn't a single 'module' for that.

-Andrew

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2005-03-28 17:04

if you want to temporarily block uploads w/o changing any permissions you can modify modules/core/module.inc where it adds the "add items" action.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2005-03-28 17:15

a quota module is in the works, just for these uses. it should be due soon, but this is maybe too late for you.

G2 has not "negative permissions" where you can grant ownership but disallow actions xy.

 
phredphish

Joined: 2005-01-25
Posts: 11
Posted: Wed, 2005-03-30 01:49

Which specific lines should I comment out in modules.inc?

-Andrew

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Wed, 2005-03-30 05:24

Comment out these blocks:

            if ($isAlbum && isset($permissions['core.addDataItem'])) {
                $links[$item->getId()][] =
                    array('text' => $this->translate('add items'),
                          'params' => array('view' => 'core:ItemAdmin',
                                            'subView' => 'core:ItemAdd',
                                            'itemId' => $item->getId(),
                                            'return' => 1));
            }
        if (isset($permissions['core.addDataItem'])) {
            if ($item->getCanContainChildren()) {
                $views[] = array('name' => $this->translate('Add Items'),
                                 'view' => 'core:ItemAdd');
            }
        }

Basically, anything that links to the core:ItemAdd view.