summaryrefslogtreecommitdiff
path: root/app/Core/User
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-05-07 12:59:35 -0400
committerFrederic Guillot <fred@kanboard.net>2016-05-07 12:59:35 -0400
commit300dabe6b4e9e648c1111363fad8154def7cfb5f (patch)
tree1eb9cac2b56401e3c6f0fe8b46233f01909d4885 /app/Core/User
parent94989663eca0d0dc2e9adb6d3190f0ab3cca9d2a (diff)
Added support for LDAP user photo profile
Diffstat (limited to 'app/Core/User')
-rw-r--r--app/Core/User/UserProfile.php4
-rw-r--r--app/Core/User/UserSync.php6
2 files changed, 7 insertions, 3 deletions
diff --git a/app/Core/User/UserProfile.php b/app/Core/User/UserProfile.php
index ef325801..4f873390 100644
--- a/app/Core/User/UserProfile.php
+++ b/app/Core/User/UserProfile.php
@@ -3,6 +3,7 @@
namespace Kanboard\Core\User;
use Kanboard\Core\Base;
+use Kanboard\Event\UserProfileSyncEvent;
/**
* User Profile
@@ -12,6 +13,8 @@ use Kanboard\Core\Base;
*/
class UserProfile extends Base
{
+ const EVENT_USER_PROFILE_AFTER_SYNC = 'user_profile.after.sync';
+
/**
* Assign provider data to the local user
*
@@ -54,6 +57,7 @@ class UserProfile extends Base
if (! empty($profile) && $profile['is_active'] == 1) {
$this->userSession->initialize($profile);
+ $this->dispatcher->dispatch(self::EVENT_USER_PROFILE_AFTER_SYNC, new UserProfileSyncEvent($profile, $user));
return true;
}
diff --git a/app/Core/User/UserSync.php b/app/Core/User/UserSync.php
index d450a0bd..055c7106 100644
--- a/app/Core/User/UserSync.php
+++ b/app/Core/User/UserSync.php
@@ -64,13 +64,13 @@ class UserSync extends Base
*/
private function createUser(UserProviderInterface $user, array $properties)
{
- $id = $this->user->create($properties);
+ $userId = $this->user->create($properties);
- if ($id === false) {
+ if ($userId === false) {
$this->logger->error('Unable to create user profile: '.$user->getExternalId());
return array();
}
- return $this->user->getById($id);
+ return $this->user->getById($userId);
}
}