Upgraded from 1.4.19 to .25 = Fatal error Upgraded from 1.4.19 to .25 = Fatal error
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Upgraded from 1.4.19 to .25 = Fatal error

Started by Dolkur, July 20, 2009, 12:24:42 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dolkur

My site works fine with all files updated, except "include/init.inc.php". If I'm using version 1.4.19 of init.inc.php it works fine.
With version 1.4.25 of init.inc.php, I get the code:
Fatal error :<br /><br />.<br /><br/>
                    <form name="mysql"><textarea rows="8" cols="60">While executing query &quot;SELECT MAX(group_quota) as disk_max, MIN(group_quota) as disk_min, MAX(can_rate_pictures) as can_rate_pictures, MAX(can_send_ecards) as can_send_ecards, MAX(upload_form_config) as ufc_max, MIN(upload_form_config) as ufc_min, MAX(custom_user_upload) as custom_user_upload, MAX(num_file_upload) as num_file_upload, MAX(num_URI_upload) as num_URI_upload, MAX(can_post_comments) as can_post_comments, MAX(can_upload_pictures) as can_upload_pictures, MAX(can_create_albums) as can_create_albums, MAX(has_admin_access) as has_admin_access, MIN(pub_upl_need_approval) as pub_upl_need_approval, MIN( priv_upl_need_approval) as  priv_upl_need_approval FROM  WHERE group_id in (3)&quot; on 0

mySQL error:
</textarea></form>


I followed the update procedure. I have run update.php.

http://hg.faroenature.net/gallery/
MySQL: 5.1.30
PHP: 5.2.5


Any suggestions as to where my problem lies?

Gene-2008

1st I'm no expert...just a fellow traveler.

2nd Your error is occurring in the udb_base.inc.php   looks like from the code that if the group_id = 3 does not exist than you get a critical error....like you are getting.  You might 1) check your data base and make sure you have a group_id of 3 which is "guest"... 2) You might check for differences between the two versions of init.inc.php...

I know this is not the solution you might want but hope it helps.
Gene


    // Perform database queries to calculate user's privileges based on group membership
    function get_user_data($pri_group, $groups, $default_group_id = 3)
    {

//Parameters :
//   $pri_group (scalar) :  Group ID number of the user's 'main' group.
// This is the group that will be the user's profile display.
// ($USER_DATA['group_id'])
//
//   $groups (array) :      List of group ids of all the groups that the user is a member of.
// IF this list does not include the $pri_group, it will be added.
//
//  $default_group_id (scalar) :  The group used as a fall-back if no valid group ids are specified.
//                                If this group also does not exist then CPG will abort with a critical error.
//
// Returns an array containing most of the data to put into in $USER_DATA.

            global $CONFIG;

            foreach ($groups as $key => $val)
                    if (!is_numeric($val))
                            unset ($groups[$key]);
            if (!in_array($pri_group, $groups)) array_push($groups, $pri_group);

            $result = cpg_db_query("SELECT MAX(group_quota) as disk_max, MIN(group_quota) as disk_min, " .
                            "MAX(can_rate_pictures) as can_rate_pictures, MAX(can_send_ecards) as can_send_ecards, " .
                            "MAX(upload_form_config) as ufc_max, MIN(upload_form_config) as ufc_min, " .
                            "MAX(custom_user_upload) as custom_user_upload, MAX(num_file_upload) as num_file_upload, " .
                            "MAX(num_URI_upload) as num_URI_upload, " .
                            "MAX(can_post_comments) as can_post_comments, MAX(can_upload_pictures) as can_upload_pictures, " .
                            "MAX(can_create_albums) as can_create_albums, " .
                            "MAX(has_admin_access) as has_admin_access, " .
                            "MIN(pub_upl_need_approval) as pub_upl_need_approval, MIN( priv_upl_need_approval) as  priv_upl_need_approval ".
                            "FROM {$CONFIG['TABLE_USERGROUPS']} WHERE group_id in (" .  implode(",", $groups). ")");

Dolkur

Hi Gene

I did notice that the query related to the usergroups and checked the table. But it looks fine to me. And I've checked the difference between the two versions of init.inc.php. There are of course differences, but none that I can see which would give that error.

I hadn't noticed that the error occurs in udb_base.inc.php. I'll look into that.

Dolkur

Actually.

My coppermine is bridged, and the cpg_users table is totally empty!
Could this be related to that?

Nibbler

If it's empty it's because you emptied it. I don't think it's related though. Make sure you uploaded all the files and that none is corrupted.