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: User information is wrong.  (Read 7568 times)

0 Members and 1 Guest are viewing this topic.

icebox

  • Translator
  • Coppermine novice
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 21
    • Open Photography
User information is wrong.
« on: October 09, 2003, 12:18:56 pm »

Hi !,
I'm using Coppermine 1.1D and PHP-Nuke 6.5.
I had to make a lot of mods (most of them posted to the old board on chezgreg.net) so that it will work in safe mode, but I don't think this is the reason for this problem:
When I click on the users button I get the user list but it's wrong. The user names are correct, every user is displayed but his pic count, and disk space usage is 0. Although the pic count doesn't bother me, the fact that the usage stays 0 is a bit stressing as this menas that users have no quota...
Any ideea  :?:
Logged
Cool photos, reviews, forums at:
http://www.openphoto.tk/
[size=10]Note: Contains  artistic nudity...[/size]

gtroll

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 618
    • CPG-Nuke
User information is wrong.
« Reply #1 on: October 10, 2003, 06:49:00 am »

Cross check the info with your phpmyadmin see if the info is the same...

icebox

  • Translator
  • Coppermine novice
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 21
    • Open Photography
User information is wrong.
« Reply #2 on: October 10, 2003, 09:31:46 am »

well,
I checked cpg_pictutres and every picture has it's owner id correct.
I checked nuke_users and every owner_id from the above coresponds to the real user that uploaded the picture.

As a wild guess (php is not my strength) would it be possible that usermgr.php is checking in nuke_users table but using the field names that are found in cpg_users and so some fields don't get filled ?
Logged
Cool photos, reviews, forums at:
http://www.openphoto.tk/
[size=10]Note: Contains  artistic nudity...[/size]

gtroll

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 618
    • CPG-Nuke
usermgr.php is checking in nuke_users and cpg_usergroups
« Reply #3 on: October 10, 2003, 09:55:29 am »

No the nuke user tables are compatible the only thing I've noticed is if you set a user to coppermine admin, they also have admin priveleges in your forums.
The group quota is set in your groups link which writes to cpg_usergroups
Then when a user tries to upload one too many pics CPG shows an error message.
Do you have a user with too many pics? One way to see if the quota is working is to create a user and try to break the quota.....see what happens!
This is the code that queries the database fo the data for that page
~=Line 78 usermgr.php
Code: [Select]
$sql =  "SELECT user_id, username, user_email, UNIX_TIMESTAMP(user_regdate) as user_regdate_cp, group_name, user_active_cp, ".
                        "COUNT(pid) as pic_count, ROUND(SUM(total_filesize)/1024) as disk_usage, group_quota ".
                        "FROM {$CONFIG['TABLE_USERS']} AS u ".
                        "INNER JOIN {$CONFIG['TABLE_USERGROUPS']} AS g ON user_group_cp = group_id ".
                        "LEFT JOIN {$CONFIG['TABLE_ALBUMS']} AS a ON category = ".FIRST_USER_CAT." + user_id ".
                        "LEFT JOIN {$CONFIG['TABLE_PICTURES']} AS p ON p.aid = a.aid ".
                        "GROUP BY user_id ".
                        "ORDER BY ".$sort_codes[$sort]." ".
                        "LIMIT $lower_limit, $user_per_page";

Does yours have username, and not uname or something?

gtroll

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 618
    • CPG-Nuke
User information is wrong.
« Reply #4 on: October 10, 2003, 10:32:54 am »

Backup usermgr.php file and try this
replace:
Code: [Select]
$sql =  "SELECT user_id, username, user_email, UNIX_TIMESTAMP(user_regdate) as user_regdate_cp, group_name, user_active_cp, ".
         "COUNT(pid) as pic_count, ROUND(SUM(total_filesize)/1024) as disk_usage, group_quota ".
         "FROM {$CONFIG['TABLE_USERS']} AS u ".
         "INNER JOIN {$CONFIG['TABLE_USERGROUPS']} AS g ON user_group_cp = group_id ".
         "LEFT JOIN {$CONFIG['TABLE_ALBUMS']} AS a ON category = ".FIRST_USER_CAT." + user_id ".
         "LEFT JOIN {$CONFIG['TABLE_PICTURES']} AS p ON p.aid = a.aid ".
         "GROUP BY user_id ".
         "ORDER BY ".$sort_codes[$sort]." ".
         "LIMIT $lower_limit, $user_per_page";

with
Code: [Select]
$sql =  "SELECT user_id, username, user_email, UNIX_TIMESTAMP(user_regdate_cp) , group_name, user_active_cp, ".
         "COUNT(pid) as pic_count, ROUND(SUM(total_filesize)/1024) as disk_usage, group_quota ".
         "FROM {$CONFIG['TABLE_USERS']} AS u ".
         "INNER JOIN {$CONFIG['TABLE_USERGROUPS']} AS g ON user_group_cp = group_id ".
         "LEFT JOIN {$CONFIG['TABLE_ALBUMS']} AS a ON category = ".FIRST_USER_CAT." + user_id ".
         "LEFT JOIN {$CONFIG['TABLE_PICTURES']} AS p ON p.aid = a.aid ".
         "GROUP BY user_id ".
         "ORDER BY ".$sort_codes[$sort]." ".
         "LIMIT $lower_limit, $user_per_page";

might work - might not
I don't a place to test this so BACKUP first...

icebox

  • Translator
  • Coppermine novice
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 21
    • Open Photography
User information is wrong.
« Reply #5 on: October 10, 2003, 10:45:33 am »

Yes it is username, and no I don't think somebody is aproachin quota...
Ok... set my quota to 100 Kb, with over 3 Mb worth of pictures. Uploaded a picture greater than 100 Kb with success...
Logged
Cool photos, reviews, forums at:
http://www.openphoto.tk/
[size=10]Note: Contains  artistic nudity...[/size]

icebox

  • Translator
  • Coppermine novice
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 21
    • Open Photography
User information is wrong.
« Reply #6 on: October 10, 2003, 10:48:48 am »

Changed code, no difference...
Logged
Cool photos, reviews, forums at:
http://www.openphoto.tk/
[size=10]Note: Contains  artistic nudity...[/size]

gtroll

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 618
    • CPG-Nuke
User information is wrong.
« Reply #7 on: October 10, 2003, 11:10:33 am »

Did you log out of admin (and delete cookies) and log in as regular user?
I wonder if it could be your mods... I logged in as admin set the users quota to 100KB,  logged out, logged in as a regular user (not the user acct associated with admin) with my 1.2dev version tried to upload a pic to my user album and got
Code: [Select]

Error
Disk quota exceeded

You have a space quota of 100K, your pictures currently use 143K, adding this picture would make you exceed your quota.

File: /{myrootpath}/modules/coppermine/include/picmgmt.inc.php - Line: 63

Has picmgmt.inc.php been changed since you installed?

icebox

  • Translator
  • Coppermine novice
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 21
    • Open Photography
User information is wrong.
« Reply #8 on: October 13, 2003, 07:42:29 am »

Ok, sorry for the late response, but I've been away for the weekend.
My (stupid) mistake... Yes, logged out as administrator and I got
Code: [Select]
Disk quota exceeded

You have a space quota of 100K, your pictures currently use 0K, adding this picture would make you exceed your quota.


Now this is funny ... 8)
Are there two places where the quota is stored? He says that I have 0 Kb used up, but he knows I'm over my quota. (I probably have around 3 Mb)

I don't think I changed picmgmt.inc.php. But, since I was about to give up coppermine because of it's problems in safe mode, I tried all kind of things and when it worked I didn't remembered what I changed so to revent the unnecessary changes - and so my installation is kinda "hairy" :D  .
But since nobody else seems to have this problem, it could be really because of my mods... I think we could wait and see if it goes away in the next version...
Logged
Cool photos, reviews, forums at:
http://www.openphoto.tk/
[size=10]Note: Contains  artistic nudity...[/size]
Pages: [1]   Go Up
 

Page created in 0.045 seconds with 19 queries.