-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin.php
More file actions
37 lines (30 loc) · 962 Bytes
/
admin.php
File metadata and controls
37 lines (30 loc) · 962 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
/**
* Created by PhpStorm.
* User: lmironne
* Date: 07/08/18
* Time: 17:02
*/
require('tools/bootstrap.php');
require('models/admin.class.php');
$isLogged = false;
$isAdmin = false;
$playerName = "";
if (isset($_SESSION['accountId']) && !empty($_SESSION['accountId'])) {
$accountId = intval($_SESSION['accountId']);
$isAdmin = isAccountAdmin($db, $accountId);
$isLogged = true;
$playerName = getPlayerTagByAccountId($db, $accountId)['name'];
}
if (!$isAdmin)
header("Location: /login");
$admin = new Admin();
$admin->setPlayerPauses();
MVCEngine::addScript("main");
MVCEngine::setTitle('Administration');
MVCEngine::assign('pauses', $admin->getPlayerPauses());
MVCEngine::assign('isAdmin', $isAdmin);
MVCEngine::assign('isLogged', $isLogged);
MVCEngine::assign('playerName', $playerName);
MVCEngine::render();
//TODO ajouter/calculer les status de stats de guerre pour les afficher ici directement, avoir une meilleure liste