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: [Invalid]: /BUG/ Sorry but you have already rated this file -- File: ...  (Read 7256 times)

0 Members and 1 Guest are viewing this topic.

Makc666

  • Translator
  • Coppermine addict
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 1614
  • Русский (ISO-8859-1) - Russian - Ðóññêèé (Windows)
    • Makc's home page

I control Configuration - Coppermine Photo Gallery 1.3.0 I set:
Enable debug mod -- Yes:Admin only

When I log out and try to rate some picture second time I get this one...

Sorry but you have already rated this file

File: /usr/local/www/test/coppermine/ratepic.php - Line: 55

So here is the question: Why if I set Yes:Admin only, Anonymous users can see second line (File: /usr/local/www/test...)?

Quote
USER:
------------------
Array
(
    [ID] => c3ae8c9c3b466cfdc07af80228316275
    [am] => 1
    [liv] => Array
        (
           
  • => 9
  • [1] => 10
                [2] => 5
                [3] => 11
                [4] => 6
            )

       
[theme] => classic
    [lang] => english
    [uid] => 24
)

==========================
USER DATA:
------------------
Array
(
    [disk_max] => 0
    [disk_min] => 0
    [can_rate_pictures] => 1
    [can_send_ecards] => 0
    [ufc_max] => 0
    [ufc_min] => 0
    [custom_user_upload] => 0
    [num_file_upload] => 5
    [num_URI_upload] => 3
    [can_post_comments] => 0
    [can_upload_pictures] => 0
    [can_create_albums] => 0
    [has_admin_access] => 0
    [pub_upl_need_approval] => 1
    [priv_upl_need_approval] => 1
    [group_name] => Anonymous
    [upload_form_config] => 0
    [group_quota] => 0
    [can_see_all_albums] => 0
    [group_id] => 3
    [groups] => Array
        (
           
  • => 3

        )

)

==========================
Queries:
------------------
Array
(
   
  • => SELECT extension, mime, content FROM cpg130_filetypes;
  • [1] => SELECT * FROM cpg130_users WHERE user_id='0'AND user_active = 'YES' AND user_password != '' AND BINARY MD5(user_password) = '*'
        [2] => 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 cpg130_usergroups WHERE group_id in (3)
        [3] => SELECT group_name FROM  cpg130_usergroups WHERE group_id= 3
        [4] => DELETE FROM cpg130_banned WHERE expiry < 1088065846
        [5] => SELECT * FROM cpg130_banned WHERE ip_addr='**********' OR ip_addr='**********' OR user_id=0
        [6] => SELECT aid FROM cpg130_albums WHERE visibility != '0' AND visibility !='10000' AND visibility NOT IN (3)
        [7] => SELECT a.votes as votes_allowed, p.votes as votes, pic_rating, owner_id FROM cpg130_pictures AS p, cpg130_albums AS a WHERE p.aid = a.aid AND pid = '11' LIMIT 1
        [8] => DELETE FROM cpg130_votes WHERE vote_time < 1085473846
        [9] => SELECT * FROM cpg130_votes WHERE pic_id = '11' AND user_md5_id = 'c3ae8c9c3b466cfdc07af80228316275'
    )

    ==========================
    GET :
    ------------------
    Array
    (
       
[pic] => 11
    [rate] => 2
)

==========================
POST :
------------------
Array
(
)

==========================
Page generated in 0.128 seconds - 10 queries in 0.035 seconds - Album set :
« Last Edit: June 25, 2004, 12:40:45 am by GauGau »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: /BUG/ Sorry but you have already rated this file -- File: ...
« Reply #1 on: June 24, 2004, 09:41:34 pm »

Link?

GauGau

P.S. Don't double-post! I removed your other identical posting...
Logged

Makc666

  • Translator
  • Coppermine addict
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 1614
  • Русский (ISO-8859-1) - Russian - Ðóññêèé (Windows)
    • Makc's home page
Re: /BUG/ Sorry but you have already rated this file -- File: ...
« Reply #2 on: June 25, 2004, 12:01:12 am »

Don't double-post! - I don't see any double-post. Maybe I mixed up and press quote and not edit when wanted to edit my post. Any way sorry.

What link??? To gallery. I can't give to this one. But I can't understand why you need link ?

I think I explained very clear.

1. I set I Configuration Enable debug mod -- Yes:Admin only
2. Then I log out.
3. Then I rate any picture for first time.
4. Then I rate the same picture for second time.
5. I get Gallery "Error" -- Sorry but you have already rated this file
6. But below this "Sorry but you have already rated this file" there is a line wth words "File: /usr/local/www/test/coppermine/ratepic.php - Line: 55"

Do it your self and you will see it your own eyes.

Link?

GauGau

P.S. Don't double-post! I removed your other identical posting...
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: /BUG/ Sorry but you have already rated this file -- File: ...
« Reply #3 on: June 25, 2004, 12:40:29 am »

this is not related to debug_mode nor being logged in/out, but is expectd behaviour: Line 55 in ratepic.php looks like this:
Code: [Select]
if (mysql_num_rows($result)) cpg_die(ERROR, $lang_rate_pic_php['already_rated'], __FILE__, __LINE__);Double-rating just triggers a mySQL custom error - it fires the line the error happened in. If you don't like this, simply change above code to
Code: [Select]
if (mysql_num_rows($result)) cpg_die(ERROR, $lang_rate_pic_php['already_rated']);and you should be fine.
Don't double-post! - I don't see any double-post.
That's why I wrote
Quote
I removed your other identical posting...
- you can't see it because it was removed to a board called "crap bin" where all double-posts get moved to by board moderators for reference (the crap bin can't be accessed by regular users) - although your double posting is still there... Anyway, like you said: doesn't really matter that much. ;)

GauGau
Logged

Makc666

  • Translator
  • Coppermine addict
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 1614
  • Русский (ISO-8859-1) - Russian - Ðóññêèé (Windows)
    • Makc's home page

this is not related to debug_mode - it is not true by default...
How it can't be related to debug mode???
If it was realy note related to debug mode than every time when user tries to Rate picture he will get this line...

If I set in Configuration -- Enable debug mode -- No
I don't see that line.
If I set it to Yes:Everyone or Yes:Admin only I see that line.

I think the BUG is in this code:
\include\init.inc.php
Quote
// Set error logging level
if ($CONFIG['debug_notice']==1 && ($CONFIG['debug_mode']==1 || ($CONFIG['debug_mode']==2 && GALLERY_ADMIN_MODE ))) {
    error_reporting (E_ALL);
} else {
    error_reporting (E_ALL ^ E_NOTICE);
}


this is not related to debug_mode nor being logged in/out, but is expectd behaviour: Line 55 in ratepic.php looks like this:
Code: [Select]
if (mysql_num_rows($result)) cpg_die(ERROR, $lang_rate_pic_php['already_rated'], __FILE__, __LINE__);Double-rating just triggers a mySQL custom error - it fires the line the error happened in. If you don't like this, simply change above code to
Code: [Select]
if (mysql_num_rows($result)) cpg_die(ERROR, $lang_rate_pic_php['already_rated']);and you should be fine.
GauGau

I send you a PM about that strange situation with Double posts.
That day I posted another thread and I can't find it now... So may be some mistake with that board called "crap bin"

Quote
- you can't see it because it was removed to a board called "crap bin" where all double-posts get moved to by board moderators for reference (the crap bin can't be accessed by regular users) - although your double posting is still there... Anyway, like you said: doesn't really matter that much.
« Last Edit: June 27, 2004, 06:13:42 pm by Makc666 »
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 19 queries.