Update Composer, update everything
This commit is contained in:
parent
ea3e94409f
commit
dda5c284b6
19527 changed files with 1135420 additions and 351004 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace Drupal\ban;
|
||||
|
||||
use Drupal\Component\Utility\SafeMarkup;
|
||||
use Drupal\Component\Render\FormattableMarkup;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\HttpKernelInterface;
|
||||
|
@ -45,7 +45,7 @@ class BanMiddleware implements HttpKernelInterface {
|
|||
public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = TRUE) {
|
||||
$ip = $request->getClientIp();
|
||||
if ($this->banIpManager->isBanned($ip)) {
|
||||
return new Response(SafeMarkup::format('@ip has been banned', ['@ip' => $ip]), 403);
|
||||
return new Response(new FormattableMarkup('@ip has been banned', ['@ip' => $ip]), 403);
|
||||
}
|
||||
return $this->httpKernel->handle($request, $type, $catch);
|
||||
}
|
||||
|
|
|
@ -10,6 +10,8 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
|
|||
|
||||
/**
|
||||
* Displays banned IP addresses.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
class BanAdmin extends FormBase {
|
||||
|
||||
|
@ -118,7 +120,7 @@ class BanAdmin extends FormBase {
|
|||
public function submitForm(array &$form, FormStateInterface $form_state) {
|
||||
$ip = trim($form_state->getValue('ip'));
|
||||
$this->ipManager->banIp($ip);
|
||||
drupal_set_message($this->t('The IP address %ip has been banned.', ['%ip' => $ip]));
|
||||
$this->messenger()->addStatus($this->t('The IP address %ip has been banned.', ['%ip' => $ip]));
|
||||
$form_state->setRedirect('ban.admin_page');
|
||||
}
|
||||
|
||||
|
|
|
@ -11,6 +11,8 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
|||
|
||||
/**
|
||||
* Provides a form to unban IP addresses.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
class BanDelete extends ConfirmFormBase {
|
||||
|
||||
|
@ -94,7 +96,7 @@ class BanDelete extends ConfirmFormBase {
|
|||
public function submitForm(array &$form, FormStateInterface $form_state) {
|
||||
$this->ipManager->unbanIp($this->banIp);
|
||||
$this->logger('user')->notice('Deleted %ip', ['%ip' => $this->banIp]);
|
||||
drupal_set_message($this->t('The IP address %ip was deleted.', ['%ip' => $this->banIp]));
|
||||
$this->messenger()->addStatus($this->t('The IP address %ip was deleted.', ['%ip' => $this->banIp]));
|
||||
$form_state->setRedirectUrl($this->getCancelUrl());
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ class BlockedIP extends DestinationBase implements ContainerFactoryPluginInterfa
|
|||
* @param string $plugin_id
|
||||
* The plugin ID.
|
||||
* @param mixed $plugin_definition
|
||||
* The plugin definiiton.
|
||||
* The plugin definition.
|
||||
* @param \Drupal\migrate\Plugin\MigrationInterface $migration
|
||||
* The current migration.
|
||||
* @param \Drupal\ban\BanIpManagerInterface $ban_manager
|
||||
|
|
|
@ -9,7 +9,7 @@ use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase;
|
|||
*
|
||||
* @MigrateSource(
|
||||
* id = "d7_blocked_ips",
|
||||
* source_provider = "system"
|
||||
* source_module = "system"
|
||||
* )
|
||||
*/
|
||||
class BlockedIps extends DrupalSqlBase {
|
||||
|
|
Reference in a new issue