Welcome To Our Shell

Mister Spy & Souheyl Bypass Shell

Current Path : /var/www/html/rocksensor3/web/modules/contrib/visitors/src/Theme/

Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
Upload File :
Current File : /var/www/html/rocksensor3/web/modules/contrib/visitors/src/Theme/VisitorThemeNegotiator.php

<?php

namespace Drupal\visitors\Theme;

use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Theme\ThemeNegotiatorInterface;
use Drupal\Core\Session\AccountInterface;

/**
 * A negotiator for custom visitors' theme.
 */
class VisitorThemeNegotiator implements ThemeNegotiatorInterface {

  /**
   * The config factory.
   *
   * @var \Drupal\Core\Config\ConfigFactoryInterface
   */
  protected $configFactory;

  /**
   * The current user.
   *
   * @var \Drupal\Core\Session\AccountInterface
   */
  protected $currentUser;

  /**
   * Constructs a new ThemeNegotiator.
   *
   * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
   *   The config factory.
   * @param \Drupal\Core\Session\AccountInterface $current_user
   *   The current user.
   */
  public function __construct(ConfigFactoryInterface $config_factory, AccountInterface $current_user) {
    $this->configFactory = $config_factory;
    $this->currentUser = $current_user;
  }

  /**
   * {@inheritdoc}
   */
  public function applies(RouteMatchInterface $route_match) {
    $access = $this->currentUser->hasPermission('access visitors');
    if (!$access) {
      return FALSE;
    }

    $route_object = $route_match->getRouteObject();
    if (!$route_object) {
      return FALSE;
    }

    $route_name = $route_match->getRouteName();
    if (strpos($route_name, 'visitors.') === 0) {
      return TRUE;
    }
    $path = $route_object->getPath();
    if (strpos($path, '/visitors') === 0) {
      return TRUE;
    }

    return FALSE;
  }

  /**
   * {@inheritdoc}
   */
  public function determineActiveTheme(RouteMatchInterface $route_match) {
    // Get the visitors config.
    $config = $this->configFactory->get('visitors.config');
    $theme = $config->get('theme') ?: 'admin';

    return $this->configFactory->get('system.theme')->get($theme) ?: $theme;
  }

}

bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped)
Email: contact@elmoujehidin.net bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped) Email: contact@elmoujehidin.net