* Initialize and configure PHPMailer */ $mail = new PHPMailer(); $mail->IsSMTP(); $mail->Host = $options['email_host']; $mail->Port = $options['email_port']; $mail->From = $options['email_from']; $mail->FromName = $options['email_from_name']; $mail->SMTPAuth = false; $mail->Username = $options['email_username']; $mail->Password = $options['email_password']; /** * Initialize EOS */ $eos = new jlawrence\eos\Parser(); /** * User Login Management */ $usr = new UserLogin(); if (isset($_POST['login'])) { $login_result = $usr->login($_POST['user_name'], $_POST['user_password']); if (!$login_result) { create_message('danger', 'The login information you provided was incorrect. Please try again.'); } else { redirect(get_page_url()); } } if (isset($_POST['logout'])) { $usr->logout(); redirect(get_page_url()); }
<?php require_once 'classes/initialize.php'; $userLogin = new UserLogin(); $userLogin->logout(); header('refresh: 2; url=index.php'); require_once 'header.php'; ?> <span>You are being logged out...</span> <?php require_once 'footer.php'; exit;
<?php require_once 'initializer.php'; session_start(); $user_log = new UserLogin(); $user_log->logout(); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> </head> <body> <a href="session.php">Login</a> <p>You are being redirected</p> </body> </html>