This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

Dynamic Names Question
#1

First off, I would like to thank the creator of commentics and making it free for everyone.

I have successfully integrated commentics to set the default form fields like name, email and website to the currently logged user and have hidden it from the form, so no changes can be made.

However, it appears that anyone can still change the default entries by manually editing it via "inspect" element in Chrome for example. May I ask is there any way to prevent this?

Thank you in advanced.  Blush
Reply
#2

Hi,

I've just tested this and it seems to work fine. I set it up so that the name field is hidden, I then used Firebug to add the name field to the source code and entered a different value, and after submitting the form it used the value from the integration code as expected. If you take a look at the code in /upload/includes/app/processor.php (line 114):

PHP Code:
<?php 
if (isset($cmtx_set_name_value) && !empty($cmtx_set_name_value) && cmtx_setting('state_name') != 'normal') { //if login name is set and name field is disabled or hidden
$_POST['cmtx_name'] = $cmtx_set_name_value; //set it with login name
}

$cmtx_name = trim($_POST['cmtx_name']); //remove any space at beginning and end

It first checks whether a login name is being submitted. If it is then it sets (overrides) the $_POST value with the login name.

Have you completed the interview?
Reply
#3

Sorry about that.

All I need to do was to set Layout -> Form -> States and have Name and other entries be hidden. I manually inserted hidden in the HTML code, which does not really do anything and can easily be changed.

Its now working now sir, since it is not showing anymore. My bad.
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by het
19-Sep-2011, 06:42 PM
Last Post by Static
22-Sep-2010, 03:02 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)