summaryrefslogtreecommitdiffstats
path: root/lib/public/User/Events/BeforeUserLoggedInEvent.php
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2023-02-28 00:10:46 -0100
committerMaxence Lange <maxence@artificial-owl.com>2023-03-01 15:31:31 -0100
commit980e8e24f0d5c676b91af3ad408066aa23d20080 (patch)
treed559a9bf59aa42d84640ec7b6788509a619ce4f6 /lib/public/User/Events/BeforeUserLoggedInEvent.php
parent991aca154cc5e262baf0583446f0b2db87103b32 (diff)
downloadnextcloud-server-980e8e24f0d5c676b91af3ad408066aa23d20080.tar.gz
nextcloud-server-980e8e24f0d5c676b91af3ad408066aa23d20080.zip
dispatch BeforeUserLoggedInEvent
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib/public/User/Events/BeforeUserLoggedInEvent.php')
-rw-r--r--lib/public/User/Events/BeforeUserLoggedInEvent.php27
1 files changed, 20 insertions, 7 deletions
diff --git a/lib/public/User/Events/BeforeUserLoggedInEvent.php b/lib/public/User/Events/BeforeUserLoggedInEvent.php
index a0818bff88f..ca74f926a17 100644
--- a/lib/public/User/Events/BeforeUserLoggedInEvent.php
+++ b/lib/public/User/Events/BeforeUserLoggedInEvent.php
@@ -24,27 +24,29 @@ declare(strict_types=1);
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+
namespace OCP\User\Events;
+use OCP\Authentication\IApacheBackend;
use OCP\EventDispatcher\Event;
/**
* @since 18.0.0
*/
class BeforeUserLoggedInEvent extends Event {
- /** @var string */
- private $username;
-
- /** @var string */
- private $password;
+ private string $username;
+ private ?string $password;
+ private ?IApacheBackend $backend;
/**
* @since 18.0.0
+ * @since 26.0.0 password can be null
*/
- public function __construct(string $username, string $password) {
+ public function __construct(string $username, ?string $password, ?IApacheBackend $backend = null) {
parent::__construct();
$this->username = $username;
$this->password = $password;
+ $this->backend = $backend;
}
/**
@@ -58,8 +60,19 @@ class BeforeUserLoggedInEvent extends Event {
/**
* @since 18.0.0
+ * @since 26.0.0 value can be null
*/
- public function getPassword(): string {
+ public function getPassword(): ?string {
return $this->password;
}
+
+ /**
+ * return backend if available (or null)
+ *
+ * @return IApacheBackend|null
+ * @since 26.0.0
+ */
+ public function getBackend(): ?IApacheBackend {
+ return $this->backend;
+ }
}