Users::getCurrentUser PHP Method

getCurrentUser() public method

get current user info
public getCurrentUser ( $token )
    public function getCurrentUser($token)
    {
        $tokens = $this->factory->create('Tokens');
        $token = $tokens->getToken($token);
        $uid = $token['uid'];
        Verify::isTrue($token['uid'], new Forbidden('invalid uid ' . $uid));
        $res = $this->getUserByIds([$uid]);
        Verify::isTrue(count($res) != 0, new NotFound("user {$uid} not found"));
        return $res[0];
    }

Usage Example

Ejemplo n.º 1
0
    } else {
        echo 'noicon.png';
    }
    ?>
">
			<?php 
    echo $row['news01title'];
    ?>
				</a>
			</li>
		<?php 
}
?>
		<?php 
$objUser = new Users();
$currUser = $objUser->getCurrentUser();
//var_dump($currUser);
if ($currUser['us01us00uin'] > 100) {
    if (getREQUEST('module') == 'admin_newstype') {
        $active = 'active';
    } else {
        $active = '';
    }
    ?>
			<li class="<?php 
    echo $active;
    ?>
">
			<?php 
    echo '<a href="home.php?module=admin_newstype">';
    ?>
All Usage Examples Of Users::getCurrentUser