Author Topic: Blocking uploads  (Read 7104 times)

0 Members and 1 Guest are viewing this topic.

Offline mrkaswa

  • Newbie
  • *
  • Posts: 10
    • View Profile
Blocking uploads
« on: March 29, 2009, 03:09:50 AM »

I do not wish to allow users to upload any pictures into any category,  and I dont want to have to set it for each new category or user.  I want only me as the admin can upload pictures.  I searched through here and found a posting that told me to change a setting in mysql database    (UPDATE 4images_images SET auth_upload = 9 )  however when i found my way to that I found no such setting.  Did I just miss it? Is there some way to prevent user uploads?

thanks, 

MrKaswa

Offline mrkaswa

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Blocking uploads
« Reply #1 on: March 29, 2009, 03:51:05 AM »
ok,  i see now in the settings where i can change each category one at a time,  still is there a way so that I can have all new categories blocked from upload by users?

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
!
« Reply #2 on: March 29, 2009, 01:46:20 PM »
hi,

open in your favorite PHP editor following file

admin/categories.php

change (line 45)
Code: [Select]
  "auth_upload" => AUTH_USER,to
Code: [Select]
  "auth_upload" => AUTH_ADMIN,
upload this changed file to your server..
afterward when you create new categories standard permission for upload will be only for administrator like for the direct upload.

for your old categories

copy this into a new file (example auth_upload_update.php)
Code: [Select]
<?php

error_reporting
(E_ALL);
define('ROOT_PATH''./');
include(
ROOT_PATH.'config.php');
include(
ROOT_PATH.'includes/constants.php');
include(
ROOT_PATH.'includes/db_mysql.php');
$site_db = new Db($db_host$db_user$db_password$db_name);

$sql "UPDATE ".CATEGORIES_TABLE." SET auth_upload =9";
$site_db->query($sql);
?>

save and upload it to your server, where config.php is to find (normally root of 4images)
execute it ONCE with.... http://www.yourdomain/4images/auth_upload_update.php

check if users can now upload.. if not... perfect! now you can delete the auth_upload_update.php on your server.

hope this was helpful for you!
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline mrkaswa

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Blocking uploads
« Reply #3 on: April 03, 2009, 01:09:36 AM »
Thanks for your help again,   but it looks like i am going to have to deal with a safemode problem first.

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.805
  • I ♥ 4I
    • View Profile
Re: Blocking uploads
« Reply #4 on: May 25, 2009, 11:14:31 AM »
Das ist ja super. Das finde ich wirklich klasse!
Aber mal eine andere Frage dazu.

Also,
ich habe das ja so gemacht, dass nur die Administratoren uploaden können. Allerdings wollte ich eine Gruppe anlegen, speziell für das Uploaden. Diese sollen nur den Zugriff für das Uploaden haben, sollen daher im ACP nur "Bilder verwalten" sehen können.

Ist das möglich?
« Last Edit: May 27, 2009, 11:55:35 AM by Benny »