403Webshell
Server IP : 195.130.67.5  /  Your IP : 216.73.217.154
Web Server : Microsoft-IIS/10.0
System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586
User : IUSR ( 0)
PHP Version : 7.4.19
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/inetpub/wwwroot/business/sites/all/modules/ctools/plugins/access/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/inetpub/wwwroot/business/sites/all/modules/ctools/plugins/access/theme.inc
<?php

/**
 * @file
 * Plugin to provide access control based on user themeission strings.
 */

/**
 * Plugins are described by creating a $plugin array which will be used
 * by the system that includes this file.
 */
$plugin = array(
  'title' => t("Current theme"),
  'description' => t('Control access by checking which theme is in use.'),
  'callback' => 'ctools_theme_ctools_access_check',
  'default' => array('theme' => variable_get('theme_default', 'garland')),
  'settings form' => 'ctools_theme_ctools_access_settings',
  'summary' => 'ctools_theme_ctools_access_summary',
);

/**
 * Settings form for the 'by theme' access plugin.
 */
function ctools_theme_ctools_access_settings($form, &$form_state, $conf) {
  $themes = array();
  foreach (list_themes() as $key => $theme) {
    $themes[$key] = $theme->info['name'];
  }

  $form['settings']['theme'] = array(
    '#type' => 'select',
    '#options' => $themes,
    '#title' => t('Themes'),
    '#default_value' => $conf['theme'],
    '#description' => t('This will only be accessed if the current theme is the selected theme.'),
  );
  return $form;
}

/**
 * Check for access.
 */
function ctools_theme_ctools_access_check($conf, $context) {
  if (!empty($GLOBALS['theme'])) {
    $theme = $GLOBALS['theme'];
  }
  elseif (!empty($GLOBALS['custom_theme'])) {
    $theme = $GLOBALS['custom_theme'];
  }
  elseif (!empty($GLOBALS['user']->theme)) {
    $theme = $GLOBALS['user']->theme;
  }
  else {
    $theme = variable_get('theme_default', 'garland');
  }

  return $conf['theme'] == $theme;
}

/**
 * Provide a summary description based upon the checked roles.
 */
function ctools_theme_ctools_access_summary($conf, $context) {
  if (!isset($conf['theme'])) {
    return t('Error, unset theme');
  }
  $themes = list_themes();

  return t('Current theme is "@theme"', array('@theme' => $themes[$conf['theme']]->info['name']));
}

Youez - 2016 - github.com/yon3zu
LinuXploit