Advanced search  

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]

Pages: [1]   Go Down

Author Topic: [Solved]: cannot post comments  (Read 3505 times)

0 Members and 1 Guest are viewing this topic.

okiem

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 40
[Solved]: cannot post comments
« on: February 17, 2008, 09:38:32 pm »

I have problem with posting comments. It looks diferently in IE and in Firefox-

IE.
After posting (cliking OK) I see error page with notification that is some problem with viewing db_input.php, after refreshing there is note taht is missing some parameter.

Firefox
After posting is opened small window od downloading page (db_input.php)

I use Captcha plugin, but without it, everything is the same, sitaution is the same if you are logged or not, also with e-mail notofication to admin or not.

My database   www.genealogia.okiem.pl/foto2
« Last Edit: March 02, 2008, 10:31:39 am by Joachim Müller »
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: cannot post comments
« Reply #1 on: February 18, 2008, 07:56:38 am »

I was able to post a comment here: http://genealogia.okiem.pl/foto2/displayimage.php?pos=-116

Did it in FF.

Could this have been a temporary problem with your server? Can you try again now? It seems other people have been able to post comments: http://genealogia.okiem.pl/foto2/thumbnails.php?album=lastcom&cat=0
Logged

okiem

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 40
Re: cannot post comments
« Reply #2 on: March 02, 2008, 01:08:56 am »

Yes - I am able also post comments - (first comments) but I cannot post second comment if one already exist. Try

http://www.genealogia.okiem.pl/foto2/displayimage.php?pos=-645
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: cannot post comments
« Reply #3 on: March 02, 2008, 01:57:12 am »

Ok, I tried it and it did prompt to download the db_input.php file. I downloaded and opened it in a text editor and it was blank. I don't know what could be causing this if you say that it's an issue with the captcha mod and without it.
Logged

okiem

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 40
Re: cannot post comments
« Reply #4 on: March 02, 2008, 02:15:01 am »

It happen only with CAPTACH - but:

during installing Captach it dosn't work properly so I discover that i have put some code id d_input.php
section comment looks now:

Quote
    // Comment

    case 'comment':
        if (!(USER_CAN_POST_COMMENTS)) cpg_die(ERROR, $lang_errors['perm_denied'], __FILE__, __LINE__);


        check_comment($_POST['msg_body']);
                check_comment($_POST['msg_author']);
        $msg_author = addslashes(trim($_POST['msg_author']));
        $msg_body = addslashes(trim($_POST['msg_body']));
        $pid = (int)$_POST['pid'];

        if ($msg_author == '' || $msg_body == '') cpg_die(ERROR, $lang_db_input_php['empty_name_or_com'], __FILE__, __LINE__);

        $result = cpg_db_query("SELECT comments FROM {$CONFIG['TABLE_PICTURES']}, {$CONFIG['TABLE_ALBUMS']} WHERE {$CONFIG['TABLE_PICTURES']}.aid = {$CONFIG['TABLE_ALBUMS']}.aid AND pid='$pid'");
        if (!mysql_num_rows($result)) cpg_die(ERROR, $lang_errors['non_exist_ap'], __FILE__, __LINE__);
        $album_data = mysql_fetch_array($result);
        mysql_free_result($result);

        if ($album_data['comments'] != 'YES') cpg_die(ERROR, $lang_errors['perm_denied'], __FILE__, __LINE__);

        if (!$CONFIG['disable_comment_flood_protect']){
          $result = cpg_db_query("SELECT author_md5_id, author_id FROM {$CONFIG['TABLE_COMMENTS']} WHERE pid = '$pid' ORDER BY msg_id DESC LIMIT 1");
          if (mysql_num_rows($result)) {
              $last_com_data = mysql_fetch_array($result);
              if ((USER_ID && $last_com_data['author_id'] == USER_ID) || (!USER_ID && $last_com_data['author_md5_id'] == $USER['ID'])) {
                  cpg_die(ERROR, $lang_db_input_php['no_flood'], __FILE__, __LINE__);
              }
 :)            require("include/captcha.class.php");
 :)        if (!PhpCaptcha::Validate($_POST['confirmCode'])) {
 :)          cpg_die(ERROR, "Confirmation code didn't matched", __FILE__, __LINE__);
 :)        }
      }
        }

Runing without CAPTACHA I have to uninstall plugin and erase those "happy" lines. After it I CAN post second message.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: cannot post comments
« Reply #5 on: March 02, 2008, 09:17:19 am »

Try the captcha plugin instead of the captcha mod. Use the most recent version of the mod if you must stick with it.
Logged

okiem

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 40
Re: cannot post comments
« Reply #6 on: March 02, 2008, 10:29:05 am »

ha! I discover mistake - very simple

Quote
                  cpg_die(ERROR, $lang_db_input_php['no_flood'], __FILE__, __LINE__);
 :)             
            require("include/captcha.class.php");
        if (!PhpCaptcha::Validate($_POST['confirmCode'])) {
          cpg_die(ERROR, "Confirmation code didn't matched", __FILE__, __LINE__);
 :)             }
              }
           }
        }

Logged
Pages: [1]   Go Up
 

Page created in 0.025 seconds with 19 queries.