Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/user_ldap/lib/Group_LDAP.php
Original file line number Diff line number Diff line change
Expand Up @@ -1139,6 +1139,7 @@ public function addToGroup($uid, $gid) {
if ($this->groupPluginManager->implementsActions(GroupInterface::ADD_TO_GROUP)) {
if ($ret = $this->groupPluginManager->addToGroup($uid, $gid)) {
$this->access->connection->clearCache();
unset($this->cachedGroupMembers[$gid]);
}
return $ret;
}
Expand All @@ -1156,6 +1157,7 @@ public function removeFromGroup($uid, $gid) {
if ($this->groupPluginManager->implementsActions(GroupInterface::REMOVE_FROM_GROUP)) {
if ($ret = $this->groupPluginManager->removeFromGroup($uid, $gid)) {
$this->access->connection->clearCache();
unset($this->cachedGroupMembers[$gid]);
}
return $ret;
}
Expand Down
2 changes: 1 addition & 1 deletion apps/user_ldap/lib/UserPluginManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function implementsActions($actions) {
*
* @param string $username The username of the user to create
* @param string $password The password of the new user
* @return bool
* @return string | false The user DN if user creation was successful.
* @throws \Exception
*/
public function createUser($username, $password) {
Expand Down
13 changes: 11 additions & 2 deletions apps/user_ldap/lib/User_LDAP.php
Original file line number Diff line number Diff line change
Expand Up @@ -615,11 +615,20 @@ public function getNewLDAPConnection($uid) {
* create new user
* @param string $username username of the new user
* @param string $password password of the new user
* @return bool was the user created?
* @throws \UnexpectedValueException
* @return bool
*/
public function createUser($username, $password) {
if ($this->userPluginManager->implementsActions(Backend::CREATE_USER)) {
return $this->userPluginManager->createUser($username, $password);
if ($dn = $this->userPluginManager->createUser($username, $password)) {
if (is_string($dn)) {
//updates user mapping
$this->access->dn2ocname($dn, $username, true);
} else {
throw new \UnexpectedValueException("LDAP Plugin: Method createUser changed to return the user DN instead of boolean.");
}
}
return (bool) $dn;
}
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion apps/user_ldap/tests/User_LDAPTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1422,7 +1422,7 @@ public function testCreateUserWithPlugin() {
->with('uid','password')
->willReturn('result');

$this->assertEquals($this->backend->createUser('uid', 'password'),'result');
$this->assertEquals($this->backend->createUser('uid', 'password'),true);
}

public function testCreateUserFailing() {
Expand Down