コード例 #1
0
ファイル: viewpage.php プロジェクト: phppirate/Confirmer

<div class="modal fade" id="readers">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				<h4 class="modal-title">Readers</h4>
			</div>
			<div class="modal-body">
                <div class="readers">
                    <ul>
                        <?php 
$confirmations = get_page_confirmations($page['id']);
while ($confirmation = mysqli_fetch_array($confirmations)) {
    $reader = pirate_auth_get_user_by_id($confirmation['user_id']);
    ?>
                            <li><?php 
    echo $reader['first_name'] . " " . $reader['last_name'];
    ?>
</li>
                        <?php 
}
?>
                    </ul>
                </div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-primary" data-dismiss="modal">Ok</button>
			</div>
		</div><!-- /.modal-content -->
コード例 #2
0
function pirate_auth_user_param($user_id, $param)
{
    $user = pirate_auth_get_user_by_id($user_id);
    return $user[$param];
}
コード例 #3
0
ファイル: index.php プロジェクト: phppirate/Confirmer
        <?php 
$pages = get_original_pages(pirate_auth_current_user('id'));
while ($spage = mysqli_fetch_array($pages)) {
    $page = get_latest_page($spage['id']);
    if ((pirate_auth_current_user('rank') != 'user' || $page['visibility'] == 'public') && $page['state'] != 'draft') {
        ?>
                <tr>
                    <td><a href="viewpage.php?id=<?php 
        echo $page['id'];
        ?>
"><?php 
        echo $page['title'];
        ?>
</a></td>
                    <td><?php 
        echo pirate_auth_get_user_by_id($page['author_id'])['first_name'] . " " . pirate_auth_get_user_by_id($page['author_id'])['last_name'];
        ?>
</td>
                    <td><?php 
        echo $page['date_created'];
        ?>
</td>
                    <td class="hidden-xs"><?php 
        echo $page['requires_confirmation'];
        ?>
</td>
                    <td class="hidden-xs"><?php 
        echo user_has_confirmed(pirate_auth_current_user('id'), $page['id']);
        ?>
</td>
                    <td><?php 
コード例 #4
0
ファイル: edituser.php プロジェクト: phppirate/Confirmer
        }
        if ($password != "" && $cpassword != "" && $password == $cpassword) {
            $hashed_password = md5($password);
        }
        $sql = "UPDATE users SET first_name = '{$first_name}', last_name = '{$last_name}', username = '******', email = '{$email}', hashed_password = '******', rank = '{$rank}' WHERE id = '{$user['id']}' LIMIT 1";
        if ($result = mysqli_query($connection, $sql)) {
            redirect_to("viewuser.php?user="******"container">
        <div class="col-sm-4 col-sm-offset-4">
            <h1 class="page-header">Edit User</h1>

            <form action="edituser.php" method="post">
                <div class="form-group">
                    <label for="name">Name</label>
                    <input class="form-control" id="name" name="name" value="<?php 
echo $user['first_name'] . " " . $user['last_name'];
?>
" type="text"/>
コード例 #5
0
ファイル: functions.php プロジェクト: phppirate/Confirmer
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();
    }
}