Skip to content

Commit

Permalink
*removed specific errormessages (only one errormessage)
Browse files Browse the repository at this point in the history
*edited errormessage
*length fix
  • Loading branch information
mxkmp29 authored and mxkmp29 committed Aug 12, 2016
1 parent 2eb7219 commit ee566a2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 25 deletions.
4 changes: 2 additions & 2 deletions administrator/components/com_users/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
label="COM_USERS_CONFIG_FIELD_USERNAME_MINNUMCHARS_LABEL"
description="COM_USERS_CONFIG_FIELD_USERNAME_MINNUMCHARS_DESC"
first="3"
last="146"
last="150"
step="1"
default="3">
</field>
Expand All @@ -206,7 +206,7 @@
label="COM_USERS_CONFIG_FIELD_USERNAME_MAXNUMCHARS_LABEL"
description="COM_USERS_CONFIG_FIELD_USERNAME_MAXNUMCHARS_DESC"
first="0"
last="149"
last="150"
step="1"
default="0">
</field>
Expand Down
2 changes: 1 addition & 1 deletion language/en-GB/en-GB.com_users.ini
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ COM_USERS_REGISTER_PASSWORD2_LABEL="Confirm Password"
COM_USERS_REGISTER_REQUIRED="<strong class="_QQ_"red"_QQ_">*</strong> Required field"
COM_USERS_REGISTER_USERNAME_DESC="Enter your desired username."
COM_USERS_REGISTER_USERNAME_LABEL="Username"
COM_USERS_REGISTER_USERNAME_MESSAGE="The username you entered is not available. Please pick another username."
COM_USERS_REGISTER_USERNAME_MESSAGE="The username does not meet the requirements. Please pick another username."
COM_USERS_REGISTRATION="User Registration"
COM_USERS_REGISTRATION_ACTIVATE_SUCCESS="Your Account has been successfully activated. You can now log in using the username and password you chose during the registration."
COM_USERS_REGISTRATION_ACTIVATION_NOTIFY_SEND_MAIL_FAILED="An error was encountered while sending activation notification email"
Expand Down
22 changes: 0 additions & 22 deletions libraries/joomla/form/rule/username.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ public function test(SimpleXMLElement $element, $value, $group = null, Registry
// If is set minNumChars and $usernameLength does't achieve minimum lenght
if (($minNumChars) && ($usernameLength < $minNumChars))
{
$app->enqueueMessage(JText::sprintf('JLIB_RULES_FIELD_USERNAME_MINNUMCHARS_REQUIRED', $minNumChars, $usernameLength), 'warning');
$result = false;
}

Expand All @@ -87,7 +86,6 @@ public function test(SimpleXMLElement $element, $value, $group = null, Registry
// If is set maxNumChars and $usernameLength surpass maximum length
if (($maxNumChars) && ($usernameLength > $maxNumChars))
{
$app->enqueueMessage(JText::sprintf('JLIB_RULES_FIELD_USERNAME_MAXNUMCHARS_REQUIRED', $maxNumChars, $usernameLength), 'warning');
$result = false;
}

Expand Down Expand Up @@ -124,7 +122,6 @@ public function test(SimpleXMLElement $element, $value, $group = null, Registry
// Check if all the $uname chars are valid chars
if (!empty($invalid_chars))
{
$app->enqueueMessage(JText::sprintf('JLIB_RULES_FIELD_USERNAME_CHARSET_REQUIRED', implode('', $invalid_chars)), 'warning');
$result = false;
}
break;
Expand All @@ -146,8 +143,6 @@ public function test(SimpleXMLElement $element, $value, $group = null, Registry
// Enqueue error message and return false
if ('' !== $nonRegExpString)
{
$app->enqueueMessage(JText::sprintf('JLIB_RULES_FIELD_USERNAME_CHARSET_REQUIRED', $nonRegExpString), 'warning');

$result = false;
}
}
Expand All @@ -159,9 +154,6 @@ public function test(SimpleXMLElement $element, $value, $group = null, Registry
*/
if (!ctype_alnum($value))
{
// Enqueue error message and return false
$app->enqueueMessage(JText::sprintf('JLIB_RULES_FIELD_USERNAME_ALPHANUMERIC_REQUIRED'), 'warning');

$result = false;
}
break;
Expand All @@ -172,9 +164,6 @@ public function test(SimpleXMLElement $element, $value, $group = null, Registry
{
$nonLatinString = implode(' ', array_unique($nonLatinChars[0]));

// Enqueue error message and return false
$app->enqueueMessage(JText::sprintf('JLIB_RULES_FIELD_USERNAME_LATIN_REQUIRED', $nonLatinString), 'warning');

$result = false;
}
break;
Expand Down Expand Up @@ -203,9 +192,6 @@ public function test(SimpleXMLElement $element, $value, $group = null, Registry
// If the username comes from more than a recommended script (or permitted combination) throws Error
if (!preg_match_all($regexRecommendedScripts, $valueWithoutCommonInherited))
{
// Enqueue error message and return false
$app->enqueueMessage(JText::sprintf('JLIB_RULES_FIELD_USERNAME_ONESCRIPT_REQUIRED'), 'warning');

$result = false;
}

Expand Down Expand Up @@ -270,9 +256,6 @@ public function test(SimpleXMLElement $element, $value, $group = null, Registry
$nonIdentifierProfileString .= 'whitespace';
}

// Enqueue error message and return false
$app->enqueueMessage(JText::sprintf('JLIB_RULES_FIELD_USERNAME_IDPROFILE_REQUIRED', $nonIdentifierProfileString), 'warning');

$result = false;
}

Expand Down Expand Up @@ -307,17 +290,12 @@ public function test(SimpleXMLElement $element, $value, $group = null, Registry

if (!JMailHelper::isEmailAddress($value) )
{
// Enqueue error message and return false
$app->enqueueMessage(JText::_('JLIB_RULES_FIELD_USERNAME_EMAIL_REQUIRED'), 'warning');

$result = false;
}
break;

default:
// NO OPTION
$app->enqueueMessage(JText::_('JLIB_RULES_FIELD_USERNAME_NOOPTION'), 'warning');

return false;
}
}
Expand Down

0 comments on commit ee566a2

Please sign in to comment.