From f86f713679ff61bb7687b13f4051813b424f79bd Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Fri, 28 Aug 2020 13:20:47 +0800 Subject: [PATCH] CN 21Vianet client_id&secret expire, temp_dir --- common.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/common.php b/common.php index 73388ce..289e031 100644 --- a/common.php +++ b/common.php @@ -568,8 +568,10 @@ function filecache() { $dir = sys_get_temp_dir(); if (!is_writable($dir)) { - if ( is_writable(__DIR__ . '/tmp/') ) $dir = __DIR__ . '/tmp/'; - if ( mkdir(__DIR__ . '/tmp/', 0777) ) $dir = __DIR__ . '/tmp/'; + $tmp = __DIR__ . '/tmp/'; + if (file_exists($tmp)) { + if ( is_writable($tmp) ) $dir = $tmp; + } elseif ( mkdir($tmp) ) $dir = $tmp; } $tag = __DIR__ . '/OneManager/' . $_SERVER['disktag']; while (strpos($tag, '/')>-1) $tag = str_replace('/', '_', $tag); @@ -613,10 +615,10 @@ function config_oauth() if (getConfig('Drive_ver')=='CN') { // CN 21Vianet // https://portal.azure.cn - $_SERVER['client_id'] = '04c3ca0b-8d07-4773-85ad-98b037d25631'; - $_SERVER['client_secret'] = 'h8@B7kFVOmj0+8HKBWeNTgl@pU/z4yLB'; - //$_SERVER['client_id'] = 'b15f63f5-8b72-48b5-af69-8cab7579bff7'; - //$_SERVER['client_secret'] = '0IIuZ1Kcq_YI3NrkZFwsniEo~BoP~8_M22'; + //$_SERVER['client_id'] = '04c3ca0b-8d07-4773-85ad-98b037d25631'; + //$_SERVER['client_secret'] = 'h8@B7kFVOmj0+8HKBWeNTgl@pU/z4yLB'; // expire 20200902 + $_SERVER['client_id'] = 'b15f63f5-8b72-48b5-af69-8cab7579bff7'; + $_SERVER['client_secret'] = '0IIuZ1Kcq_YI3NrkZFwsniEo~BoP~8_M22'; $_SERVER['oauth_url'] = 'https://login.partner.microsoftonline.cn/common/oauth2/v2.0/'; $_SERVER['api_url'] = 'https://microsoftgraph.chinacloudapi.cn/v1.0/me/drive/root'; $_SERVER['scope'] = 'https://microsoftgraph.chinacloudapi.cn/Files.ReadWrite.All offline_access';