示例#1
0
                        <li><a href="<?php 
echo slink('user', 'viewcategories');
?>
" class="button tiny">Go to Forum</a></li>
                        <li><a href="<?php 
echo slink('user', 'viewsettings');
?>
" class="button tiny">Settings</a></li>
                        <li><a href="<?php 
echo slink('user', 'logout');
?>
" class="button tiny alert">Logoff</a></li>
                    </ul>
                    <div>
                        <?php 
echo 'Logged in with username ' . ucfirst($user->username);
?>
                        <?php 
echo 'as an ' . showRole($user->role);
?>
                    </div>
                </div>
                <h1>Forums</h1>
                <hr/>
            </div>
    </div> 
        
        
        
        
示例#2
0
                <thead>
                    <tr>
                        <th>Username</th>
                        <th>Role</th>
                        <th>Status</th>
                        <th></th>
                    </tr>
                </thead>
                <tbody>
                    <?php 
foreach ($data as $rows) {
    // Don't show disabled users
    if ($rows['disabled'] != 1) {
        echo '<tr>';
        echo '<td>' . h($rows['username']) . '</td>';
        echo '<td>' . showRole($rows['role']) . '</td>';
        echo '<td>' . intToImg($rows['is_active']) . '</td>';
        echo '<td>' . '<a href="' . BASE_URL . 'index.php?c=user&a=edituser&id=' . $rows['id'] . '"><img src="' . BASE_URL . 'img/edit.png' . '" width="20" height="20" alt="Edit"/></a></td>';
        echo '</tr>';
    }
}
?>
                </tbody>
            </table>
            <?php 
if ($pagination->total_pages() > 1) {
    // If there is more than 1 page, show pagination
    echo '<div class="pagination">';
    echo '<ul class="pagination">';
    if ($pagination->has_previous_page()) {
        // If there is a previous page show back arrow
示例#3
0
                <label for="username">Username</label>
                <input type='text' name='username' value='<?php 
echo $edituser->username;
?>
' disabled="disabled" id="username"/>
                
                <form action="index.php" method="POST">
                    <input type='hidden' name='c' value='user' />
                    <input type='hidden' name='a' value='adminchangerole' />
                    <input type='hidden' name='id' value='<?php 
echo $edituser->id;
?>
' />
                <label for="role"><span data-tooltip aria-haspopup="true" class="has-tip" title="Change the role of this user">Role</span></label>
                <input type='text' name='role' value='<?php 
echo showRole($edituser->role);
?>
' disabled="disabled"/>
                
                <select name="role" id="role">
                    <option value="1">Administrator</option>
                    <option value="2">Moderator</option>
                    <option value="3" selected>User</option>
                </select>
                    <input class="tiny button" type="submit" value="Set" name="submit" />
                </form>
                
                <form data-abide action="index.php" method="POST">
                    <input type='hidden' name='c' value='user' />
                    <input type='hidden' name='a' value='adminchangeemail' />
                    <input type='hidden' name='id' value='<?php 
示例#4
0
function processRole($action, $id, $name, $description)
{
    if ($action == 'showoption') {
        $roleOpt = roleOption($id);
        echo $roleOpt;
        return;
    }
    if ($action == 'show' || $action == 'add') {
        $roleDetail = showRole($action, $id);
        echo json_encode(array('form' => $roleDetail));
        return;
    }
    $show_id = updateRole($action, $id, $name, $description);
    if ($action == 'update' || $action == 'addnew') {
        $roleDetail = showRole('show', $show_id);
        $roleOpt = roleOption($show_id);
        $rt = array('form' => $roleDetail, 'Opt' => $roleOpt, 'msg' => 'Role added/updated');
        echo json_encode($rt);
        return;
    }
    if ($action == 'delete') {
        if (isset($show_id)) {
            $rt['msg'] = $show_id;
            echo json_encode($rt);
            return;
        }
        $roleOpt = roleOption(0);
        $rt = array('form' => '', 'Opt' => $roleOpt, 'msg' => 'Role deleted');
        echo json_encode($rt);
        return;
    }
}
示例#5
0
<div class="row">
        <div class="medium-4 columns" id="space">&nbsp;</div>
        <div class="medium-4 columns">
            <fieldset>
                <legend>My Account</legend>

                <label for="username"><span data-tooltip aria-haspopup="true" class="has-tip" title="You cannot change your username">Username</span></label>
                <input type='text' name='username' value='<?php 
echo ucfirst($user->username);
?>
' disabled="disabled" id="username"/>
                
                <label for="role"><span data-tooltip aria-haspopup="true" class="has-tip" title="Only an admin can change your role">Role</span></label>
                <input type='text' name='role' value='<?php 
echo showRole($user->role);
?>
' disabled="disabled" id="role"/>
                
                <form data-abide action="index.php" method="POST">
                    <input type='hidden' name='c' value='user' />
                    <input type='hidden' name='a' value='userchangeemail' />
                <div class="email-field">
                    <label for="email"><span data-tooltip aria-haspopup="true" class="has-tip" title="Enter new e-mail address and click change">Email</span> <small>required</small>
                        <input type="email" name="email" size="30" value="<?php 
echo $user->email;
?>
" id="email" required />
                    </label>
                    <small class="error">An email address is required.</small>
                </div>
                    <input class="button tiny" type="submit" value="Change" name="submit" />