This repository was archived by the owner on Jul 24, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +69
-0
lines changed Expand file tree Collapse file tree 4 files changed +69
-0
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,9 @@ protected function registerListeners()
101
101
Event::listen (Events \Synchronized::class, Listeners \LogSynchronized::class);
102
102
Event::listen (Events \Synchronizing::class, Listeners \LogSynchronizing::class);
103
103
Event::listen (Events \DiscoveredWithCredentials::class, Listeners \LogDiscovery::class);
104
+ Event::listen (Events \AuthenticatedWithWindows::class, Listeners \LogWindowsAuth::class);
105
+ Event::listen (Events \AuthenticatedModelTrashed::class, Listeners \LogTrashedModel::class);
106
+ Event::listen (Events \AuthenticatedWithCredentials::class, Listeners \LogCredentialAuth::class);
104
107
}
105
108
}
106
109
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Adldap \Laravel \Listeners ;
4
+
5
+ use Adldap \Laravel \Events \AuthenticatedWithCredentials ;
6
+
7
+ class LogCredentialAuth
8
+ {
9
+ /**
10
+ * Handle the event.
11
+ *
12
+ * @param AuthenticatedWithCredentials $event
13
+ *
14
+ * @return void
15
+ */
16
+ public function handle (AuthenticatedWithCredentials $ event )
17
+ {
18
+ $ name = $ event ->user ->getCommonName ();
19
+
20
+ if ($ model = $ event ->model ) {
21
+ info ("User {$ name } has successfully authenticated with the model ID: {$ model ->getKey ()}" );
22
+ } else {
23
+ info ("User {$ name } has successfully authenticated. " );
24
+ }
25
+ }
26
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Adldap \Laravel \Listeners ;
4
+
5
+ use Adldap \Laravel \Events \AuthenticatedModelTrashed ;
6
+
7
+ class LogTrashedModel
8
+ {
9
+ /**
10
+ * Handle the event.
11
+ *
12
+ * @param AuthenticatedModelTrashed $event
13
+ *
14
+ * @return void
15
+ */
16
+ public function handle (AuthenticatedModelTrashed $ event )
17
+ {
18
+ info ("User {$ event ->user ->getCommonName ()} was denied authentication because their model has been soft-deleted. " );
19
+ }
20
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Adldap \Laravel \Listeners ;
4
+
5
+ use Adldap \Laravel \Events \AuthenticatedWithWindows ;
6
+
7
+ class LogWindowsAuth
8
+ {
9
+ /**
10
+ * Handle the event.
11
+ *
12
+ * @param AuthenticatedWithWindows $event
13
+ *
14
+ * @return void
15
+ */
16
+ public function handle (AuthenticatedWithWindows $ event )
17
+ {
18
+ info ("User {$ event ->user ->getCommonName ()} has successfully authenticated via NTLM. " );
19
+ }
20
+ }
You can’t perform that action at this time.
0 commit comments