浏览代码

修复注册成功后登录状态未变更的BUG
优化安装脚本跳转

Karson 4 年之前
父节点
当前提交
8058ba312b
共有 3 个文件被更改,包括 10 次插入7 次删除
  1. 3 0
      application/common/library/Auth.php
  2. 4 4
      public/admin.php
  3. 3 3
      public/index.php

+ 3 - 0
application/common/library/Auth.php

@@ -179,6 +179,9 @@ class Auth
             $this->_token = Random::uuid();
             Token::set($this->_token, $user->id, $this->keeptime);
 
+            //设置登录状态
+            $this->_logined = true;
+
             //注册成功的事件
             Hook::listen("user_register_successed", $this->_user, $data);
             Db::commit();

+ 4 - 4
public/admin.php

@@ -11,14 +11,14 @@
 // +----------------------------------------------------------------------
 // [ 后台入口文件 ]
 // 使用此文件可以达到隐藏admin模块的效果
-// 建议将admin.php改成其它任意的文件名,同时修改config.php中的'deny_module_list',把admin模块也添加进去
+// 为了你的安全,强烈不建议将此文件名修改成admin.php
 // 定义应用目录
 define('APP_PATH', __DIR__ . '/../application/');
 
 // 判断是否安装
-if (!is_file(APP_PATH . 'admin/command/Install/install.lock'))
-{
-    header("location:./install.php");
+if (!is_file(APP_PATH . 'admin/command/Install/install.lock')) {
+    $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
+    header("Location: {$_SERVER['REQUEST_SCHEME']}://{$_SERVER['HTTP_HOST']}{$uri}/install.php");
     exit;
 }
 

+ 3 - 3
public/index.php

@@ -14,9 +14,9 @@
 define('APP_PATH', __DIR__ . '/../application/');
 
 // 判断是否安装
-if (!is_file(APP_PATH . 'admin/command/Install/install.lock'))
-{
-    header("location:./install.php");
+if (!is_file(APP_PATH . 'admin/command/Install/install.lock')) {
+    $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
+    header("Location: {$_SERVER['REQUEST_SCHEME']}://{$_SERVER['HTTP_HOST']}{$uri}/install.php");
     exit;
 }