hjkhjkjhkhjkgjghjhgjhgjghjhghjghjhgjjnbvnvbnvk
bnmbnmbnhjkhjkhjkhjktyutyutyuytutyutyutyhgjgjghjgjghjguytutyry
/
home
/
wjcvelqp
/
public_html
/
vc
/
Upload FileeE
HOME
<?php require_once __DIR__ . '/includes/bootstrap.php'; if (auth_check()) { redirect('dashboard/index.php'); } $error = ''; if (is_post()) { csrf_require(); $email = strtolower(clean_string($_POST['email'] ?? '', 190)); $password = (string) ($_POST['password'] ?? ''); if (!validate_email($email) || $password === '') { $error = 'Enter email and password.'; } elseif (too_many_login_attempts($email)) { $error = 'Too many failed attempts. Try again in ' . VC_LOGIN_LOCK_MINUTES . ' minutes.'; } else { try { $st = db()->prepare('SELECT * FROM users WHERE email = ? LIMIT 1'); $st->execute([$email]); $user = $st->fetch(); if (!$user || !password_verify($password, $user['password_hash'])) { record_login_attempt($email, false); $error = 'Invalid email or password.'; } elseif (($user['status'] ?? '') === 'deactivated') { $error = 'This account has been deactivated.'; } else { record_login_attempt($email, true); auth_login($user); db()->prepare('UPDATE users SET last_login_at = NOW() WHERE id = ?')->execute([(int)$user['id']]); $redir = $_SESSION['redirect_after_login'] ?? url('dashboard/index.php'); unset($_SESSION['redirect_after_login']); if (strpos($redir, 'http') !== 0) { redirect(ltrim($redir, '/')); } header('Location: ' . $redir); exit; } } catch (Throwable $e) { $error = VC_DEBUG ? $e->getMessage() : 'Login failed.'; } } } $page_title = 'Login — ' . VC_APP_NAME; include __DIR__ . '/includes/header.php'; ?> <div class="auth-wrap"> <div class="container"> <div class="form-box"> <h1>Log in</h1> <?php if ($error): ?><div class="alert alert-error"><?= e($error) ?></div><?php endif; ?> <form method="post"> <?= csrf_field() ?> <div class="form-group"><label>Email</label> <input type="email" name="email" required value="<?= e($_POST['email'] ?? '') ?>"></div> <div class="form-group"><label>Password</label> <input type="password" name="password" id="loginPass" required> <button type="button" class="btn btn-sm btn-outline" data-toggle-password="loginPass" style="margin-top:6px">Show</button> </div> <button class="btn btn-primary" type="submit" style="width:100%;margin-top:8px">Log in</button> </form> <p style="margin-top:14px"> <a href="<?= e(url('forgot-password.php')) ?>">Forgot password?</a><br> No account? <a href="<?= e(url('register.php')) ?>">Register</a> </p> </div> </div> </div> <?php include __DIR__ . '/includes/footer.php'; ?>