diff --git a/app/Models/User.php b/app/Models/User.php index a3f217285b..34268be455 100755 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -508,6 +508,9 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo } elseif ($format=='lastnamefirstinitial') { $username = str_slug($last_name.substr($first_name, 0, 1)); + } elseif ($format=='firstintial.lastname') { + $username = substr($first_name, 0, 1).'.'.str_slug($last_name); + } elseif ($format=='firstname_lastname') { $username = str_slug($first_name).'_'.str_slug($last_name); diff --git a/resources/lang/en/general.php b/resources/lang/en/general.php index 74cc5ff02e..79de8afec2 100644 --- a/resources/lang/en/general.php +++ b/resources/lang/en/general.php @@ -89,6 +89,7 @@ 'firstname_lastname_format' => 'First Name Last Name (jane.smith@example.com)', 'firstname_lastname_underscore_format' => 'First Name Last Name (jane_smith@example.com)', 'lastnamefirstinitial_format' => 'Last Name First Initial (smithj@example.com)', + 'firstintial_dot_lastname_format' => 'First Initial Last Name (j.smith@example.com)', 'first' => 'First', 'first_name' => 'First Name', 'first_name_format' => 'First Name (jane@example.com)', diff --git a/resources/macros/macros.php b/resources/macros/macros.php index ee461832f4..02f8917751 100644 --- a/resources/macros/macros.php +++ b/resources/macros/macros.php @@ -463,11 +463,11 @@ Form::macro('username_format', function ($name = "username_format", $selected = $formats = array( 'firstname.lastname' => trans('general.firstname_lastname_format'), - 'firstname' => trans('general.first_name_format'), - 'filastname' => trans('general.filastname_format'), - 'lastnamefirstinitial' => trans('general.lastnamefirstinitial_format'), 'firstname_lastname' => trans('general.firstname_lastname_underscore_format'), - + 'filastname' => trans('general.filastname_format'), + 'firstintial.lastname' => trans('general.firstintial_dot_lastname_format'), + 'firstname' => trans('general.first_name_format'), + 'lastnamefirstinitial' => trans('general.lastnamefirstinitial_format'), ); $select = '