/**
 * Get page where user should be redirected, based on user's role.
 * If there is no specific page set for provided role, redirect to default page.
 *
 * @return string Page where user should be redirected.
 */
function get_redirect_page()
{
    $login = new ASLogin();
    if ($login->isLoggedIn()) {
        $user = new ASUser(ASSession::get("user_id"));
        $role = $user->getRole();
    } else {
        $role = 'default';
    }
    $redirect = unserialize(SUCCESS_LOGIN_REDIRECT);
    if (!isset($redirect['default'])) {
        $redirect['default'] = 'index.php';
    }
    return isset($redirect[$role]) ? $redirect[$role] : $redirect['default'];
}
Пример #2
0
echo ASLang::get('my_profile');
?>
                                        </a>
                                    </li>
                                    
                                    <li>
                                        <a href="admin/logout.php" id="logout">
                                            <i class="icon-off glyphicon glyphicon-off"></i> 
                                            <?php 
echo ASLang::get('logout');
?>
                                        </a>
                                    </li>

<?php 
if ($user->getRole() != 'user') {
    ?>
<li class="divider"></li>

            <li><a id="ext" href="/Fed/Production/data/add/candidate.php" data-toggle="modal" data-target="#myModal">Update Federal Officials</a></li>
            <li><a id="ext" href="/Fed/Production/data/add/address_cand.php" data-toggle="modal" data-target="#myModal">Update Bio Addresses</a></li>
			<li class="divider"></li>
            <li><a id="ext" href="/Fed/Production/data/add/address_senate.php" data-toggle="modal" data-target="#myModal">Update Senate Addresses</a></li>
            <li><a id="ext" href="/Fed/Production/data/add/address_house.php" data-toggle="modal" data-target="#myModal">Update House Addresses</a></li>
			<li class="divider"></li>
            <li><a id="ext" href="/Fed/Production/data/add/bio.php" data-toggle="modal" data-target="#myModal">Update Official Bio's</a></li>
		    <li><a id="ext" href="/Fed/Production/data/add/webaddress.php" data-toggle="modal" data-target="#myModal">Update Social Links</a></li>
			<li><a id="ext" href="/Fed/Production/data/add/committee.php" data-toggle="modal" data-target="#myModal">Update Committee Info</a></li>
			<li><a id="ext" href="/Fed/Production/data/add/npat.php" data-toggle="modal" data-target="#myModal">Update NPAT Info</a></li>
            <li class="divider"></li>
            <li><a id="ext" href="/Fed/Production/data/purge/purge_candidate.php" data-toggle="modal" data-target="#myModal">Purge Officials Data</a></li>
Пример #3
0
echo ASLang::get('confirmed');
?>
</th>
                  <th><?php 
echo ASLang::get('action');
?>
</th>
                  </thead>
                  <?php 
foreach ($users as $user) {
    ?>
                      <?php 
    $tmpUser = new ASUser($user['user_id']);
    ?>
                      <?php 
    $userRole = $tmpUser->getRole();
    ?>
                      <tr class="user-row">
                          <td><?php 
    echo htmlentities($user['username']);
    ?>
</td>
                          <td><?php 
    echo htmlentities($user['email']);
    ?>
</td>
                          <td><?php 
    echo $user['register_date'];
    ?>
</td>
<!--                          <td>--><?php