2016-06-08 09:25:44 -04:00
|
|
|
<?php
|
2019-12-03 13:57:53 -05:00
|
|
|
|
2018-03-10 13:40:19 -05:00
|
|
|
declare(strict_types=1);
|
2016-06-08 09:25:44 -04:00
|
|
|
/**
|
2024-05-24 13:43:47 -04:00
|
|
|
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2016-06-08 09:25:44 -04:00
|
|
|
*/
|
2017-07-01 05:28:03 -04:00
|
|
|
namespace OCA\AdminAudit\Actions;
|
2016-06-08 09:25:44 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Class Auth logs all auth related actions
|
|
|
|
|
*
|
2017-07-01 05:28:03 -04:00
|
|
|
* @package OCA\AdminAudit\Actions
|
2016-06-08 09:25:44 -04:00
|
|
|
*/
|
|
|
|
|
class Auth extends Action {
|
2021-03-05 09:02:35 -05:00
|
|
|
public function loginAttempt(array $params): void {
|
2016-06-08 09:25:44 -04:00
|
|
|
$this->log(
|
|
|
|
|
'Login attempt: "%s"',
|
|
|
|
|
$params,
|
|
|
|
|
[
|
|
|
|
|
'uid',
|
2016-11-24 07:58:03 -05:00
|
|
|
],
|
|
|
|
|
true
|
2016-06-08 09:25:44 -04:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-05 09:02:35 -05:00
|
|
|
public function loginSuccessful(array $params): void {
|
2016-06-08 09:25:44 -04:00
|
|
|
$this->log(
|
|
|
|
|
'Login successful: "%s"',
|
|
|
|
|
$params,
|
|
|
|
|
[
|
|
|
|
|
'uid',
|
2016-11-24 07:58:03 -05:00
|
|
|
],
|
|
|
|
|
true
|
2016-06-08 09:25:44 -04:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-05 09:02:35 -05:00
|
|
|
public function logout(array $params): void {
|
2016-06-08 09:25:44 -04:00
|
|
|
$this->log(
|
|
|
|
|
'Logout occurred',
|
|
|
|
|
[],
|
|
|
|
|
[]
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|