| Server IP : 89.108.64.180 / Your IP : 216.73.217.95 Web Server : Apache/2.4.41 (Ubuntu) System : Linux 89-108-64-180.cloudvps.regruhosting.ru 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 User : www-root ( 1010) PHP Version : 8.0.30 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/www-root/data/www/aravanatula.ru/wp-content/plugins/redirection/matches/ |
Upload File : |
<?php
/**
* Check whether the user is logged in or out
*/
class Login_Match extends Red_Match {
/**
* Target URL when logged in.
*
* @var String
*/
public $logged_in = '';
/**
* Target URL when logged out.
*
* @var String
*/
public $logged_out = '';
public function name() {
return __( 'URL and login status', 'redirection' );
}
public function save( array $details, $no_target_url = false ) {
if ( $no_target_url ) {
return null;
}
return [
'logged_in' => isset( $details['logged_in'] ) ? $this->sanitize_url( $details['logged_in'] ) : '',
'logged_out' => isset( $details['logged_out'] ) ? $this->sanitize_url( $details['logged_out'] ) : '',
];
}
public function is_match( $url ) {
return is_user_logged_in();
}
public function get_target_url( $requested_url, $source_url, Red_Source_Flags $flags, $match ) {
$target = false;
if ( $match && $this->logged_in !== '' ) {
$target = $this->logged_in;
} elseif ( ! $match && $this->logged_out !== '' ) {
$target = $this->logged_out;
}
if ( $flags->is_regex() && $target ) {
$target = $this->get_target_regex_url( $source_url, $target, $requested_url, $flags );
}
return $target;
}
public function get_data() {
return [
'logged_in' => $this->logged_in,
'logged_out' => $this->logged_out,
];
}
/**
* Load the match data into this instance.
*
* @param String $values Match values, as read from the database (plain text or serialized PHP).
* @return void
*/
public function load( $values ) {
$values = unserialize( $values );
$this->logged_in = isset( $values['logged_in'] ) ? $values['logged_in'] : '';
$this->logged_out = isset( $values['logged_out'] ) ? $values['logged_out'] : '';
}
}