forum.coppermine-gallery.net

Dev Board => cpg1.4 Testing/Bugs => cpg1.4 Testing/Bugs: FIXED/CLOSED => Topic started by: a$h on April 22, 2006, 01:30:23 am

Title: Admin Notifications Error
Post by: a$h on April 22, 2006, 01:30:23 am
Hi there.

I think there is an error in report_file.php

Everything seemse to work ok, but when you receive e-mail instead to receive name of sender you receive
Code: [Select]
<input type="text" class="textinput" value="Rekomandim" name="sender_name" style="width: 100%;" /> <ariani_sh@yahoo.co.uk>
Also instead to recive Subject, you recive
Code: [Select]
A report from <input type="text" class="textinput" value="Guest" name="sender_name" style="width: 100%;" /> on a gallery file
Can somebody please help me with this?

Many thanks.
Title: Re: Admin Notifications Error
Post by: Joachim Müller on April 22, 2006, 09:50:44 am
link and non-admin test user account please
Title: Re: Admin Notifications Error
Post by: a$h on April 24, 2006, 01:39:29 am
GauGau,

thanks for your quick response.

user: test
pass: test

I dont will this help, but the problem that I mentioned before (in my first post) I only get it when an anonymous reports to admin. I dont have problem when a regisetred user report to admin.

Thanks.
Title: Re: Admin Notifications Error
Post by: Joachim Müller on April 24, 2006, 02:41:11 pm
what language are you testing with?
Title: Re: Admin Notifications Error
Post by: a$h on April 24, 2006, 11:50:23 pm
Im testing it with English language, but as I said in previous post I only get error when an anynomus/guest user submit the notification to admin.

Thanks GauGau
Title: Re: Admin Notifications Error
Post by: Tranz on May 02, 2006, 05:04:43 pm
I was able to confirm this on my gallery (after someone tried to spam for ambien :P) using English. I submitted a report as an anonymous user to replicate the spammer's "report".

I think it has to do with this:
Code: [Select]
if ($USER_DATA['user_email']){
        $sender_email = $USER_DATA['user_email'];
        $sender_box = $sender_email;
} else {
        $sender_email = get_post_var('sender_email',$USER['email'] ? $USER['email'] : '');
        $sender_box = "<input type=\"text\" class=\"textinput\" value=\"$sender_email\" name=\"sender_email\" style=\"width: 100%;\" />";
        $sender_name = "<input type=\"text\" class=\"textinput\" value=\"$sender_name\" name=\"sender_name\" style=\"width: 100%;\" />";
}

The input fields are for displaying in the report form when it's an anonymous user. But the problem is the $sender_name variable goes unchanged into the email message.

Title: Re: Admin Notifications Error
Post by: a$h on May 02, 2006, 08:21:06 pm
Thanks TranzNDance.

Hopefully someone will have a solution for this?

Till then...

Regards,
a$h
Title: Re: Admin Notifications Error
Post by: Tranz on May 03, 2006, 06:04:52 am
Got it. Please confirm fix.

Edit report_file.php
FIND:
Code: [Select]
        $sender_name = "<input type=\"text\" class=\"textinput\" value=\"$sender_name\" name=\"sender_name\" style=\"width: 100%;\" />";

REPLACE with:
Code: [Select]
        $sender_name = get_post_var('sender_name',$USER['name'] ? $USER['name'] : '');
        $sender_name_box = "<input type=\"text\" class=\"textinput\" value=\"$sender_name\" name=\"sender_name\" style=\"width: 100%;\" />";


FIND:
Code: [Select]
{$sender_name}
REPLACE with:
Code: [Select]
{$sender_name_box}
Title: Re: Admin Notifications Error
Post by: a$h on May 03, 2006, 01:07:00 pm
Thanks TranzNDance,

I can confirm that the fix that you provided is working. But you only need to modify the frist part and you DON'T need to replace {$sender_name} with {$sender_name_box}.

Once again thanks very much.

Kind regards,
Arian Sh.
Title: Re: Admin Notifications Error
Post by: Tranz on May 03, 2006, 05:15:26 pm
Thanks for confirming. However, I tried what you suggested and used $sender_name only and it resulted in no input box showing.
Title: Re: Admin Notifications Error
Post by: a$h on May 04, 2006, 01:29:16 am
TranzNDance,

My mistake. You are right. If you dont make both modification provided by you in previous post, then there is no input filed for the name. I only realised this after I've deleted my cookies.

Once again thanks very much  ;)
Title: Re: Admin Notifications Error
Post by: Joachim Müller on May 08, 2006, 08:25:47 am
@Thu: could you commit to stable and devel branch of svn please?
Title: Re: Admin Notifications Error
Post by: Tranz on May 08, 2006, 04:05:03 pm
done and done. :)
Title: I need clarification with a "bug" in report_file.php
Post by: Fabricio Ferrero on October 06, 2008, 03:23:49 am
I think there is something that need to be clarificated (at least to me). I though I had discovered a bug on report_file.php but after searching the forum I realised this is a know issue.

I was going to report a nedeed modification in the file:

In "report_file.php"

Search: (line 200)

<td valign="top" class="tableb" width="60%">
                        {$sender_name_box}
                </td>


I think must be:

<td valign="top" class="tableb" width="60%">
                        {$sender_name}
                </td>

Later, searching the forum I see this: http://forum.coppermine-gallery.net/index.php/topic,30694.msg143762.html#msg143762 (http://forum.coppermine-gallery.net/index.php/topic,30694.msg143762.html#msg143762)

But doing that, resulted in no input box showing. TranzNDance already noticed that, but never was fixed.

So, what to do in order to get both features working properly?
Title: Re: I need clarification with a "bug" in report_file.php
Post by: Fabricio Ferrero on October 25, 2008, 04:09:22 am
So? I think this is a thing that must be fixed. Am I missing something?  :-\
Title: Re: Admin Notifications Error
Post by: Joachim Müller on October 25, 2008, 12:14:20 pm
Merged fabri's new thread with the existing one. Thu, could you please look into this once again?
Title: Re: Admin Notifications Error
Post by: Tranz on December 23, 2008, 04:53:52 pm
Sorry for the delay. I think I fixed it for real this time. I added:

Code: [Select]
$sender_name = $USER_DATA['user_name'];
        $sender_name_box = $sender_name;

after:
Code: [Select]
if ($USER_DATA['user_email']){
        $sender_email = $USER_DATA['user_email'];
        $sender_box = $sender_email;

I have committed the change for versions 1.4 and 1.5.

Thanks for reporting the bug, Fabricio.
Title: Re: Admin Notifications Error
Post by: Fabricio Ferrero on December 23, 2008, 06:23:53 pm
Working both features at least to me  :)

Thanks Thu!