diff --git a/admin/admin_ajax.php b/admin/admin_ajax.php
index 640dcb55..e63c3392 100644
--- a/admin/admin_ajax.php
+++ b/admin/admin_ajax.php
@@ -3,7 +3,7 @@
* @Author: printempw
* @Date: 2016-02-04 13:53:55
* @Last Modified by: printempw
- * @Last Modified time: 2016-03-26 18:47:48
+ * @Last Modified time: 2016-03-26 22:28:22
*/
require "../libraries/session.inc.php";
@@ -67,7 +67,7 @@ if (isset($_GET['action'])) {
} else if ($action == "color") {
if (isset($_POST['color_scheme'])) {
$color_scheme = str_replace('_', '-', $_POST['color_scheme']);
- Config::set('color_scheme', $color_scheme);
+ Option::set('color_scheme', $color_scheme);
$json['errno'] = 0;
$json['msg'] = "修改配色成功。";
} else {
diff --git a/admin/customize.php b/admin/customize.php
index c1944e6c..b8fc6bdb 100644
--- a/admin/customize.php
+++ b/admin/customize.php
@@ -3,7 +3,7 @@
* @Author: printempw
* @Date: 2016-03-19 14:34:21
* @Last Modified by: printempw
- * @Last Modified time: 2016-03-26 21:44:27
+ * @Last Modified time: 2016-03-26 22:28:23
*/
require "../libraries/session.inc.php";
if (!$user->is_admin) header('Location: ../index.php?msg=看起来你并不是管理员');
@@ -108,7 +108,7 @@ $db = new Database\Database();
设置已保存。
';
} ?>
@@ -116,7 +116,7 @@ $db = new Database\Database();
| 首页图片地址 |
-
+
|
@@ -135,7 +135,7 @@ $db = new Database\Database();
// Skin switcher
diff --git a/admin/options.php b/admin/options.php
index 7ae0bb58..b55d59d5 100644
--- a/admin/options.php
+++ b/admin/options.php
@@ -3,7 +3,7 @@
* @Author: printempw
* @Date: 2016-03-18 22:50:25
* @Last Modified by: printempw
- * @Last Modified time: 2016-03-26 18:47:49
+ * @Last Modified time: 2016-03-26 22:28:23
*/
require "../libraries/session.inc.php";
if (!$user->is_admin) header('Location: ../index.php?msg=看起来你并不是管理员');
@@ -37,7 +37,7 @@ $db = new Database\Database();
if (!isset($_POST['user_can_register'])) $_POST['user_can_register'] = '0';
foreach ($_POST as $key => $value) {
if ($key != "option" && $key != "submit") {
- Config::set($key, $value);
+ Option::set($key, $value);
// echo $key."=".$value."
";
}
}
@@ -48,48 +48,48 @@ $db = new Database\Database();
| 站点标题 |
-
+
|
| 站点描述 |
-
+
|
| 站点地址(URL) |
-
+
|
| 开放注册 |
|
| 每个 IP 限制注册数 |
-
+
|
| 首选 JSON API |
|
| 站点公告 |
-
+
|
@@ -114,7 +114,7 @@ $db = new Database\Database();
if (isset($_POST['option']) && ($_POST['option'] == "adapter")) {
foreach ($_POST as $key => $value) {
if ($key != "option" && $key != "submit") {
- Config::set($key, $value);
+ Option::set($key, $value);
//echo $key."=".$value."
";
}
}
@@ -128,35 +128,35 @@ $db = new Database\Database();
数据对接适配器 |
|
| 对接数据表名 |
-
+
|
| 对接数据表用户名字段 |
-
+
|
| 对接数据表密码字段 |
-
+
|
| 对接数据表 IP 字段 |
-
+
|
diff --git a/ajax.php b/ajax.php
index 23902156..97f8ecf9 100644
--- a/ajax.php
+++ b/ajax.php
@@ -3,7 +3,7 @@
* @Author: printempw
* @Date: 2016-01-16 23:01:33
* @Last Modified by: printempw
- * @Last Modified time: 2016-03-26 22:01:59
+ * @Last Modified time: 2016-03-26 22:28:22
*
* - login, register, logout
* - upload, change, delete
@@ -55,7 +55,7 @@ if ($action == "login") {
} else if ($action == "register") {
if (checkPost('register')) {
if (!$user->is_registered) {
- if (Config::get('user_can_register') == 1) {
+ if (Option::get('user_can_register') == 1) {
if (User::checkValidPwd($_POST['passwd'])) {
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
$ip = $_SERVER['HTTP_CLIENT_IP'];
@@ -66,7 +66,7 @@ if ($action == "login") {
}
// If amount of registered accounts of IP is more than allowed mounts,
// then reject the registration.
- if ($user->db->getNumRows('ip', $ip) < Config::get('regs_per_ip')) {
+ if ($user->db->getNumRows('ip', $ip) < Option::get('regs_per_ip')) {
// use once md5 to encrypt password
if ($user->register($_POST['passwd'], $ip)) {
$json['errno'] = 0;
@@ -77,7 +77,7 @@ if ($action == "login") {
}
} else {
$json['errno'] = 1;
- $json['msg'] = "你最多只能注册 ".Config::get('regs_per_ip')." 个账户哦";
+ $json['msg'] = "你最多只能注册 ".Option::get('regs_per_ip')." 个账户哦";
}
}
} else {
diff --git a/get.php b/get.php
index 14561ee8..3a3920b4 100644
--- a/get.php
+++ b/get.php
@@ -3,7 +3,7 @@
* @Author: printempw
* @Date: 2016-02-02 20:56:42
* @Last Modified by: printempw
- * @Last Modified time: 2016-03-26 20:33:02
+ * @Last Modified time: 2016-03-26 22:28:22
*
* All textures requests of legacy link will be handle here.
*/
@@ -39,7 +39,7 @@ if (isset($_GET['type']) && isset($_GET['uname'])) {
if (isset($_GET['api'])) {
echo $user->getJsonProfile(($_GET['api'] == 'csl') ? 0 : 1);
} else {
- echo $user->getJsonProfile(Config::get('api_type'));
+ echo $user->getJsonProfile(Option::get('api_type'));
}
} else if ($_GET['type'] == "avatar") {
$size = (isset($_GET['size']) && $_GET['size'] != "") ? (int)$_GET['size'] : 128;
diff --git a/index.php b/index.php
index 48224e39..d091e130 100755
--- a/index.php
+++ b/index.php
@@ -3,7 +3,7 @@
* @Author: printempw
* @Date: 2016-01-17 13:55:20
* @Last Modified by: printempw
- * @Last Modified time: 2016-03-26 18:47:48
+ * @Last Modified time: 2016-03-26 22:28:22
*/
session_start();
$dir = dirname(__FILE__);
@@ -24,7 +24,7 @@ if (isset($_COOKIE['uname']) && isset($_COOKIE['token'])) {
-
+
@@ -35,7 +35,7 @@ if (isset($_COOKIE['uname']) && isset($_COOKIE['token'])) {
@@ -43,8 +43,8 @@ if (isset($_COOKIE['uname']) && isset($_COOKIE['token'])) {