User registation - validation on usernames

08.09.2021 15:17
#1
plocher
Joomshopping forum user no avatar
Name: Pascale
12.06.2011
Posts: 18
Quote
User registation - validation on usernames

Hello,
For a few days now I have a problem with my shop. I get a lot of fake user registrations. They use usernames like:
"usd 10,000 budget allocated to you: http://www.zjjiajiao.com.cn/ad/adredir.asp?url=https://way1.ga/rRLWSV"

As a result my webhost jugded the registation emails as spam and deactivated the function mail() and now no emails get send anymore through the website.

Is there a way I can validate username and password? For example username can only consist of max. 10 letters with no spaces.

Thanks for your help
Pascale


Joomla: 3.10.1
JoomShopping: 4.18.7
PHP: 7.4
Website Url: diverdesign.ch
 
08.09.2021 16:28
#2
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25857
Quote
Aw: User registation - validation on usernames

components\com_jshopping\tables\usershopbase.php

if (preg_match("#[<>\"'%;()&]#i", $this->u_name) || strlen(utf8_decode($this->u_name )) < 2) {
$this->_error = sprintf((_JSHOP_VALID_AZ09),(_JSHOP_USERNAME),2);
return false;
}

change to

if (preg_match("#[<>\"'%;()&]#i", $this->u_name) || strlen(utf8_decode($this->u_name )) < 2 || strlen(utf8_decode($this->u_name )) > 10) {
$this->_error = sprintf((_JSHOP_VALID_AZ09),(_JSHOP_USERNAME),2);
return false;
}


Last change: 08.09.2021 16:29
 


Copyrights MAXXmarketing GmbH. Alle Rechte vorbehalten
Durch die Nutzung dieser Website stimme ich zu, dass Cookies zur optimalen Gestaltung der Website sowie zur Analyse der Nutzung der Website verwendet werden. Weiterführende Informationen finden Sie hier. OK, einverstanden.