<?php  // Headers específicos para LiteSpeed Cache header('Cache-Control: no-cache, no-store, must-revalidate, max-age=0'); header('Pragma: no-cache'); header('Expires: Thu, 01 Jan 1970 00:00:00 GMT');  // Headers específicos para LiteSpeed if (function_exists('litespeed_purge_all')) {     header('X-LiteSpeed-Cache-Control: no-cache'); }  // Desabilitar cache do WordPress para este arquivo if (!defined('DONOTCACHEPAGE')) {     define('DONOTCACHEPAGE', true); } if (!defined('DONOTCACHEOBJECT')) {     define('DONOTCACHEOBJECT', true); } if (!defined('DONOTCACHEDB')) {     define('DONOTCACHEDB', true); }  // Verificar se existe um parâmetro para forçar atualização do cookie $force_refresh = isset($_GET['refresh_user']) || isset($_POST['refresh_user']);  // Tentar obter o cookie de diferentes formas $idpessoacode = null;  // Método 1: Cookie tradicional if (isset($_COOKIE['idpessoacode']) && !empty($_COOKIE['idpessoacode'])) {     $idpessoacode = sanitize_text_field($_COOKIE['idpessoacode']); }  // Método 2: Verificar via JavaScript se o cookie não foi encontrado if (empty($idpessoacode)) {     echo '<script>         // Tentar obter cookie via JavaScript         function getCookie(name) {             let value = "; " + document.cookie;             let parts = value.split("; " + name + "=");             if (parts.length == 2) return parts.pop().split(";").shift();             return null;         }                  let cookieValue = getCookie("idpessoacode");         if (cookieValue && cookieValue !== "") {             // Reenviar via POST se encontrou cookie no JS             let form = document.createElement("form");             form.method = "POST";             form.style.display = "none";                          let input = document.createElement("input");             input.name = "js_cookie_value";             input.value = cookieValue;             form.appendChild(input);                          let refresh = document.createElement("input");             refresh.name = "refresh_user";             refresh.value = "1";             form.appendChild(refresh);                          document.body.appendChild(form);             form.submit();         }     </script>'; }  // Método 3: Verificar se foi enviado via POST do JavaScript if (empty($idpessoacode) && isset($_POST['js_cookie_value']) && !empty($_POST['js_cookie_value'])) {     $idpessoacode = sanitize_text_field($_POST['js_cookie_value']); }  // Debug (remover em produção) error_log('Cookie idpessoacode: ' . ($idpessoacode ? $idpessoacode : 'não encontrado'));  if (!empty($idpessoacode)) {     $url = "https://cmsv3.portasabertas.org.br/api/pessoas/mev3";      $headers = [         'Authorization' => 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJNREV5VW10R1ZGWkZUazVWZHowOVRXcEJNRTlCUFQwIn0=.sR2PWTqcv/2a1efuM7mlshQ0hEkCGRnV0HmVi7rzQro=',          'Content-Type'  => 'application/json',         'Cache-Control' => 'no-cache',         'User-Agent' => 'WordPress/' . get_bloginfo('version') . '; ' . get_bloginfo('url')     ];      $body = json_encode([         'idpessoacode' => $idpessoacode     ]);      // Adicionar timestamp para evitar cache na API     $response = wp_remote_post($url . '?t=' . time(), [         'headers' => $headers,         'body'    => $body,         'timeout' => 15,         'sslverify' => true,         'blocking' => true,         'httpversion' => '1.1'     ]);      if (!is_wp_error($response)) {         $response_code = wp_remote_retrieve_response_code($response);         $body_response = wp_remote_retrieve_body($response);                  // Debug da resposta (remover em produção)         error_log('Response code: ' . $response_code);         error_log('Response body: ' . $body_response);                  $data = json_decode($body_response, true);          if (!empty($data) && isset($data['data']['despessoa'])) {             $nome   = esc_html($data['data']['despessoa']);             $imagem = !empty($data['data']['desimage'])                          ? esc_url($data['data']['desimage'])                          : "https://sitepa.s3.amazonaws.com/wp-content/uploads/br/2025/09/Vertical-container-1.avif";              // Adicionar um identificador único para evitar cache do browser             $cache_buster = '?v=' . time();             if (strpos($imagem, '?') !== false) {                 $cache_buster = '&v=' . time();             }              // Usuário logado             echo '             <div class="user-menu" style="position:relative;display:inline-block;" data-user-loaded="true">                 <div class="user-box" style="display:flex;align-items:center;gap:8px;cursor:pointer;" onclick="toggleUserDropdown(this)">                     <img src="'.$imagem.$cache_buster.'" alt="'.$nome.'" style="width:35px;height:35px;border-radius:50%;object-fit:cover;" onload="this.style.opacity=1" style="opacity:0;transition:opacity 0.3s;">                     <span style="font-size:14px;">Hola, <strong>'.$nome.'</strong></span>                     <img src="https://sitepa.s3.amazonaws.com/wp-content/uploads/br/2025/09/Arrows-Diagrams.svg" alt="Seta" style="width:25px;height:25px;">                 </div>                 <div class="user-dropdown" style="display:none;position:absolute;right:0;top:100%;background:#fff;border:1px solid #ddd;border-radius:6px;box-shadow:0 2px 6px rgba(0,0,0,0.15);min-width:200px;z-index:999;">                     <a href="https://parceiro.portasabertas.org.br/" style="display:flex;align-items:center;gap:6px;padding:10px;color:#333;text-decoration:none;font-size:14px;">                         <img src="https://sitepa.s3.amazonaws.com/wp-content/uploads/br/2025/09/login-enter-arrow-right-circle.svg" alt="Área restrita" style="width:16px;height:16px;">                         Acceder al portal                     </a>                                      </div>             </div>              <script>             function toggleUserDropdown(element) {                 let dropdown = element.nextElementSibling;                 dropdown.style.display = dropdown.style.display === "block" ? "none" : "block";             }              function refreshUserData() {                 window.location.href = window.location.href + (window.location.href.includes("?") ? "&" : "?") + "refresh_user=1";             }              // Fechar dropdown ao clicar fora             document.addEventListener("click", function(e) {                 document.querySelectorAll(".user-dropdown").forEach(function(drop){                     if (!drop.previousElementSibling.contains(e.target)) {                         drop.classList.remove("show");                         drop.style.display = "none";                     }                 });             });              // Verificar se o usuário foi carregado corretamente             document.addEventListener("DOMContentLoaded", function() {                 if (!document.querySelector("[data-user-loaded]")) {                     console.log("Usuário não carregado, tentando novamente em 2 segundos...");                     setTimeout(function() {                         window.location.reload();                     }, 2000);                 }             });             </script>             ';         } else {             // Dados inválidos na API             error_log('Dados inválidos retornados pela API: ' . json_encode($data));             showFallbackLogin();         }     } else {         // Erro na API         error_log('Erro na API: ' . $response->get_error_message());         showFallbackLogin();     } } else {     // Sem cookie     showFallbackLogin(); }  // Função para mostrar o fallback de login function showFallbackLogin() {     echo '<div class="user-login" style="display:flex;align-items:center;gap:10px;">';     echo '<img src="https://sitepa.s3.amazonaws.com/wp-content/uploads/br/2025/09/Vertical-container-1.avif" alt="Login" style="width:35px;height:35px;">';     echo '<a href="https://auth.parceiro.portasabertas.org.br/login">Entrar</a>';     echo '<span class="header__divider">|</span>';     echo '<a href="https://auth.parceiro.portasabertas.org.br/cadastro">Regístrate</a>';     echo '</div>'; }  // CSS adicional para melhorar a experiência echo '<style> .user-menu img {     transition: opacity 0.3s ease-in-out; } .user-dropdown.show {     display: block !important; } </style>'; ?>
.header__divider {   color: #D0D5DD; }  .user-login {   color: #101828; }
<?php  // Headers específicos para LiteSpeed Cache header('Cache-Control: no-cache, no-store, must-revalidate, max-age=0'); header('Pragma: no-cache'); header('Expires: Thu, 01 Jan 1970 00:00:00 GMT');  // Headers específicos para LiteSpeed if (function_exists('litespeed_purge_all')) {     header('X-LiteSpeed-Cache-Control: no-cache'); }  // Desabilitar cache do WordPress para este arquivo if (!defined('DONOTCACHEPAGE')) {     define('DONOTCACHEPAGE', true); } if (!defined('DONOTCACHEOBJECT')) {     define('DONOTCACHEOBJECT', true); } if (!defined('DONOTCACHEDB')) {     define('DONOTCACHEDB', true); }  // Verificar se existe um parâmetro para forçar atualização do cookie $force_refresh = isset($_GET['refresh_user']) || isset($_POST['refresh_user']);  // Tentar obter o cookie de diferentes formas $idpessoacode = null;  // Método 1: Cookie tradicional if (isset($_COOKIE['idpessoacode']) && !empty($_COOKIE['idpessoacode'])) {     $idpessoacode = sanitize_text_field($_COOKIE['idpessoacode']); }  // Método 2: Verificar via JavaScript se o cookie não foi encontrado if (empty($idpessoacode)) {     echo '<script>         // Tentar obter cookie via JavaScript         function getCookie(name) {             let value = "; " + document.cookie;             let parts = value.split("; " + name + "=");             if (parts.length == 2) return parts.pop().split(";").shift();             return null;         }                  let cookieValue = getCookie("idpessoacode");         if (cookieValue && cookieValue !== "") {             // Reenviar via POST se encontrou cookie no JS             let form = document.createElement("form");             form.method = "POST";             form.style.display = "none";                          let input = document.createElement("input");             input.name = "js_cookie_value";             input.value = cookieValue;             form.appendChild(input);                          let refresh = document.createElement("input");             refresh.name = "refresh_user";             refresh.value = "1";             form.appendChild(refresh);                          document.body.appendChild(form);             form.submit();         }     </script>'; }  // Método 3: Verificar se foi enviado via POST do JavaScript if (empty($idpessoacode) && isset($_POST['js_cookie_value']) && !empty($_POST['js_cookie_value'])) {     $idpessoacode = sanitize_text_field($_POST['js_cookie_value']); }  // Debug (remover em produção) error_log('Cookie idpessoacode: ' . ($idpessoacode ? $idpessoacode : 'não encontrado'));  if (!empty($idpessoacode)) {     $url = "https://cmsv3.portasabertas.org.br/api/pessoas/mev3";      $headers = [         'Authorization' => 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJNREV5VW10R1ZGWkZUazVWZHowOVRXcEJNRTlCUFQwIn0=.sR2PWTqcv/2a1efuM7mlshQ0hEkCGRnV0HmVi7rzQro=',          'Content-Type'  => 'application/json',         'Cache-Control' => 'no-cache',         'User-Agent' => 'WordPress/' . get_bloginfo('version') . '; ' . get_bloginfo('url')     ];      $body = json_encode([         'idpessoacode' => $idpessoacode     ]);      // Adicionar timestamp para evitar cache na API     $response = wp_remote_post($url . '?t=' . time(), [         'headers' => $headers,         'body'    => $body,         'timeout' => 15,         'sslverify' => true,         'blocking' => true,         'httpversion' => '1.1'     ]);      if (!is_wp_error($response)) {         $response_code = wp_remote_retrieve_response_code($response);         $body_response = wp_remote_retrieve_body($response);                  // Debug da resposta (remover em produção)         error_log('Response code: ' . $response_code);         error_log('Response body: ' . $body_response);                  $data = json_decode($body_response, true);          if (!empty($data) && isset($data['data']['despessoa'])) {             $nome   = esc_html($data['data']['despessoa']);             $imagem = !empty($data['data']['desimage'])                          ? esc_url($data['data']['desimage'])                          : "https://sitepa.s3.amazonaws.com/wp-content/uploads/br/2025/09/Vertical-container-1.avif";              // Adicionar um identificador único para evitar cache do browser             $cache_buster = '?v=' . time();             if (strpos($imagem, '?') !== false) {                 $cache_buster = '&v=' . time();             }              // Usuário logado             echo '             <div class="user-menu" style="position:relative;display:inline-block;" data-user-loaded="true">                 <div class="user-box" style="display:flex;align-items:center;gap:8px;cursor:pointer;" onclick="toggleUserDropdown(this)">                     <img src="'.$imagem.$cache_buster.'" alt="'.$nome.'" style="width:35px;height:35px;border-radius:50%;object-fit:cover;" onload="this.style.opacity=1" style="opacity:0;transition:opacity 0.3s;">                     <span style="font-size:14px;">Hola, <strong>'.$nome.'</strong></span>                     <img src="https://sitepa.s3.amazonaws.com/wp-content/uploads/br/2025/09/Arrows-Diagrams.svg" alt="Seta" style="width:25px;height:25px;">                 </div>                 <div class="user-dropdown" style="display:none;position:absolute;right:0;top:100%;background:#fff;border:1px solid #ddd;border-radius:6px;box-shadow:0 2px 6px rgba(0,0,0,0.15);min-width:200px;z-index:999;">                     <a href="https://parceiro.portasabertas.org.br/" style="display:flex;align-items:center;gap:6px;padding:10px;color:#333;text-decoration:none;font-size:14px;">                         <img src="https://sitepa.s3.amazonaws.com/wp-content/uploads/br/2025/09/login-enter-arrow-right-circle.svg" alt="Área restrita" style="width:16px;height:16px;">                         Acceder al portal                     </a>                                      </div>             </div>              <script>             function toggleUserDropdown(element) {                 let dropdown = element.nextElementSibling;                 dropdown.style.display = dropdown.style.display === "block" ? "none" : "block";             }              function refreshUserData() {                 window.location.href = window.location.href + (window.location.href.includes("?") ? "&" : "?") + "refresh_user=1";             }              // Fechar dropdown ao clicar fora             document.addEventListener("click", function(e) {                 document.querySelectorAll(".user-dropdown").forEach(function(drop){                     if (!drop.previousElementSibling.contains(e.target)) {                         drop.classList.remove("show");                         drop.style.display = "none";                     }                 });             });              // Verificar se o usuário foi carregado corretamente             document.addEventListener("DOMContentLoaded", function() {                 if (!document.querySelector("[data-user-loaded]")) {                     console.log("Usuário não carregado, tentando novamente em 2 segundos...");                     setTimeout(function() {                         window.location.reload();                     }, 2000);                 }             });             </script>             ';         } else {             // Dados inválidos na API             error_log('Dados inválidos retornados pela API: ' . json_encode($data));             showFallbackLogin();         }     } else {         // Erro na API         error_log('Erro na API: ' . $response->get_error_message());         showFallbackLogin();     } } else {     // Sem cookie     showFallbackLogin(); }  // Função para mostrar o fallback de login function showFallbackLogin() {     echo '<div class="user-login" style="display:flex;align-items:center;gap:10px;">';     echo '<img src="https://sitepa.s3.amazonaws.com/wp-content/uploads/br/2025/09/Vertical-container-1.avif" alt="Login" style="width:35px;height:35px;">';     echo '<a href="https://auth.parceiro.portasabertas.org.br/login">Entrar</a>';     echo '<span class="header__divider">|</span>';     echo '<a href="https://auth.parceiro.portasabertas.org.br/cadastro">Regístrate</a>';     echo '</div>'; }  // CSS adicional para melhorar a experiência echo '<style> .user-menu img {     transition: opacity 0.3s ease-in-out; } .user-dropdown.show {     display: block !important; } </style>'; ?>
Bem vindo
Acesse sua conta ou registre-se gratuitamente.

Receba a Portas Abertas em sua igreja

Veja os locais das próximas visitas dos representantes locais no Brasil
Portas Abertas • 28 jan 2025
Não perca a oportunidade de se aproximar da Igreja Perseguida

Os representantes da Portas Abertas são preparados e têm o papel de aproximar a igreja brasileira dos cristãos perseguidos. Nas visitas, eles compartilham em diversas cidades como podemos socorrer a Igreja Perseguida usando a liberdade que temos no Brasil.

Em 2024, muitos participantes em Curitiba, Criciúma, Fortaleza, Juiz de Fora e em outras cidades ouviram informações atualizadas da Igreja Perseguida ao redor do mundo, uma breve apresentação da Portas Abertas, reflexão bíblica e informações práticas sobre como fazer a diferença na vida de muitos cristãos perseguidos.

Veja o depoimento de uma das participantes:“Conhecer as histórias dos nossos irmãos perseguidos nos aproxima deles e gera a necessidade de interceder por suas vidas! Creio que esse contato gerará muitos frutos!”, Priscila, Igreja Família Cristã em Curitiba.

Igreja Lagoinha Lauro de Freitas em Salvador/BA

Você também pode ficar mais perto da Igreja Perseguida em 2025. As próximas paradas são as cidades brasileiras abaixo. Se sua igreja está em alguma delas, guarde um espaço em sua agenda e preencha agora mesmo o formulário.

Agenda 2025

20 a 23 de fevereiro – Cuiabá/MT

13 a 16 de março – Uberlândia/MG e Porto Alegre/RS

26 de março a 6 de abril – Goiânia/GO e região

10 a 13 de abril – Resende/RJ e região

22 a 25 de maio – Campo Grande/MS