Community Support for OpenDocMan (Deprecated)
Locking uploads to most users - Printable Version

+- Community Support for OpenDocMan (Deprecated) (
+-- Forum: OpenDocMan Community Discussion (
+--- Forum: OpenDocMan Support - Community Based (
+--- Thread: Locking uploads to most users (/thread-80.html)

Locking uploads to most users - Stephen - 01-13-2010

2004-11-11 09:26:17 PST
Is there a way to prevent non-admin users from uploading files at all, please?

I suppose it'd be possible to write a hack to hide the 'Add file' link depending on user type, but that seems a little kludgy...

Many thanks.

2004-11-11 09:34:56 PST
That feature is not included. Anyone with login perms can add a file (although they are not available until a reviewer authorizes them).

You could add a config.php entry for admin_only_upload = yes and then add a test in add.php to see of that is set, if so, only allow admin.


2004-11-11 09:35:41 PST
By the way, if you do make that change, I would like the changes also so I can add it to the next release.


2004-11-11 09:38:48 PST
I'd be delighted to try, though my php skills are crunch to say the least.

2004-11-11 09:40:00 PST
OK. That sounds like a good route. Thanks.

Re: Locking uploads to most users - mali77 - 08-03-2011

This does not work I added the following entry in config.php but non admins can still see and upload files

// Admin only upload option
'admin_only_upload' => 'On',

Anyone got it working?

Re: Locking uploads to most users - mikoyan - 08-09-2011

I did this by hiding the Add button for non admin users...

Actually in my hack, the buttons are rendered within a helper I wrote a validation clause around the add button display to let it be shown to only admins... if you have to change it on all pages, it wont be easy to manage

Re: Locking uploads to most users - mali77 - 08-09-2011

Yeah I pretty much would be happy to do that i.e; non admins can't see the Add button. However I'm not as savy in programming as you are Sad. If you'd like to share your mod I'll greatly appreciate it and I'm sure lot of other people. If not I totally understand.

Re: Locking uploads to most users - berd - 04-12-2012

In case someone is still looking... A quick fix for me was to modify the templates/default/header.tpl file. In the header.tpl file around line 44 change the following lines to hide buttons from all but uid=1, uid=1 is admin for me:

{if $smarty.session.uid == 1} <a href="{$g_base_url}/add.php" class="regular"><img src="{$g_base_url}/images/plus.png" alt="add file"/>{$g_lang_button_add_document}</a>{/if}