4images Forum & Community

4images Issues / Ausgaben => Discussion & Troubleshooting => Topic started by: mrkaswa on March 29, 2009, 03:09:50 AM

Title: Blocking uploads
Post by: mrkaswa 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
Title: Re: Blocking uploads
Post by: mrkaswa 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?
Title: !
Post by: Nicky 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!
Title: Re: Blocking uploads
Post by: mrkaswa 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.
Title: Re: Blocking uploads
Post by: Sunny C. 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?