Hi,
on my guestbook I have enabled the setting "Only Registered User can post a message".
I would have this situation: a registered user can post a message but he cannot change his username in the "name form".
So I will be sure that he is the real writer of that message.
In the Preferences Panel I have set: Display Name Form Yes (required) and Show Name in the message.
I dont't know you have really understood me, It's quite difficult to explain that for me!
In other words, only a registered user can post a messagge ONLY with his real username (choosen during the standard joomla registration).
He can't modify his username in the guestbook form, his username will be shown on the guestbook list.
Thank you
Bye
To be sure of the owner of the message written
-
- Phoca Newbie
- Posts: 2
- Joined: 11 Jul 2010, 11:51
- Jan
- Phoca Hero
- Posts: 48739
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: To be sure of the owner of the message written
Hi, then you need to customize the code 
- you need to change the form field so it will be readonly (user will be not able to change the value)
- and you need to change the saving code, to be secure that no other form was sent - there you need to place users's name loaded by system ($user->username)
Jan

- you need to change the form field so it will be readonly (user will be not able to change the value)
- and you need to change the saving code, to be secure that no other form was sent - there you need to place users's name loaded by system ($user->username)
Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Newbie
- Posts: 2
- Joined: 11 Jul 2010, 11:51
Re: To be sure of the owner of the message written
Hi,
I have partially solved.
In com_phocaguestbook\views\phocaguestbook\tmpl\default.php at line 251 I have just added this code: between the preexistent code .
It seems to work.
In fact only a registered user can post a message, he can only read (but not modify) his nickname.
Going to the backend I could see the real nickname of the writer and eventually I can ban him.
I have partially solved.
In com_phocaguestbook\views\phocaguestbook\tmpl\default.php at line 251 I have just added this code:
Code: Select all
readonly="readonly"
Code: Select all
<input type="text" name="pgusername" readonly="readonly" id="pgbusername" value="'.$this->formdata->username .'" size="32" maxlength="100" class="pgbinput" />
It seems to work.
In fact only a registered user can post a message, he can only read (but not modify) his nickname.
Going to the backend I could see the real nickname of the writer and eventually I can ban him.
- Jan
- Phoca Hero
- Posts: 48739
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: To be sure of the owner of the message written
Ok, now the second step (depends on you if you will make it or not), it can happen that some of your user can fake the form a post a message with other username, such can be treated in model which saves the form data. But as this is not a big security problem, maybe you don't need to make such step ...
Jan
Jan
If you find Phoca extensions useful, please support the project