Loading src/Plugin/Action/CancelUserAction.php +15 −6 Original line number Original line Diff line number Diff line Loading @@ -103,13 +103,22 @@ class CancelUserAction extends ViewsBulkOperationsActionBase implements Containe ]); ]); } } // Cancel the account. // Finish the batch and actually cancel the account. \_user_cancel($this->configuration, $account, $this->configuration['user_cancel_method']); $batch = [ 'title' => t('Cancelling user account'), 'operations' => [ ['_user_cancel', [$this->configuration, $account, $this->configuration['user_cancel_method']]], ], ]; // If current user was cancelled, logout. // After cancelling account, ensure that user is logged out. if ($account->id() == $this->currentUser->id()) { if ($account->id() == \Drupal::currentUser()->id()) { \_user_cancel_session_regenerate(); // Batch API stores data in the session, so use the finished operation to // manipulate the current user's session id. $batch['finished'] = '_user_cancel_session_regenerate'; } } batch_set($batch); } } } } Loading Loading
src/Plugin/Action/CancelUserAction.php +15 −6 Original line number Original line Diff line number Diff line Loading @@ -103,13 +103,22 @@ class CancelUserAction extends ViewsBulkOperationsActionBase implements Containe ]); ]); } } // Cancel the account. // Finish the batch and actually cancel the account. \_user_cancel($this->configuration, $account, $this->configuration['user_cancel_method']); $batch = [ 'title' => t('Cancelling user account'), 'operations' => [ ['_user_cancel', [$this->configuration, $account, $this->configuration['user_cancel_method']]], ], ]; // If current user was cancelled, logout. // After cancelling account, ensure that user is logged out. if ($account->id() == $this->currentUser->id()) { if ($account->id() == \Drupal::currentUser()->id()) { \_user_cancel_session_regenerate(); // Batch API stores data in the session, so use the finished operation to // manipulate the current user's session id. $batch['finished'] = '_user_cancel_session_regenerate'; } } batch_set($batch); } } } } Loading