Re: Undefined Index? Re: Undefined Index?
 

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

Re: Undefined Index?

Started by Nibbler, July 11, 2005, 12:29:15 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nibbler

Go into your database, find the cpg_config table, and set debug_mode to 1. Then you'll get a more detailed error message.

Anhinga

I searched the cpg_config table for that phrase, but it didn't find anything.

If you give me the path for the SMF database, I'll tell you exactly what that table says.  (I don't know what directory it's stored in.)

Nibbler

debug_mode is the name of a field in the table, you can't search for it.

Databases don't have paths.

If you can run an SQL query in phpmyadmin, then try

UPDATE cpg_config SET value = '1' WHERE name = 'debug_mode'

Changing cpg_ to the prefix you chose during installation.

Anhinga

I got an error saying that this table doesn't exist.  But I know it does--it's one of the tables listed under the name of the database under PHP MyAdmin.

Is there another way to edit this table?  I don't have much experience with PHP MyAdmin.

Nibbler

OK, forget the database for now. Edit your include/init.inc.php, find

require 'include/media.functions.inc.php';

and just before/above it add

$CONFIG['debug_mode'] = 1;

Save and reupload the file.

Anhinga

All right, I did that.  But that hasn't changed the error I get when I try to access the Coppermine gallery on my domain.

What do I need to do next?

Nibbler

Then that means it can't find your config table.

If you are happy to PM me FTP/phpmyadmin details I can take a look for you.

Nibbler

You need to make sure include/config.inc.php has the correct information, it the table exists then Coppermine will find it.Try adding the line I mentioned previously above

// User DB system

instead.

Anhinga

Still no change.  Here's what include/config.php contains, in case that will help any:

<?php
// Coppermine configuration file

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


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


agahnim_smf1 is the name of the SMF database; I've changed it from agahnim_copp1 which is what it said originally.  I starred out the password for security reasons.

Also, here's what the cpg_config table says in the backup I restored it from.

# Table structure for table `CPG_config`
#

CREATE TABLE CPG_config (
  name varchar(40) NOT NULL default '',
  value varchar(255) NOT NULL default '',
  PRIMARY KEY  (name)
) TYPE=MyISAM;


Any idea what else I could try?

Nibbler

Aha !

CPG_ is different to cpg_ - make sure the cases match.

Nibbler

Yeah, remove the code you added into init.inc.php otherwise everyone will be in debug mode. Login and go through all the options in the config page, it looks like they have been blanked or wiped.

Also update to 1.3.3, 1.3.2 is not secure.

Anhinga

Well, I've got a few problems here.  I've removed the additional code from init.inc.php but both of the error notices are still there.  I'm also not able to log into the coppermine gallery, because clicking the "log in" button takes me to the forum login page instead.

I installed Coppermine using Fanstastico, and so far it hasn't presented me with an update option yet.  What's the best way to upgrate to 1.3.3 without using Fanstastico?

Nibbler

That's supposed to happen with bridging. You login through the forum and then return to coppermine. If bridging does not work then you can disable it by commenting out the smf line init.inc.php and then log in with the admin account you setup for coppermine during install.

You can update to 1.3.3 by downloading it from the downloads page and following the update instructions.

Nibbler

OK, run these queries on your database to refill the config table with settings.

INSERT INTO CPG_config VALUES ('albums_per_page', '12');
INSERT INTO CPG_config VALUES ('album_list_cols', '2');
INSERT INTO CPG_config VALUES ('display_pic_info', '0');
INSERT INTO CPG_config VALUES ('alb_list_thumb_size', '50');
INSERT INTO CPG_config VALUES ('allowed_mov_types', 'ALL');
INSERT INTO CPG_config VALUES ('allowed_doc_types', 'ALL');
INSERT INTO CPG_config VALUES ('allowed_snd_types', 'ALL');
INSERT INTO CPG_config VALUES ('allowed_img_types', 'ALL');
INSERT INTO CPG_config VALUES ('allow_private_albums', '1');
INSERT INTO CPG_config VALUES ('allow_user_registration', '0');
INSERT INTO CPG_config VALUES ('allow_duplicate_emails_addr', '0');
INSERT INTO CPG_config VALUES ('caption_in_thumbview', '1');
INSERT INTO CPG_config VALUES ('views_in_thumbview', '1');
INSERT INTO CPG_config VALUES ('charset', 'language file');
INSERT INTO CPG_config VALUES ('cookie_name', 'cpg133');
INSERT INTO CPG_config VALUES ('cookie_path', '/');
INSERT INTO CPG_config VALUES ('debug_mode', '0');
INSERT INTO CPG_config VALUES ('debug_notice', '0');
INSERT INTO CPG_config VALUES ('default_dir_mode', '0755');
INSERT INTO CPG_config VALUES ('default_file_mode', '0644');
INSERT INTO CPG_config VALUES ('default_sort_order', 'na');
INSERT INTO CPG_config VALUES ('ecards_more_pic_target', 'http://coppermine.sourceforge.net/');
INSERT INTO CPG_config VALUES ('enable_smilies', '1');
INSERT INTO CPG_config VALUES ('filter_bad_words', '0');
INSERT INTO CPG_config VALUES ('forbiden_fname_char', '$/\\\\:*?&quot;\'&lt;&gt;|`');
INSERT INTO CPG_config VALUES ('fullpath', 'albums/');
INSERT INTO CPG_config VALUES ('gallery_admin_email', 'you@somewhere.com');
INSERT INTO CPG_config VALUES ('gallery_description', 'Your online photo album');
INSERT INTO CPG_config VALUES ('gallery_name', 'Coppermine Photo Gallery');
INSERT INTO CPG_config VALUES ('im_options', '-antialias');
INSERT INTO CPG_config VALUES ('impath', '');
INSERT INTO CPG_config VALUES ('jpeg_qual', '80');
INSERT INTO CPG_config VALUES ('keep_votes_time', '30');
INSERT INTO CPG_config VALUES ('lang', 'english');
INSERT INTO CPG_config VALUES ('main_page_layout', 'breadcrumb/catlist/alblist/random,2/lastup,2');
INSERT INTO CPG_config VALUES ('main_table_width', '100%');
INSERT INTO CPG_config VALUES ('make_intermediate', '1');
INSERT INTO CPG_config VALUES ('max_com_lines', '10');
INSERT INTO CPG_config VALUES ('max_com_size', '512');
INSERT INTO CPG_config VALUES ('max_com_wlength', '38');
INSERT INTO CPG_config VALUES ('max_img_desc_length', '512');
INSERT INTO CPG_config VALUES ('max_tabs', '12');
INSERT INTO CPG_config VALUES ('max_upl_size', '1024');
INSERT INTO CPG_config VALUES ('max_upl_width_height', '2048');
INSERT INTO CPG_config VALUES ('min_votes_for_rating', '1');
INSERT INTO CPG_config VALUES ('normal_pfx', 'normal_');
INSERT INTO CPG_config VALUES ('offline', '0');
INSERT INTO CPG_config VALUES ('picture_table_width', '600');
INSERT INTO CPG_config VALUES ('picture_width', '400');
INSERT INTO CPG_config VALUES ('randpos_interval', '1063623637');
INSERT INTO CPG_config VALUES ('read_exif_data', '0');
INSERT INTO CPG_config VALUES ('reg_requires_valid_email', '1');
INSERT INTO CPG_config VALUES ('subcat_level', '2');
INSERT INTO CPG_config VALUES ('theme', 'classic');
INSERT INTO CPG_config VALUES ('thumbcols', '4');
INSERT INTO CPG_config VALUES ('thumbrows', '3');
INSERT INTO CPG_config VALUES ('thumb_method', 'im');
INSERT INTO CPG_config VALUES ('thumb_pfx', 'thumb_');
INSERT INTO CPG_config VALUES ('thumb_width', '100');
INSERT INTO CPG_config VALUES ('userpics', 'userpics/');
INSERT INTO CPG_config VALUES ('user_field1_name', '');
INSERT INTO CPG_config VALUES ('user_field2_name', '');
INSERT INTO CPG_config VALUES ('user_field3_name', '');
INSERT INTO CPG_config VALUES ('user_field4_name', '');
INSERT INTO CPG_config VALUES ('display_comment_count', '0');
INSERT INTO CPG_config VALUES ('show_private', '0');
INSERT INTO CPG_config VALUES ('first_level', '1');
INSERT INTO CPG_config VALUES ('display_film_strip', '1');
INSERT INTO CPG_config VALUES ('max_film_strip_items', '5');
INSERT INTO CPG_config VALUES ('thumb_use', 'any');
INSERT INTO CPG_config VALUES ('comment_email_notification', '0');
INSERT INTO CPG_config VALUES ('read_iptc_data', '0');
INSERT INTO CPG_config VALUES ('reg_notify_admin_email', '0');
INSERT INTO CPG_config VALUES ('disable_comment_flood_protect', '0');
INSERT INTO CPG_config VALUES ('upl_notify_admin_email', '0');
INSERT INTO CPG_config VALUES ('display_uploader', '0');
INSERT INTO CPG_config VALUES ('language_list', '0');
INSERT INTO CPG_config VALUES ('language_flags', '0');
INSERT INTO CPG_config VALUES ('theme_list', '0');
INSERT INTO CPG_config VALUES ('language_reset', '1');
INSERT INTO CPG_config VALUES ('theme_reset', '1');
INSERT INTO CPG_config VALUES ('allow_memberlist', '0');
INSERT INTO CPG_config VALUES ('display_faq', '0');
INSERT INTO CPG_config VALUES ('show_bbcode_help', '1');
INSERT INTO CPG_config VALUES ('log_ecards', '0');
INSERT INTO CPG_config VALUES ('email_comment_notification', '0');
INSERT INTO CPG_config VALUES ('enable_zipdownload', '1');
INSERT INTO CPG_config VALUES ('slideshow_interval', '5000');


Then you should be able to disable the bridge as described previously and login.

Anhinga

I got another error message while trying to run the query.

QuoteSQL-query:

INSERT INTO CPG_config
VALUES (
'allowed_mov_types', 'ALL'
)

MySQL said: Documentation
#1062 - Duplicate entry 'allowed_mov_types' for key 1

Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /usr/local/cpanel/base/3rdparty/phpMyAdmin/libraries/common.lib.php on line 685

Any idea what I should do about this?

Nibbler

Empty the CPG_config table and then run the queries.

Anhinga

I'm not able to empty the table completely; it says that a table has to have at least one collumn in it.  And if I delete the table entirely, then when I run the query I get an error message saying that the table doesn't exist.

This table currently has two collumns in it:  name varchar(40) NOT NULL default '', and value varchar(255) NOT NULL default '',.  Do you want me to delete just one of these, or drop the entire table?

Anhinga

That's odd... I tried running the query you suggested a second time with both of those collumns in the table, and this time it worked.  Now the only remaining problem is that when I log into the forum, that doesn't log me into Coppermine.

But anyway, I guess that's something I should start a new thread about.  Thanks for all your help.