Example #1
0
<?php

require_once '../config/init.php';
if (!Authentication::IsLogged()) {
    header("Location: ../index.php");
}
$user = Session::Get('current_user');
if (!$user->IsAdmin()) {
    header("Location: ../index.php");
} else {
    define("ADMIN", 1);
}
?>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<script type="text/javascript"> var PLS_config = {	ajax_url : '<?php 
echo Config::Get('base_url') . 'auth/ajax.php';
?>
',};</script>
		<script type="text/javascript" src="../assets/js/jquery-1.11.0.min.js"></script>
		<script type="text/javascript" src="../assets/js/premiumlogin.min.js"></script>
	</head>
	<body style="text-align:center;width:30%;margin:auto;">
		<img class="avatar" src="<?php 
echo $user->GetAvatar();
?>
" style="height:30px;">
		<span class="username"><?php 
Example #2
0
 static function GetUsers()
 {
     if (Authentication::IsLogged()) {
         $id = Session::Get('current_user')->Get('id');
     }
     $db = new Database();
     $users = array();
     $db->Select();
     if (isset($id)) {
         $db->Where('id', $id, '!=');
     }
     $result = $db->Get(Config::Get('db.table'));
     if ($result) {
         foreach ($result as $value) {
             $users[] = new User($value);
         }
         return $users;
     }
     return false;
 }