Directories for users Directories for users
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Directories for users

Started by Nemesys, October 09, 2005, 04:08:54 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nemesys

Hello:

I have recently installed CPG but had a question about users uploading files.

As an admin, I can copy files into a specific directory under albums, such as albums/Nemesys/.  It appears however that when a user uploads a file it is always stored in the albums/userpics directory.  Is there a way so that each user can have their own separate directory that their uploaded files go into?  Or perhaps a new directory for each specific album?

Thank you all for your help.

~Nemesys

Nibbler

Each user does have a seperate directory, assuming you are not running with silly_safe_mode enabled. Check your config.inc.php

Nemesys

#2
quite sorry to be such a newb on this but I was hoping for some further clarification

<?php
// Coppermine configuration file
// Silly safe mode
define('SILLY_SAFE_MODE', 1);


// MySQL configuration
$CONFIG['dbserver'] =                         'localhost';        // Your database server
$CONFIG['dbuser'] =                         'xxxx';        // Your mysql username
$CONFIG['dbpass'] =                         'xxxx';                // Your mysql password
$CONFIG['dbname'] =                         'xxxx';        // Your mysql database name


// MySQL TABLE NAMES PREFIX
$CONFIG['TABLE_PREFIX'] =                'cpg_';
?>


Yet when people create galleries, all of the images they upload are all dumped into the albums/userpics directory.  I have permissions set to 777 for the albums, userpics, and include dirs.  I tried removing the SILLY_SAFE_MODE clause from the if statement in the upload.php, it would then create the directory for the user, however it would say that the file could not be placed.  I did return this back to the normal state however.  Is there something else that I am missing here??

Thank you again for your help.

~Nemesys

Stramm

you're probably on a shared server. Therefore your host has enabled safe mode to solve some security problems. Disadvantage is that not all php functions work properly anymore. One of these functions is mkdir. It creates new directories. I guess now your question is answered. If you want the script to create directories the save mode needs to be disabled. This only your host can do. The entry in config.inc.php just tells coppermine that safe mode is enabled on your server.

Nemesys

Yes I am on a shared server.  Thank you for your help.  I sort of found a way around it all.  Since only a handful of people will be using CPG I went into the userpics dir and created some directories such as 10001, 10002, 10003, etc. and removed the checking statement from the upload.php file.  It more or less works now, if I need to add more users, I just have to create their directories manually first.

Again thank you all for your help.

imrich

I have a question about 'silly safe mode'.

For a while, i've been running without safe mode. All is almost fine! :)

Recently my web host turned on safe mode.  Luckily I was able to request that it be turned off for me, which they did.

I have had a few problems which is very much a pain.

Here is the problem.

in my userpics directory there are multiple directories, one for each uers, say 10001, 10002, etc.

When coppermine creates these files, they get the UID/GID of 'apache'.  This appears ok as long as everything is normal.

However all the other files on my web host have a UID/GID of 'username' not 'apache'. As 'username' I can't do anything to these 'apache' files.  This is a pest!!

Also, if I have to do a restore from my backup, all the files are placed back on my webserver as 'username', not 'apache'. After this happens, I have to chmod these 'username' folders to 777 to allow a user to be able to upload files otherwise coppermine can't write to the directories.  This is more of a pest!!

So I thought I would be 'smart' and turn on 'silly safe mode'. When I did this, I noticed that users files no longer go into their subdirectory, but are all in 'userpics'. 

Question 1) Is this the normal function when 'silly safe mode' is turned on?

Question 2) Is there another way to solve the issue with the folders being created as 'apache' and me having to chmod all the folders as which are owned by 'username' to 777 to allow user access?

Thanks for your thoughts and help!