<?php /** * Created by : PhpStorm. * User : sam * Company : Jeeble * Date : 7/21/15 * Time : 10:38 AM */ require_once "assets/includes/includes.php"; confirm_pirate_auth_login(); if (!can_current_user("create")) { redirect_to('index.php'); } if (isset($_POST['newpage'])) { if (new_page(pirate_auth_current_user('id'), $_POST['title'], $_POST['content'], $_POST['reqconf'], $_POST['state'], $_POST['visibility'], $_POST['original_id'])) { redirect_to('index.php'); } } $page = []; if (isset($_GET['original_id'])) { $page = get_page($_GET['original_id']); } get_partial('header'); ?> <div class="container"> <form action="newpage.php" method="post"> <div class="col-sm-6 col-sm-offset-3"> <h1 class="page-header">New Page</h1> <div class="form-group">
<?php } ?> </h1> <?php echo $page['content']; ?> </div> <?php if ($page['requires_confirmation'] == "true") { ?> <form class="confirmation" action="index.php" method="post"> <label for="agree">I Have read and agree with this content</label> <input type="checkbox" <?php if (user_has_confirmed(pirate_auth_current_user('id'), $page['id']) == "true") { ?> checked disabled<?php } ?> id="agree" class="toggle_hidden" data-toggle="#agree_btn"/> <br/> <input name="page_id" value="<?php echo $page['id']; ?> " type="hidden"/> <button type="submit" name="confirm_page" class="btn btn-primary hidden" id="agree_btn">Done</button> </form> <?php } ?>
<!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>"; } echo "<hr>"; ?> </ul>
echo $user['email']; ?> " type="text"/> </div> <hr/> <div class="form-group"> <label for="password">New Password</label> <input class="form-control" id="password" name="new_password" type="password"/> </div> <div class="form-group"> <label for="conf_password">Confirm New Password</label> <input class="form-control" id="conf-password" name="conf_password" type="password"/> </div> <?php if (pirate_auth_current_user('rank') == 'admin' && $user['id'] != pirate_auth_current_user('id')) { ?> <div class="form-group"> <label for="rank">Rank</label> <select class="form-control" id="rank" name="rank"> <option value="admin" <?php if ($user['rank'] == 'admin') { ?> selected='selected' <?php } ?> >Administrator</option> <option value="author" <?php if ($user['rank'] == 'author') { ?> selected='selected' <?php
?> </td> </tr> <?php } } ?> </table> <h3>Actions</h3> <ul class="nav nav-pills nav-stacked"> <?php if (can_current_user("create")) { ?> <li><a href="admin.php">Admin Dashboard</a></li> <li><a href="newpage.php">New Page</a></li> <?php } ?> <li><a href="edituser.php?user=<?php echo pirate_auth_current_user('id'); ?> ">Edit Profile</a></li> <li><a href="logout.php">Logout</a></li> </ul> </div> <?php get_partial('footer');
function confirm_reading($user_id, $page_id) { global $connection; global $sql_date; global $name_date; $page = get_page($page_id); $author = pirate_auth_get_user_by_id($page['author_id']); $sql = "INSERT INTO confirmations(page_id, user_id, date_confirmed) VALUES ('{$page_id}', '{$user_id}', '{$sql_date}')"; if ($result = mysqli_query($connection, $sql)) { $subject = "Policy Controller"; $message = pirate_auth_current_user('first_name') . " " . pirate_auth_current_user('last_name') . " Just agreed with \"" . $page['title'] . "\" on " . $name_date . "."; mail($author['email'], $subject, $message, "from: m-4@mission-4.com"); return true; } else { kill_confirmer(); } }
echo $usr['first_name']; ?> from you user list?')">[delete]</a> </span> </li> <?php } ?> </ul> </div> </div> </div> <div class="row"> <?php if (pirate_auth_current_user('rank') == "admin") { ?> <div class="col-sm-4"> <div class="panel panel-primary"> <div class="panel-heading">Site Settings</div> <form action="admin.php" class="panel-body" method="post"> <div class="form-group"> <label for="site_title">Site Title:</label> <input class="form-control" id="site_title" name="site_title" type="title" value="<?php echo get_setting('site_title'); ?> "/> </div> <div class="form-group"> <label for="site_logo_path">Site Logo Path:</label> <input class="form-control" id="site_logo_path" name="site_logo_path" type="title" value="<?php