Skip to content

Commit

Permalink
Handling usernames.
Browse files Browse the repository at this point in the history
Usernames should be handled more properly.
  • Loading branch information
mastacontrola committed Jan 9, 2017
1 parent 5a7683d commit 862e48f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/web/lib/fog/system.class.php
Expand Up @@ -53,7 +53,7 @@ private static function _versionCompare()
public function __construct()
{
self::_versionCompare();
define('FOG_VERSION', '7');
define('FOG_VERSION', '8');
define('FOG_SCHEMA', 245);
define('FOG_BCACHE_VER', 111);
define('FOG_SVN_REVISION', 6052);
Expand Down
4 changes: 2 additions & 2 deletions packages/web/lib/fog/user.class.php
Expand Up @@ -128,7 +128,7 @@ public function passwordValidate(
* immediately if found.
*/
$test = preg_match(
'^\w(?:\w*(?:[.-]\w+)?)*(?<=^.{3,40})$',
'/(?=^.{3,40}$)^[\w][\w0-9]*[._@-]?[\w0-9]*[.]?[\w0-9]+$/i',
$username
);
if (!$test) {
Expand Down Expand Up @@ -183,7 +183,7 @@ public function validatePw(
* immediately if found.
*/
$test = preg_match(
'^\w(?:\w*(?:[.-]\w+)?)*(?<=^.{3,40})$',
'/(?=^.{3,40}$)^[\w][\w0-9]*[._@-]?[\w0-9]*[.]?[\w0-9]+$/i',
$username
);
if (!$test) {
Expand Down
2 changes: 1 addition & 1 deletion packages/web/lib/plugins/ldap/class/ldap.class.php
Expand Up @@ -245,7 +245,7 @@ public function authLDAP($user, $pass)
* immediately if found.
*/
$test = preg_match(
'^\w(?:\w*(?:[.-]\w+)?)*(?<=^.{3,40})$',
'/(?=^.{3,40}$)^[\w][\w0-9]*[._@-]?[\w0-9]*[.]?[\w0-9]+$/i',
$user
);
if (!$test) {
Expand Down
2 changes: 1 addition & 1 deletion packages/web/management/languages/messages.pot
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-01-09 14:44-0500\n"
"POT-Creation-Date: 2017-01-09 15:10-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down

0 comments on commit 862e48f

Please sign in to comment.