-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindexMain.class.php
More file actions
49 lines (37 loc) · 1.09 KB
/
indexMain.class.php
File metadata and controls
49 lines (37 loc) · 1.09 KB
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
<?php
class indexMain{
function __construct()
{
$this->session=new session();
$this->smarty=new Smarty();
$this->smarty->setCompileDir("compile");
$this->smarty->setTemplateDir("template");
if($this->session->get("user_login")&&!empty(MVC)){
$this->smarty->assign("nickname",$_SESSION["nickname"]);
$this->smarty->assign("indexUser",$_SESSION["indexUser"]);
$this->smarty->assign("uid",$_SESSION["uid"]);
}
// error_reporting(0);
}
/*
* 跳转
* */
public function jump($url,$message){
$this->smarty->assign("url",$url);
$this->smarty->assign("message",$message);
$this->smarty->display("admin/message.html");
}
/*
* 检测登陆
* */
function checkLogin(){
if(!($this->session->get("user_login")&&!empty(MVC))){
$url="index.php?m=index&f=login&a=startLogin";
$message="请登陆";
$this->jump($url,$message);
return false;
}else{
return true;
}
}
}