One Hat Cyber Team
Your IP :
216.73.216.36
Server IP :
162.240.179.46
Server :
Linux vps-14493116.nutrivittasaude.com.br 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64
Server Software :
Apache
PHP Version :
8.2.31
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
lifeprimeti
/
meta.lifeprimeti.com.br
/
Edit File:
login.php
<?php require_once __DIR__ . '/config/database.php'; if (isAuthenticated()) { redirect(URL_BASE . 'public/dashboard.php'); } // Carregar config do sistema (empresa_id=1) $sysConfig = $pdo->query("SELECT app_nome, login_bg_tipo, login_bg_arquivo FROM configuracoes WHERE empresa_id = 1")->fetch(); $appNome = !empty($sysConfig['app_nome']) ? $sysConfig['app_nome'] : APP_NAME; $loginBgTipo = $sysConfig['login_bg_tipo'] ?? null; $loginBgArquivo = $sysConfig['login_bg_arquivo'] ?? null; $error = ''; if ($_SERVER['REQUEST_METHOD'] === 'POST') { $email = trim($_POST['email'] ?? ''); $senha = $_POST['senha'] ?? ''; if (empty($email) || empty($senha)) { $error = 'Preencha todos os campos.'; } else { $stmt = $pdo->prepare(" SELECT u.*, e.id as empresa_id, e.nome as empresa_nome, e.ativo as empresa_ativo FROM usuarios u JOIN empresas e ON u.empresa_id = e.id WHERE u.email = ? AND u.ativo = 1 "); $stmt->execute([$email]); $usuario = $stmt->fetch(); if ($usuario && $usuario['empresa_ativo'] && password_verify($senha, $usuario['senha'])) { // Check if empresa is blocked $checkBloqueio = $pdo->prepare("SELECT bloqueado, bloqueado_motivo FROM empresas WHERE id=?"); $checkBloqueio->execute([$usuario['empresa_id']]); $empresaStatus = $checkBloqueio->fetch(); if ($empresaStatus && !empty($empresaStatus['bloqueado']) && $usuario['tipo'] !== 'super_admin') { $error = 'Sua empresa esta bloqueada. Motivo: ' . ($empresaStatus['bloqueado_motivo'] ?? 'Pagamento pendente'); } else { $_SESSION['usuario_id'] = (int)$usuario['id']; $_SESSION['usuario_nome'] = $usuario['nome']; $_SESSION['usuario_email'] = $usuario['email']; $_SESSION['usuario_tipo'] = $usuario['tipo']; $_SESSION['empresa_id'] = (int)$usuario['empresa_id']; $_SESSION['empresa_nome'] = $usuario['empresa_nome']; $_SESSION['usuario_permissoes'] = carregarPermissoes($usuario['id']); $destino = URL_BASE . 'public/dashboard.php'; if ($usuario['tipo'] === 'super_admin') { $destino = URL_BASE . 'admin/index.php'; } $redirect = $_SESSION['redirect_after'] ?? $destino; unset($_SESSION['redirect_after']); redirect($redirect); } } else { $error = 'Email ou senha inválidos.'; } } } ?> <!DOCTYPE html> <html lang="pt-BR" data-bs-theme="dark"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Login — <?= sanitize($appNome) ?></title> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/animate.css@4.1.1/animate.min.css"> <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap" rel="stylesheet"> <style> * { font-family: 'Inter', sans-serif; margin: 0; padding: 0; box-sizing: border-box; } body { background: #0b0b1a; min-height: 100vh; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; } body::before { content: ''; position: fixed; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(ellipse at 20% 50%, rgba(102, 126, 234, 0.12) 0%, transparent 50%), radial-gradient(ellipse at 80% 20%, rgba(118, 75, 162, 0.12) 0%, transparent 50%), radial-gradient(ellipse at 50% 80%, rgba(245, 158, 11, 0.08) 0%, transparent 50%); animation: bgFloat 20s ease-in-out infinite; z-index: 0; } @keyframes bgFloat { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(-3%, -2%); } 50% { transform: translate(2%, -3%); } 75% { transform: translate(-2%, 2%); } } .login-container { width: 440px; position: relative; z-index: 1; animation: fadeInUp 0.8s ease; } @keyframes fadeInUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } } .login-card { background: rgba(18, 18, 42, 0.6); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(102, 126, 234, 0.08); padding: 2.5rem; } .login-logo { text-align: center; margin-bottom: 2rem; } .login-logo .icon { width: 64px; height: 64px; background: linear-gradient(135deg, rgba(102,126,234,0.2), rgba(118,75,162,0.2)); border-radius: 18px; display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; font-size: 2rem; color: #00d4ff; filter: drop-shadow(0 0 15px rgba(0,212,255,0.3)); } .login-logo h1 { font-weight: 800; font-size: 1.75rem; background: linear-gradient(135deg, #667eea, #764ba2); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; } .login-logo p { color: rgba(255,255,255,0.4); font-size: 0.9rem; margin-top: 0.5rem; } .form-control { background: rgba(255,255,255,0.04) !important; border: 1px solid rgba(255,255,255,0.1) !important; color: #fff !important; border-radius: 12px !important; padding: 0.85rem 1.15rem !important; font-size: 0.95rem; transition: all 0.3s ease; } .form-control:focus { border-color: #667eea !important; box-shadow: 0 0 0 3px rgba(102,126,234,0.15) !important; background: rgba(255,255,255,0.06) !important; } .form-control::placeholder { color: rgba(255,255,255,0.25); } .input-group-text { background: rgba(255,255,255,0.04) !important; border: 1px solid rgba(255,255,255,0.1) !important; color: rgba(255,255,255,0.35) !important; border-radius: 12px !important; } .btn-login { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border: none; border-radius: 12px; padding: 0.85rem; font-weight: 600; font-size: 1rem; color: #fff; width: 100%; box-shadow: 0 4px 20px rgba(102,126,234,0.4); transition: all 0.3s ease; cursor: pointer; } .btn-login:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(102,126,234,0.5); } .alert-danger { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.2); color: #fca5a5; border-radius: 12px; padding: 0.75rem 1rem; margin-bottom: 1.5rem; font-size: 0.9rem; } .orb { position: fixed; border-radius: 50%; filter: blur(80px); pointer-events: none; z-index: 0; animation: orbPulse 6s ease-in-out infinite; } @keyframes orbPulse { 0%, 100% { opacity: 0.3; transform: scale(1); } 50% { opacity: 0.6; transform: scale(1.1); } } .particle { position: fixed; border-radius: 50%; background: rgba(255,255,255,0.2); pointer-events: none; z-index: 0; animation: float linear infinite; } @keyframes float { 0% { transform: translateY(100vh) rotate(0deg); opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { transform: translateY(-100vh) rotate(720deg); opacity: 0; } } .text-muted { color: rgba(255,255,255,0.3) !important; } </style> <?php if ($loginBgTipo === 'video' && $loginBgArquivo): ?> <style> .video-bg { position:fixed; top:0; left:0; width:100%; height:100%; object-fit:cover; z-index:0; opacity:0.3; } body { background: transparent !important; } body::before { display: none !important; } </style> <?php elseif ($loginBgTipo === 'imagem' && $loginBgArquivo): ?> <style> body { background: #0b0b1a url('<?= URL_BASE ?>assets/uploads/<?= sanitize($loginBgArquivo) ?>') center/cover fixed !important; } body::before { display: none !important; } </style> <?php endif; ?> </head> <body> <?php if ($loginBgTipo === 'video' && $loginBgArquivo): ?> <video class="video-bg" autoplay muted loop playsinline> <source src="<?= URL_BASE ?>assets/uploads/<?= sanitize($loginBgArquivo) ?>" type="video/mp4"> </video> <?php endif; ?> <div class="orb" style="width:400px;height:400px;background:rgba(102,126,234,0.12);top:-10%;right:-10%;animation-delay:0s"></div> <div class="orb" style="width:300px;height:300px;background:rgba(118,75,162,0.12);bottom:-5%;left:-5%;animation-delay:-2s"></div> <div class="orb" style="width:250px;height:250px;background:rgba(245,158,11,0.08);top:40%;left:60%;animation-delay:-4s"></div> <script> (function() { for (var i = 0; i < 25; i++) { var p = document.createElement('div'); p.className = 'particle'; p.style.left = Math.random() * 100 + '%'; var s = Math.random() * 4 + 2; p.style.width = p.style.height = s + 'px'; p.style.animationDuration = (Math.random() * 20 + 15) + 's'; p.style.animationDelay = (Math.random() * 15) + 's'; document.body.appendChild(p); } })(); </script> <div class="login-container"> <div class="login-card"> <div class="login-logo"> <div class="icon"><i class="bi bi-scissors"></i></div> <h1><?= sanitize($appNome) ?></h1> <p>Sistema de Agendamento Inteligente</p> </div> <?php if ($error): ?> <div class="alert-danger"><i class="bi bi-exclamation-triangle me-2"></i><?= sanitize($error) ?></div> <?php endif; ?> <form method="POST" action=""> <div class="mb-4"> <div class="input-group"> <span class="input-group-text"><i class="bi bi-envelope"></i></span> <input type="email" name="email" class="form-control" placeholder="Seu email" required value="<?= sanitize($_POST['email'] ?? '') ?>"> </div> </div> <div class="mb-4"> <div class="input-group"> <span class="input-group-text"><i class="bi bi-lock"></i></span> <input type="password" name="senha" class="form-control" placeholder="Sua senha" required> <button class="input-group-text" type="button" onclick="toggleSenha(this)" style="cursor:pointer"><i class="bi bi-eye"></i></button> </div> </div> <button type="submit" class="btn-login"> <i class="bi bi-box-arrow-in-right me-2"></i>Entrar </button> </form> <div class="text-center mt-3"> <a href="<?= URL_BASE ?>recuperar.php" class="text-muted" style="text-decoration:none;font-size:0.85rem"> <i class="bi bi-question-circle me-1"></i>Esqueceu a senha? </a> </div> <div class="text-center mt-3"> <a href="<?= URL_BASE ?>register.php" class="text-muted" style="text-decoration:none;font-size:0.9rem"> <i class="bi bi-person-plus me-1"></i>Criar conta </a> </div> </div> </div> <script> function toggleSenha(btn) { var input = btn.closest('.input-group').querySelector('input'); if (!input) return; if (input.type === 'password') { input.type = 'text'; btn.innerHTML = '<i class="bi bi-eye-slash"></i>'; } else { input.type = 'password'; btn.innerHTML = '<i class="bi bi-eye"></i>'; } } </script> </body> </html>
Simpan