more consistent naming
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
parent
2ebf26e444
commit
373a1d5391
|
@ -55,9 +55,9 @@ class UserManagement extends Action {
|
|||
*
|
||||
* @param string $uid
|
||||
*/
|
||||
public function announce(string $uid) {
|
||||
public function assign(string $uid) {
|
||||
$this->log(
|
||||
'UserID assgined: "%s"',
|
||||
'UserID assigned: "%s"',
|
||||
[ 'uid' => $uid ],
|
||||
[ 'uid' ]
|
||||
);
|
||||
|
@ -83,7 +83,7 @@ class UserManagement extends Action {
|
|||
*
|
||||
* @param string $uid
|
||||
*/
|
||||
public function revoke(string $uid) {
|
||||
public function unassign(string $uid) {
|
||||
$this->log(
|
||||
'UserID unassigned: "%s"',
|
||||
[ 'uid' => $uid ],
|
||||
|
|
|
@ -93,8 +93,8 @@ class Application extends App {
|
|||
/** @var IUserSession|Session $userSession */
|
||||
$userSession = $this->getContainer()->getServer()->getUserSession();
|
||||
$userSession->listen('\OC\User', 'postSetPassword', [$userActions, 'setPassword']);
|
||||
$userSession->listen('\OC\User', 'announceUser', [$userActions, 'announce']);
|
||||
$userSession->listen('\OC\User', 'postRevokeUser', [$userActions, 'revoke']);
|
||||
$userSession->listen('\OC\User', 'assignedUserId', [$userActions, 'assign']);
|
||||
$userSession->listen('\OC\User', 'postUnassignedUserId', [$userActions, 'unassign']);
|
||||
}
|
||||
|
||||
protected function groupHooks(ILogger $logger) {
|
||||
|
|
|
@ -77,22 +77,22 @@ class HookManager {
|
|||
'post_createUser',
|
||||
$this,
|
||||
'postCreateUser');
|
||||
\OC::$server->getUserManager()->listen('\OC\User', 'announceUser', function ($uid) {
|
||||
\OC::$server->getUserManager()->listen('\OC\User', 'assignedUserId', function ($uid) {
|
||||
$this->postCreateUser(['uid' => $uid]);
|
||||
});
|
||||
Util::connectHook('OC_User',
|
||||
'pre_deleteUser',
|
||||
$this,
|
||||
'preDeleteUser');
|
||||
\OC::$server->getUserManager()->listen('\OC\User', 'preRevokeUser', [$this, 'preRevokeUser']);
|
||||
\OC::$server->getUserManager()->listen('\OC\User', 'preUnassignedUserId', [$this, 'preUnassignedUserId']);
|
||||
Util::connectHook('OC_User',
|
||||
'post_deleteUser',
|
||||
$this,
|
||||
'postDeleteUser');
|
||||
\OC::$server->getUserManager()->listen('\OC\User', 'postRevokeUser', function ($uid) {
|
||||
\OC::$server->getUserManager()->listen('\OC\User', 'postUnassignedUserId', function ($uid) {
|
||||
$this->postDeleteUser(['uid' => $uid]);
|
||||
});
|
||||
\OC::$server->getUserManager()->listen('\OC\User', 'postRevokeUser', [$this, 'postRevokeUser']);
|
||||
\OC::$server->getUserManager()->listen('\OC\User', 'postUnassignedUserId', [$this, 'postUnassignedUserId']);
|
||||
Util::connectHook('OC_User',
|
||||
'changeUser',
|
||||
$this,
|
||||
|
@ -111,7 +111,7 @@ class HookManager {
|
|||
$this->addressBooksToDelete = $this->cardDav->getUsersOwnAddressBooks('principals/users/' . $uid);
|
||||
}
|
||||
|
||||
public function preRevokeUser($uid) {
|
||||
public function preUnassignedUserId($uid) {
|
||||
$this->usersToDelete[$uid] = $this->userManager->get($uid);
|
||||
}
|
||||
|
||||
|
@ -131,7 +131,7 @@ class HookManager {
|
|||
}
|
||||
}
|
||||
|
||||
public function postRevokeUser($uid) {
|
||||
public function postUnassignedUserId($uid) {
|
||||
if (isset($this->usersToDelete[$uid])){
|
||||
$this->syncService->deleteUser($this->usersToDelete[$uid]);
|
||||
}
|
||||
|
|
|
@ -38,10 +38,10 @@ try {
|
|||
$mapping = new UserMapping(\OC::$server->getDatabaseConnection());
|
||||
$result = $mapping->clearCb(
|
||||
function ($uid) {
|
||||
\OC::$server->getUserManager()->emit('\OC\User', 'preRevokeUser', [$uid]);
|
||||
\OC::$server->getUserManager()->emit('\OC\User', 'preUnassignedUserId', [$uid]);
|
||||
},
|
||||
function ($uid) {
|
||||
\OC::$server->getUserManager()->emit('\OC\User', 'postRevokeUser', [$uid]);
|
||||
\OC::$server->getUserManager()->emit('\OC\User', 'postUnassignedUserId', [$uid]);
|
||||
}
|
||||
);
|
||||
} else if($subject === 'group') {
|
||||
|
|
|
@ -609,7 +609,7 @@ class Access extends LDAPUtility implements IUserTools {
|
|||
|| (!$isUser && !\OC::$server->getGroupManager()->groupExists($intName))) {
|
||||
if($mapper->map($fdn, $intName, $uuid)) {
|
||||
$this->connection->setConfiguration(array('ldapCacheTTL' => $originalTTL));
|
||||
\OC::$server->getUserManager()->emit('\OC\User', 'announceUser', [$intName]);
|
||||
\OC::$server->getUserManager()->emit('\OC\User', 'assignedUserId', [$intName]);
|
||||
$newlyMapped = true;
|
||||
return $intName;
|
||||
}
|
||||
|
@ -618,7 +618,7 @@ class Access extends LDAPUtility implements IUserTools {
|
|||
|
||||
$altName = $this->createAltInternalOwnCloudName($intName, $isUser);
|
||||
if(is_string($altName) && $mapper->map($fdn, $altName, $uuid)) {
|
||||
\OC::$server->getUserManager()->emit('\OC\User', 'announceUser', [$intName]);
|
||||
\OC::$server->getUserManager()->emit('\OC\User', 'assignedUserId', [$intName]);
|
||||
$newlyMapped = true;
|
||||
return $altName;
|
||||
}
|
||||
|
|
|
@ -396,7 +396,7 @@ class User_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn
|
|||
\OC::$server->getLogger()->info('Cleaning up after user ' . $uid,
|
||||
array('app' => 'user_ldap'));
|
||||
|
||||
$this->access->getUserMapper()->unmap($uid); // we don't emit revoke signals here, since it is implicit to delete signals fired from core
|
||||
$this->access->getUserMapper()->unmap($uid); // we don't emit unassign signals here, since it is implicit to delete signals fired from core
|
||||
$this->access->userManager->invalidate($uid);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -50,9 +50,9 @@ use OCP\UserInterface;
|
|||
* - preCreateUser(string $uid, string $password)
|
||||
* - postCreateUser(\OC\User\User $user, string $password)
|
||||
* - change(\OC\User\User $user)
|
||||
* - announceUser(string $uid)
|
||||
* - preRevokeUser(string $uid)
|
||||
* - postRevokeUser(string $uid)
|
||||
* - assignedUserId(string $uid)
|
||||
* - preUnassignedUserId(string $uid)
|
||||
* - postUnassignedUserId(string $uid)
|
||||
*
|
||||
* @package OC\User
|
||||
*/
|
||||
|
|
|
@ -72,9 +72,9 @@ use Symfony\Component\EventDispatcher\GenericEvent;
|
|||
* - postDelete(\OC\User\User $user)
|
||||
* - preCreateUser(string $uid, string $password)
|
||||
* - postCreateUser(\OC\User\User $user)
|
||||
* - announceUser(string $uid)
|
||||
* - preRevokeUser(string $uid)
|
||||
* - postRevokeUser(string $uid)
|
||||
* - assignedUserId(string $uid)
|
||||
* - preUnassignedUserId(string $uid)
|
||||
* - postUnassignedUserId(string $uid)
|
||||
* - preLogin(string $user, string $password)
|
||||
* - postLogin(\OC\User\User $user, string $password)
|
||||
* - preRememberedLogin(string $uid)
|
||||
|
|
|
@ -40,9 +40,9 @@ namespace OCP;
|
|||
* - postDelete(\OC\User\User $user)
|
||||
* - preCreateUser(string $uid, string $password)
|
||||
* - postCreateUser(\OC\User\User $user, string $password)
|
||||
* - announceUser(string $uid)
|
||||
* - preRevokeUser(string $uid)
|
||||
* - postRevokeUser(string $uid)
|
||||
* - assignedUserId(string $uid)
|
||||
* - preUnassignedUserId(string $uid)
|
||||
* - postUnassignedUserId(string $uid)
|
||||
*
|
||||
* @package OC\User
|
||||
* @since 8.0.0
|
||||
|
|
Loading…
Reference in New Issue