Advanced search  

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

Pages: [1]   Go Down

Author Topic: Directories for users  (Read 4110 times)

0 Members and 1 Guest are viewing this topic.

Nemesys

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Directories for users
« on: October 09, 2005, 04:08:54 am »

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
« Last Edit: October 09, 2005, 01:00:49 pm by Stramm »
Logged

Nibbler

  • Guest
Re: Directories for users
« Reply #1 on: October 09, 2005, 08:16:03 am »

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

Nemesys

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Directories for users
« Reply #2 on: October 09, 2005, 09:16:47 am »

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
« Last Edit: October 09, 2005, 10:23:51 am by Nemesys »
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Directories for users
« Reply #3 on: October 09, 2005, 12:01:51 pm »

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

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Directories for users
« Reply #4 on: October 09, 2005, 12:31:09 pm »

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.
Logged

imrich

  • Tester
  • Coppermine regular visitor
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 70
Re: Directories for users
« Reply #5 on: November 06, 2005, 01:14:07 am »

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!
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 20 queries.