Bug: Can't post with Email field empty or turned off

Phoca Guestbook - creating guestbooks in Joomla! CMS
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48726
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Bug: Can't post with Email field empty or turned off

Post by Jan »

Hi, did you set the parameters in parameters component?
https://www.phoca.cz/documents/16-joomla ... -in-joomla

If you are not logged in, system doesn't know you and you cannot use email address which is used by some registered user (in case you write your email adress which is registered for you and you are not logged in, system doesn't know you and you cannot use this email address - search this forum, I have explained it here)
is it really necessary to check entered email adresses against the user database at all, even when entries are made by guests
- yes, you cannot use email of other person. If you will register into some system, you will not like if somebody other will write messages with your name and with your email address. So the checking the email is necessary. Anonymous users cannot use email adress of some registered user. This is the worst case you can do for your registered users :(
If you find Phoca extensions useful, please support the project
Micha
Phoca Member
Phoca Member
Posts: 26
Joined: 17 Oct 2008, 02:43
Location: Netherlands

Re: Bug: Can't post with Email field empty or turned off

Post by Micha »

Find this post also (nice). The user email address, I use only in the backend so i can contact this person (if I want to).
I don't show the user email address on the frontpage so it doens't matter if someone use a mail address from a reg.user.
A review is a review and for me, only a name is good enough for the guestbook. So in my opinion is this emailaddress check not necessary. How can we switch off this check?

If there is no solution I must switch off the e-mail field. But i prefer a email address in the back-end so i always can contact the person. But can the email field be switched off so everyone can write reviews? Because the topic starter never gave a reaction to the answer from Jan :wink:

Thanks everyone,

Micha
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48726
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Bug: Can't post with Email field empty or turned off

Post by Jan »

If you find Phoca extensions useful, please support the project
rawu
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 07 Dec 2009, 09:33

Re: Bug: Can't post with Email field empty or turned off

Post by rawu »

I would like to come back to the original thread.

My parameters in global configuration and menü are:

E-Mail-Adress required: no
Display E-Mail input field in message form: no

So the user does not have any possibility of entering an e-mail-address. Nevertheless the message appears: This e-mail-adress already exists!

Why?

best regards!
Ralf
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48726
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Bug: Can't post with Email field empty or turned off

Post by Jan »

Hi, did you set it in parameters component in menu link to guestbook? is the input field displayed in frontend?

See:
https://www.phoca.cz/documents/16-joomla ... -in-joomla

Jan
If you find Phoca extensions useful, please support the project
rawu
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 07 Dec 2009, 09:33

Re: Bug: Can't post with Email field empty or turned off

Post by rawu »

Jan wrote:Hi, did you set it in parameters component in menu link to guestbook?
yes, also in global configuration
Jan wrote: is the input field displayed in frontend?
no

I've solved the problem with a change in /com_phocaguestbook/controllers/phocaguestbook.php

Change line 300 to 310:

Code: Select all

// check for existing email
		$query = 'SELECT id'
			. ' FROM #__users '
			. ' WHERE email = '. $db->Quote($post['email'])
			. ' AND id != '. (int) $user->id
			;
		$db->setQuery( $query );
		$xid = intval( $db->loadResult() );
		if ($xid && $xid != intval( $user->id )) {
			$email = 0; JRequest::setVar( 'email-msg-3', 1, 'get',true );
		}
to

Code: Select all

// check for existing email
		if ($post['email'] && trim($post['email']) !='' )
		{
		$query = 'SELECT id'
			. ' FROM #__users '
			. ' WHERE email = '. $db->Quote($post['email'])
			. ' AND id != '. (int) $user->id
			;
		$db->setQuery( $query );
		$xid = intval( $db->loadResult() );
		if ($xid && $xid != intval( $user->id )) {
			$email = 0; JRequest::setVar( 'email-msg-3', 1, 'get',true );
		}
		}
Can you verify this change?

best regards
Ralf
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48726
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Bug: Can't post with Email field empty or turned off

Post by Jan »

Seems that it can work.
If you find Phoca extensions useful, please support the project
Post Reply