Removes all personal workspaces of the given user's account if these workspaces exist. Also removes
all possibly existing content of these workspaces.

@param string $accountIdentifier Identifier of the user's account
@return void
481494
protected function deletePersonalWorkspace($accountIdentifier)
    {
        $userWorkspace = $this->workspaceRepository->findByIdentifier(UserUtility::getPersonalWorkspaceNameForUsername($accountIdentifier));
        if ($userWorkspace instanceof Workspace) {
            $this->publishingService->discardAllNodes($userWorkspace);
            $this->workspaceRepository->remove($userWorkspace);
        }
    }
254441
public function unbindScopes(string $identifier): void
    {
        try {
            $schema = $this->getDatabaseSchema();
            $this->deleteBelongsToManyRelationshipIdentifiers(
                $schema->getClientsScopesTable(),
                $schema->getClientsScopesClientIdentityColumn(),
                $identifier
            );
        } catch (RepositoryException $exception) {
            $message = 'Unbinding client scopes failed.';
            throw new RepositoryException($message, 0, $exception);
        }
    }
817680
def remove_account(self, id):
        """"""
        if self.parser.has_section(id):
            self.parser.remove_section(id)
            return True
        return False
1275436
public function discardWorkspaceAction(Workspace $workspace)
    {
        $unpublishedNodes = $this->publishingService->getUnpublishedNodes($workspace);
        $this->publishingService->discardNodes($unpublishedNodes);
        $this->addFlashMessage($this->translator->translateById('workspaces.allChangesInWorkspaceHaveBeenDiscarded', [htmlspecialchars($workspace->getTitle())], null, null, 'Modules', 'Neos.Neos'));
        $this->redirect('index');
    }
36139
public function destroyAction($sessionId, $serverIdentifier = NULL) {
		if ($this->request->getHttpRequest()->getMethod() !== 'DELETE') {
			$this->response->setStatus(405);
			$this->response->setHeader('Allow', 'DELETE');
			return;
		}


		$sessions = $this->sessionManager->getSessionsByTag('Flowpack_SingleSignOn_Client-' . $sessionId);
		if ($sessions !== array()) {
			$message = 'Destroyed by SSO client REST service';
			if ($serverIdentifier !== NULL) {
				$message .= ' from server "' . $serverIdentifier . '"';
			}
			foreach ($sessions as $session) {
				$session->destroy($message);
			}

			$this->view->assign('value', array(
				'success' => TRUE
			));
		} else {
			$this->response->setStatus(404);

			$this->view->assign('value', array('error' => 'SessionNotFound'));
		}
	}
1010645
public function clearIdentity()
    {
        if ($user = $this->getIdentity()) {
            $auth = $this->authenticationProvider->findByUserId($user->getId());
            $this->resetAuthenticationKey($auth);
        }

        $sp = session_get_cookie_params();
        foreach ([self::COOKIE_USER, self::COOKIE_VERIFY_A, self::COOKIE_VERIFY_B] as $cookieName) {
            setcookie($cookieName, null, null, '/', $sp['domain'], false, true);
        }

        $this->identity = null;
    }
976638
public function delete(): void
    {
        if (!userHasPermission('admin:auth:accounts:delete')) {
            unauthorised();
        }

        // --------------------------------------------------------------------------

        //  Get the user's details
        $oUri       = Factory::service('Uri');
        $oInput     = Factory::service('Input');
        $oSession   = Factory::service('Session', 'nails/module-auth');
        $oUserModel = Factory::model('User', 'nails/module-auth');
        $iUserId    = $oUri->segment(5);
        $oUser      = $oUserModel->getById($iUserId);

        // --------------------------------------------------------------------------

        //  Non-superusers editing superusers is not cool
        if (!isSuperuser() && userHasPermission('superuser', $oUser)) {
            $oSession->setFlashData('error', lang('accounts_edit_error_noteditable'));
            $this->returnToIndex();
        }

        // --------------------------------------------------------------------------

        //  Delete user
        $oUser = $oUserModel->getById($iUserId);

        if (!$oUser) {
            show404();
        } elseif ($oUser->id == activeUser('id')) {
            $oSession->setFlashData('error', lang('accounts_delete_error_selfie'));
            $this->returnToIndex();
        }

        // --------------------------------------------------------------------------

        //  Define messages
        if ($oUserModel->destroy($iUserId)) {

            $sStatus  = 'success';
            $sMessage = lang('accounts_delete_success', title_case($oUser->first_name . ' ' . $oUser->last_name));

            //  Update admin changelog
            $this->oChangeLogModel->add(
                'deleted',
                'a',
                'user',
                $iUserId,
                '#' . number_format($iUserId) . ' ' . $oUser->first_name . ' ' . $oUser->last_name
            );

        } else {
            $sStatus  = 'error';
            $sMessage = lang('accounts_delete_error', title_case($oUser->first_name . ' ' . $oUser->last_name));
        }

        $oSession->setFlashData($sStatus, $sMessage);

        // --------------------------------------------------------------------------

        $this->returnToIndex();
    }
407236
public function removeIdentifier($identifier)
    {
        if (isset($this->identifiers[$identifier])) {
            unset($this->identifiers[$identifier]);
        }

        return $this;
    }
485824
public function setIdentifier($identifier) {

		if(false === is_array($identifier)) {
			$identifier = [$identifier];
		}

		$this -> identifier = $identifier;
	}
125313
public static function removeAdapter(string $keyIdentifier): void
    {
        if (isset(static::$adapters[$keyIdentifier])) {
            static::$adapters[$keyIdentifier]->close();
            unset(static::$adapters[$keyIdentifier]);
        }
    }
95654
public function accountRegister($identifier, $identifierType, $passport)
    {
        $request = new AccountRegisterRequest($identifier, $identifierType, $passport);
        $response = new BaseResponse();
        return $this->client->sendRequest($request, $response);
    }
833003
public function End($Authenticator = NULL) {
      if ($Authenticator == NULL)
         $Authenticator = Gdn::Authenticator();

      $Authenticator->AuthenticateWith()->DeAuthenticate();
      $this->SetCookie('-Vv', NULL, -3600);
      
      $this->UserID = 0;
      $this->User = FALSE;
      $this->_Attributes = array();
      $this->_Permissions = array();
      $this->_Preferences = array();
      $this->_TransientKey = FALSE;
   }
496833
public function delete($account, $action = '', $parameters = null)
    {
        return $this->sendRequest('DELETE', $account, $action, $parameters);
    }
1282044
public function deleteWorkspace(Workspace $workspace)
    {
        // Log action
        $this->dispatcher->dispatch('log', 'Log\LogWorkspaceDelete', [$workspace]);

        $this->om->startFlushSuite();
        $roots = $this->om->getRepository(ResourceNode::class)->findBy(['workspace' => $workspace, 'parent' => null]);

        //in case 0 or multiple due to errors
        foreach ($roots as $root) {
            $this->log('Removing root directory '.$root->getName().'[id:'.$root->getId().']');
            $children = $root->getChildren();
            $this->log('Looping through '.count($children).' children...');

            if ($children) {
                foreach ($children as $node) {
                    $this->resourceManager->delete($node);
                }
            }
        }

        $tabs = $this->om->getRepository(HomeTab::class)->findBy(['workspace' => $workspace]);
        $crud = $this->container->get('claroline.api.crud');

        foreach ($tabs as $tab) {
            $crud->delete($tab);
        }

        $this->dispatcher->dispatch(
            'claroline_workspaces_delete',
            'GenericData',
            [[$workspace]]
        );
        $this->om->remove($workspace);
        $this->om->endFlushSuite();
    }
847745
protected function createTemporaryAccount($accountIdentifier, $password, $firstName, $lastName)
    {
        if (strlen($firstName) === 0 && strlen($lastName) === 0) {
            $firstName = 'Santa';
            $lastName = 'Claus';
        }

        $user = new User();
        $user->setName(new PersonName('', $firstName, '', $lastName));
        $user->getPreferences()->set('context.workspace', 'user-' . $accountIdentifier);
        $this->partyRepository->add($user);

        $account = $this->accountFactory->createAccountWithPassword($accountIdentifier, $password, array('Neos.Neos:Editor'), 'Neos.Neos:Backend');
        $this->partyService->assignAccountToParty($account, $user);
        $account->setExpirationDate(new \DateTime('+1 week'));

        $this->accountRepository->add($account);
    }
765729
public function createAction($workspaceName, Workspace $baseWorkspace, $ownerAccountIdentifier = null)
    {
        $existingWorkspace = $this->workspaceRepository->findByIdentifier($workspaceName);
        if ($existingWorkspace !== null) {
            $this->throwStatus(409, 'Workspace already exists', '');
        }

        if ($ownerAccountIdentifier !== null) {
            $owner = $this->userService->getUser($ownerAccountIdentifier);
            if ($owner === null) {
                $this->throwStatus(422, 'Requested owner account does not exist', '');
            }
        } else {
            $owner = null;
        }

        $workspace = new Workspace($workspaceName, $baseWorkspace, $owner);
        $this->workspaceRepository->add($workspace);
        $this->throwStatus(201, 'Workspace created', '');
    }
10448
private function _delete_account_addons( $store = true ) {
            $all_addons = self::get_all_account_addons();

            if ( ! isset( $all_addons[ $this->_plugin->id ] ) ) {
                return false;
            }

            unset( $all_addons[ $this->_plugin->id ] );

            self::$_accounts->set_option( 'account_addons', $all_addons, $store );

            return true;
        }