summaryrefslogtreecommitdiff
path: root/app/Event
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-12-05 20:31:27 -0500
committerFrederic Guillot <fred@kanboard.net>2015-12-05 20:31:27 -0500
commite9fedf3e5cd63aea4da7a71f6647ee427c62fa49 (patch)
treeabc2de5aebace4a2d7c94805552264dab6b10bc7 /app/Event
parent346b8312e5ac877ce3192c2db3a26b500018bbb5 (diff)
Rewrite of the authentication and authorization system
Diffstat (limited to 'app/Event')
-rw-r--r--app/Event/AuthEvent.php27
-rw-r--r--app/Event/AuthFailureEvent.php44
-rw-r--r--app/Event/AuthSuccessEvent.php43
3 files changed, 87 insertions, 27 deletions
diff --git a/app/Event/AuthEvent.php b/app/Event/AuthEvent.php
deleted file mode 100644
index 7cbced83..00000000
--- a/app/Event/AuthEvent.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-
-namespace Kanboard\Event;
-
-use Symfony\Component\EventDispatcher\Event as BaseEvent;
-
-class AuthEvent extends BaseEvent
-{
- private $auth_name;
- private $user_id;
-
- public function __construct($auth_name, $user_id)
- {
- $this->auth_name = $auth_name;
- $this->user_id = $user_id;
- }
-
- public function getUserId()
- {
- return $this->user_id;
- }
-
- public function getAuthType()
- {
- return $this->auth_name;
- }
-}
diff --git a/app/Event/AuthFailureEvent.php b/app/Event/AuthFailureEvent.php
new file mode 100644
index 00000000..225ac04a
--- /dev/null
+++ b/app/Event/AuthFailureEvent.php
@@ -0,0 +1,44 @@
+<?php
+
+namespace Kanboard\Event;
+
+use Symfony\Component\EventDispatcher\Event as BaseEvent;
+
+/**
+ * Authentication Failure Event
+ *
+ * @package event
+ * @author Frederic Guillot
+ */
+class AuthFailureEvent extends BaseEvent
+{
+ /**
+ * Username
+ *
+ * @access private
+ * @var string
+ */
+ private $username = '';
+
+ /**
+ * Constructor
+ *
+ * @access public
+ * @param string $username
+ */
+ public function __construct($username = '')
+ {
+ $this->username = $username;
+ }
+
+ /**
+ * Get username
+ *
+ * @access public
+ * @return string
+ */
+ public function getUsername()
+ {
+ return $this->username;
+ }
+}
diff --git a/app/Event/AuthSuccessEvent.php b/app/Event/AuthSuccessEvent.php
new file mode 100644
index 00000000..38323e82
--- /dev/null
+++ b/app/Event/AuthSuccessEvent.php
@@ -0,0 +1,43 @@
+<?php
+
+namespace Kanboard\Event;
+
+use Symfony\Component\EventDispatcher\Event as BaseEvent;
+
+/**
+ * Authentication Success Event
+ *
+ * @package event
+ * @author Frederic Guillot
+ */
+class AuthSuccessEvent extends BaseEvent
+{
+ /**
+ * Authentication provider name
+ *
+ * @access private
+ * @var string
+ */
+ private $authType;
+
+ /**
+ * Constructor
+ *
+ * @access public
+ * @param string $authType
+ */
+ public function __construct($authType)
+ {
+ $this->authType = $authType;
+ }
+
+ /**
+ * Get authentication type
+ *
+ * @return string
+ */
+ public function getAuthType()
+ {
+ return $this->authType;
+ }
+}