123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php namespace Place\Lib;
- use Dever;
- use Place;
- use Dever\Helper\Secure;
- use Dever\Route;
- class Main
- {
- protected $login = false;
- protected $entry = false;
- public function __construct()
- {
- Place::init();
- $t = Dever::input('t');
- if ($this->login && !$t) {
- $this->showLogin();
- }
- if ($t) {
- if ($t = Secure::checkLogin($t)) {
- if ($t['uid'] && $t['uid'] > 0) {
- Place::user($t['uid']);
- }
- if ($this->login && !Place::$uid) {
- $this->showLogin();
- }
- }
- }
- if ($this->entry) {
- if (Place::$info['type'] >= 2 && !Place::$uid) {
- Dever::error('您没有权限');
- }
- /*
- if (Place::$member && Place::$user['Main_type'] <= 2) {
- Dever::error('您没有权限');
- }*/
- }
- }
- protected function showLogin()
- {
- Dever::error('请先登录', 300);
- }
- }
|