Added support for LDAP user photo profile
This commit is contained in:
@@ -145,7 +145,8 @@ class User
|
||||
$entry->getFirstValue($this->getAttributeName()),
|
||||
$entry->getFirstValue($this->getAttributeEmail()),
|
||||
$this->getRole($groupIds),
|
||||
$groupIds
|
||||
$groupIds,
|
||||
$entry->getFirstValue($this->getAttributePhoto())
|
||||
);
|
||||
}
|
||||
|
||||
@@ -164,6 +165,7 @@ class User
|
||||
$this->getAttributeName(),
|
||||
$this->getAttributeEmail(),
|
||||
$this->getAttributeGroup(),
|
||||
$this->getAttributePhoto(),
|
||||
)));
|
||||
}
|
||||
|
||||
@@ -223,6 +225,17 @@ class User
|
||||
return strtolower(LDAP_USER_ATTRIBUTE_GROUPS);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get LDAP profile photo attribute
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getAttributePhoto()
|
||||
{
|
||||
return strtolower(LDAP_USER_ATTRIBUTE_PHOTO);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get LDAP Group User filter
|
||||
*
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user