fixed bugs of checking config caused by

This commit is contained in:
printempw 2016-03-18 18:48:30 +08:00
parent 63ccf02f3b
commit fe94a22669
2 changed files with 4 additions and 3 deletions

View File

@ -3,7 +3,7 @@
* @Author: printempw
* @Date: 2016-02-02 21:59:06
* @Last Modified by: printempw
* @Last Modified time: 2016-03-18 18:43:11
* @Last Modified time: 2016-03-18 18:47:20
*/
namespace Database;
@ -29,7 +29,7 @@ class Database implements EncryptInterface, SyncInterface
if ($conn->connect_error)
Utils::showErrorPage($conn->connect_errno,
"无法连接至 MySQL 服务器。请确认 config.php 中的配置是否正确:".$conn->connect_error);
if (self::checkTableExist($conn))
if (!self::checkTableExist($conn))
Utils::showErrorPage(-1, "数据库中不存在 ".DB_PREFIX."users 或 ".DB_PREFIX."options 表。请先运行 /admin/install.php 进行安装。");
if (!is_dir(BASE_DIR."/textures/"))
Utils::showErrorPage(-1, "textures 文件夹不存在。请先运行 /admin/install.php 进行安装,或者手动放置一个。");

View File

@ -3,11 +3,12 @@
* @Author: prpr
* @Date: 2016-02-06 23:18:49
* @Last Modified by: printempw
* @Last Modified time: 2016-03-18 17:46:22
* @Last Modified time: 2016-03-18 18:45:48
*/
session_start();
$dir = dirname(dirname(__FILE__));
require "$dir/includes/autoloader.php";
Database\Database::checkConfig();
if(isset($_COOKIE['uname']) && isset($_COOKIE['token'])) {
$_SESSION['uname'] = $_COOKIE['uname'];