function confirm_pirate_auth_login()
{
    if (!pirate_auth_logged_in()) {
        header("Location: login.php");
        exit;
    }
}
Beispiel #2
0
require_once "pirate-auth/pirate-auth.php";
//confirm_pirate_auth_login();
?>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Pirate Cove</title>
</head>
<body>

<a href="../../login.php">Log in</a>
<a href="../../register.php">Register</a>

<?php 
if (pirate_auth_logged_in()) {
    ?>
    <a href="../../logout.php">log out <?php 
    echo pirate_auth_current_user('first_name') . ' ' . pirate_auth_current_user('last_name');
    ?>
</a>
<?php 
}
?>

<h3>Users</h3>
<ul>
    <?php 
while ($user = mysqli_fetch_array($users)) {
    echo "<li>{$user['first_name']} {$user['last_name']} | {$user['username']} | {$user['email']}</li>";
}