From 2d83d1f27f24d2f3c7570cedbd535788b6cee712 Mon Sep 17 00:00:00 2001
From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com>
Date: Thu, 2 Jan 2020 18:23:31 +0800
Subject: [PATCH] Update functions.php
---
functions.php | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/functions.php b/functions.php
index e3557de..d44e9ef 100644
--- a/functions.php
+++ b/functions.php
@@ -249,7 +249,6 @@ function get_refresh_token()
// echo $_POST['Onedrive_ver'];
if ($_POST['Onedrive_ver']=='MS' || $_POST['Onedrive_ver']=='CN' || $_POST['Onedrive_ver']=='MSC') {
$tmp['Onedrive_ver'] = $_POST['Onedrive_ver'];
- $tmp['language'] = $_COOKIE['language'];
if ($_POST['Onedrive_ver']=='MSC') {
$tmp['client_id'] = $_POST['client_id'];
$tmp['client_secret'] = $_POST['client_secret'];
@@ -258,15 +257,20 @@ function get_refresh_token()
$title = $constStr['MayinEnv'][$constStr['language']];
$html = $constStr['Wait'][$constStr['language']] . ' 3s';
if (!$response) {
- $html = $response . '
+ $html = $response . '
Can not write config to file.
';
- $title = 'Error';
+ $title = 'Error';
}
return message($html, $title, 201);
}
}
if ($_GET['install0']) {
+ if ($_POST['admin']!='') {
+ $tmp['admin'] = $_POST['admin'];
+ $tmp['language'] = $_POST['language'];
+ $response = setConfig($tmp);
+ if ($response) {
if ($constStr['language']!='zh-cn') {
$linklang='en-us';
} else $linklang='zh-cn';
@@ -288,10 +292,18 @@ Can not write config to file.
';
$title = 'Install';
+ } else {
+ $html = $response . '
+Can not write config to file.
+';
+ $title = 'Error';
+ }
return message($html, $title, 201);
+ }
}
$html .= '