All popular questions related to OS Property will be posted here

How to change OS Property captcha to numbers only

More
9 years 9 months ago #46178 by Marty
I am trying to change the current component captcha from letters/numbers mix to numbers only.
I looked in the component files and it has a folder named .../components/com_osproperty/captcha. But this folder only has 2 files (background image and index.html file).
Where can I find the path to the file that allows me to change captcha configuration?
Thanks.

Please Log in or Create an account to join the conversation.

More
9 years 9 months ago #46187 by Mr. Dam
Hi,
To change the captcha from letters to numbers only. Please follow these steps
1. Open file: components > com_osproperty > classes > listing.html.php
2. find
$RandomStr = md5(microtime());// md5 to generate the random string
$ResultStr = substr($RandomStr,0,5);//trim 5 digit
$row->ResultStr = $ResultStr;
and replace by
$row->ResultStr = rand(10000,99999);
Good luck
Dam

Please Log in or Create an account to join the conversation.

More
9 years 9 months ago #46190 by Marty
Thank you, this changed the captcha in "Request More Detail" in individual listing view.
How about captcha for company and agent registration?

(P.S.: The code to change captcha for individual listing is in line 1794 of the file)

Please Log in or Create an account to join the conversation.

More
9 years 9 months ago #46191 by Mr. Dam
Hi,
With agent registration, please follow these steps
Open file : components > com_osproperty > helpers > agentregistration.php
find
$RandomStr = md5(microtime());// md5 to generate the random string
$ResultStr = substr($RandomStr,0,5);//trim 5 digit
and replace by
$ResultStr = rand(10000,99999);

With company registration, please follow these steps
find
//Random string
$RandomStr = md5(microtime());// md5 to generate the random string
$ResultStr = substr($RandomStr,0,5);//trim 5 digit

and replace by
$ResultStr = rand(10000,99999);
Good luck
Dam

Please Log in or Create an account to join the conversation.

More
9 years 9 months ago #46227 by Marty
The correct location to change the captcha code is:

Agent Registration: components > com_osproperty > helpers > layouts >agentregistration.php
Line: 217

Company Registration: components > com_osproperty > helpers > layouts >companyregistration.php
Line: 163

Request More Detail (Listing View): components > com_osproperty > classes > listing.html.php
Line: 1794

Thank you.

Please Log in or Create an account to join the conversation.

Moderators: Mr. DamNguyen Phu Quan