diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 90a4c4f..6f334ce 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -45,7 +45,7 @@ class LoginController extends Controller protected function credentials(Request $request): array { return [ - 'mail' => $request->get('email'), + login_attr_name() => $request->get(login_attr_name()), 'password' => $request->get('password'), ]; } @@ -91,4 +91,14 @@ class LoginController extends Controller return view('architect::auth.login')->with('login_note',$login_note); } + + /** + * Get the login username to be used by the controller. + * + * @return string + */ + public function username() + { + return login_attr_name(); + } } diff --git a/app/helpers.php b/app/helpers.php new file mode 100644 index 0000000..2dd92a0 --- /dev/null +++ b/app/helpers.php @@ -0,0 +1,13 @@ + [ + 'attr' => [env('LDAP_LOGIN_ATTR','uid') => env('LDAP_LOGIN_ATTR_DESC','User ID')], // Attribute used to find user for login 'objectclass' => explode(',',env('LDAP_LOGIN_OBJECTCLASS', 'posixAccount')), // Objectclass that users must contain to login ], diff --git a/resources/themes/architect/views/auth/login.blade.php b/resources/themes/architect/views/auth/login.blade.php index e642977..fbbc3f6 100644 --- a/resources/themes/architect/views/auth/login.blade.php +++ b/resources/themes/architect/views/auth/login.blade.php @@ -35,10 +35,10 @@
- - + +
- @lang('Please enter your email') + @lang('Please enter your '.strtolower(login_attr_description()))