-
Notifications
You must be signed in to change notification settings - Fork 83
/
Copy pathmaster.php
executable file
·53 lines (49 loc) · 1.78 KB
/
master.php
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/*
* This file is part of the phpems/phpems.
*
* (c) oiuv <[email protected]>
*
* 项目维护:oiuv(QQ:7300637) | 定制服务:火眼(QQ:278768688)
*
* This source file is subject to the MIT license that is bundled.
*/
class app
{
public $G;
public $_user;
public function __construct(&$G)
{
$this->G = $G;
$this->ev = $this->G->make('ev');
$this->session = $this->G->make('session');
$this->tpl = $this->G->make('tpl');
$this->sql = $this->G->make('sql');
$this->pdosql = $this->G->make('pdosql');
$this->db = $this->G->make('pepdo');
$this->apps = $this->G->make('apps', 'core');
$this->user = $this->G->make('user', 'user');
$this->_user = $_user = $this->session->getSessionUser();
$group = $this->user->getGroupById($_user['sessiongroupid']);
if (1 != $group['groupid'] && 'login' != $this->ev->url(2)) {
if ($this->ev->get('userhash')) {
exit(json_encode([
'statusCode' => 300,
'message' => '请您重新登录',
'callbackType' => 'forward',
'forwardUrl' => 'index.php?core-master-login',
]));
}
header('location:index.php?core-master-login');
exit;
}
$user = $this->user->getUserById($_user['sessionuserid']);
$user['manager_apps'] = unserialize($user['manager_apps']);
$this->tpl->assign('_user', $user);
$this->tpl->assign('action', $this->ev->url(2) ? $this->ev->url(2) : 'user');
$localapps = $this->apps->getLocalAppList();
$apps = $this->apps->getAppList();
$this->tpl->assign('localapps', $localapps);
$this->tpl->assign('apps', $apps);
}
}