News:

CPG Release 1.6.28
added submissions from {406man}
cleaned up a few PHP (8.4) deprecations
fixed PHP deprecation in calendar
removed security vulnerability
(please upgrade when possible)

Main Menu

User information is wrong.

Started by icebox, October 09, 2003, 12:18:56 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

icebox

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  :?:
Cool photos, reviews, forums at:
http://www.openphoto.tk/
[size=10]Note: Contains  artistic nudity...[/size]


icebox

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 ?
Cool photos, reviews, forums at:
http://www.openphoto.tk/
[size=10]Note: Contains  artistic nudity...[/size]

gtroll

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 $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

Backup usermgr.php file and try this
replace:$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
$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

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...
Cool photos, reviews, forums at:
http://www.openphoto.tk/
[size=10]Note: Contains  artistic nudity...[/size]

icebox

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

gtroll

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

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

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
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...
Cool photos, reviews, forums at:
http://www.openphoto.tk/
[size=10]Note: Contains  artistic nudity...[/size]