Skip to content

Commit 732f777

Browse files
committed
Rename our configuration keys to ldap/ldaps/startls, they are not openldap specific
1 parent c588e13 commit 732f777

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

app/Http/Middleware/SwapinAuthUser.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ public function handle(Request $request,Closure $next): mixed
2525
{
2626
$key = config('ldap.default');
2727

28+
if (! array_key_exists($key,config('ldap.connections')))
29+
abort(599,sprintf('LDAP default server [%s] configuration doesnt exist?',$key));
30+
2831
/*
2932
// Rebuild our connection with the authenticated user.
3033
if (Session::has('username_encrypt') && Session::has('password_encrypt')) {

config/ldap.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
|
1616
*/
1717

18-
'default' => env('LDAP_CONNECTION', 'openldap'),
18+
'default' => env('LDAP_CONNECTION', 'ldap'),
1919

2020
/*
2121
|--------------------------------------------------------------------------
@@ -30,7 +30,7 @@
3030

3131
'connections' => [
3232

33-
'openldap' => [
33+
'ldap' => [
3434
'hosts' => [env('LDAP_HOST', '127.0.0.1')],
3535
'username' => env('LDAP_USERNAME', 'cn=user,dc=local,dc=com'),
3636
'password' => env('LDAP_PASSWORD', 'secret'),
@@ -42,7 +42,7 @@
4242
'name' => env('LDAP_NAME','LDAP Server'),
4343
],
4444

45-
'openldaps' => [
45+
'ldaps' => [
4646
'hosts' => [env('LDAP_HOST', '127.0.0.1')],
4747
'username' => env('LDAP_USERNAME', 'cn=user,dc=local,dc=com'),
4848
'password' => env('LDAP_PASSWORD', 'secret'),
@@ -54,7 +54,7 @@
5454
'name' => env('LDAP_NAME','LDAPS Server'),
5555
],
5656

57-
'openldaptls' => [
57+
'starttls' => [
5858
'hosts' => [env('LDAP_HOST', '127.0.0.1')],
5959
'username' => env('LDAP_USERNAME', 'cn=user,dc=local,dc=com'),
6060
'password' => env('LDAP_PASSWORD', 'secret'),
@@ -66,6 +66,7 @@
6666
'name' => env('LDAP_NAME','LDAP-TLS Server'),
6767
],
6868

69+
/*
6970
'opendj' => [
7071
'hosts' => ['opendj'],
7172
'username' => 'cn=Directory Manager',
@@ -77,6 +78,7 @@
7778
'use_tls' => env('LDAP_TLS', false),
7879
'name' => 'OpenDJ Server',
7980
],
81+
*/
8082

8183
],
8284

@@ -174,4 +176,4 @@
174176
]
175177
],
176178
],
177-
];
179+
];

0 commit comments

Comments
 (0)