commit
						5b492418fc
					
				| 
						 | 
					@ -1,6 +1,22 @@
 | 
				
			||||||
<?php
 | 
					<?php
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$commonEnv = [
 | 
					$CommonEnv = [
 | 
				
			||||||
 | 
					    'APIKey', // used in heroku.
 | 
				
			||||||
 | 
					    'Region', // used in SCF.
 | 
				
			||||||
 | 
					    'SecretId', // used in SCF.
 | 
				
			||||||
 | 
					    'SecretKey', // used in SCF.
 | 
				
			||||||
 | 
					    'admin',
 | 
				
			||||||
 | 
					    'adminloginpage',
 | 
				
			||||||
 | 
					    'background',
 | 
				
			||||||
 | 
					    'disktag',
 | 
				
			||||||
 | 
					    'function_name', // used in heroku.
 | 
				
			||||||
 | 
					    'language',
 | 
				
			||||||
 | 
					    'passfile',
 | 
				
			||||||
 | 
					    'sitename',
 | 
				
			||||||
 | 
					    'theme',
 | 
				
			||||||
 | 
					];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					$ShowedCommonEnv = [
 | 
				
			||||||
    //'APIKey', // used in heroku.
 | 
					    //'APIKey', // used in heroku.
 | 
				
			||||||
    //'Region', // used in SCF.
 | 
					    //'Region', // used in SCF.
 | 
				
			||||||
    //'SecretId', // used in SCF.
 | 
					    //'SecretId', // used in SCF.
 | 
				
			||||||
| 
						 | 
					@ -16,7 +32,7 @@ $commonEnv = [
 | 
				
			||||||
    'theme',
 | 
					    'theme',
 | 
				
			||||||
];
 | 
					];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$innerEnv = [
 | 
					$InnerEnv = [
 | 
				
			||||||
    'Onedrive_ver',
 | 
					    'Onedrive_ver',
 | 
				
			||||||
    'client_id',
 | 
					    'client_id',
 | 
				
			||||||
    'client_secret',
 | 
					    'client_secret',
 | 
				
			||||||
| 
						 | 
					@ -28,7 +44,7 @@ $innerEnv = [
 | 
				
			||||||
    'token_expires',
 | 
					    'token_expires',
 | 
				
			||||||
];
 | 
					];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$ShowedinnerEnv = [
 | 
					$ShowedInnerEnv = [
 | 
				
			||||||
    //'Onedrive_ver',
 | 
					    //'Onedrive_ver',
 | 
				
			||||||
    //'client_id',
 | 
					    //'client_id',
 | 
				
			||||||
    //'client_secret',
 | 
					    //'client_secret',
 | 
				
			||||||
| 
						 | 
					@ -417,8 +433,8 @@ function bigfileupload($path)
 | 
				
			||||||
        //echo json_encode($getoldupinfo, JSON_PRETTY_PRINT);
 | 
					        //echo json_encode($getoldupinfo, JSON_PRETTY_PRINT);
 | 
				
			||||||
        if (isset($getoldupinfo['file'])&&$getoldupinfo['size']<5120) {
 | 
					        if (isset($getoldupinfo['file'])&&$getoldupinfo['size']<5120) {
 | 
				
			||||||
            $getoldupinfo_j = curl_request($getoldupinfo['@microsoft.graph.downloadUrl']);
 | 
					            $getoldupinfo_j = curl_request($getoldupinfo['@microsoft.graph.downloadUrl']);
 | 
				
			||||||
            $getoldupinfo = json_decode($getoldupinfo_j , true);
 | 
					            $getoldupinfo = json_decode($getoldupinfo_j['body'], true);
 | 
				
			||||||
            if ( json_decode( curl_request($getoldupinfo['uploadUrl']), true)['@odata.context']!='' ) return output($getoldupinfo_j);
 | 
					            if ( json_decode( curl_request($getoldupinfo['uploadUrl'])['body'], true)['@odata.context']!='' ) return output($getoldupinfo_j['body'], $getoldupinfo_j['stat']);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (!$_SERVER['admin']) $filename = spurlencode( $fileinfo['name'] ) . '.scfupload';
 | 
					        if (!$_SERVER['admin']) $filename = spurlencode( $fileinfo['name'] ) . '.scfupload';
 | 
				
			||||||
        $response=MSAPI('createUploadSession',path_format($path1 . '/' . $filename),'{"item": { "@microsoft.graph.conflictBehavior": "fail"  }}',$_SERVER['access_token']);
 | 
					        $response=MSAPI('createUploadSession',path_format($path1 . '/' . $filename),'{"item": { "@microsoft.graph.conflictBehavior": "fail"  }}',$_SERVER['access_token']);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -39,9 +39,9 @@ function getGET()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function getConfig($str, $disktag = '')
 | 
					function getConfig($str, $disktag = '')
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    global $innerEnv;
 | 
					    global $InnerEnv;
 | 
				
			||||||
    if ($disktag=='') $disktag = $_SERVER['disktag'];
 | 
					    if ($disktag=='') $disktag = $_SERVER['disktag'];
 | 
				
			||||||
    if (in_array($str, $innerEnv)) {
 | 
					    if (in_array($str, $InnerEnv)) {
 | 
				
			||||||
        return json_decode(getenv($disktag), true)[$str];
 | 
					        return json_decode(getenv($disktag), true)[$str];
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    return getenv($str);
 | 
					    return getenv($str);
 | 
				
			||||||
| 
						 | 
					@ -49,7 +49,7 @@ function getConfig($str, $disktag = '')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function setConfig($arr, $disktag = '')
 | 
					function setConfig($arr, $disktag = '')
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    global $innerEnv;
 | 
					    global $InnerEnv;
 | 
				
			||||||
    if ($disktag=='') $disktag = $_SERVER['disktag'];
 | 
					    if ($disktag=='') $disktag = $_SERVER['disktag'];
 | 
				
			||||||
    $disktags = explode("|",getConfig('disktag'));
 | 
					    $disktags = explode("|",getConfig('disktag'));
 | 
				
			||||||
    $diskconfig = json_decode(getenv($disktag), true);
 | 
					    $diskconfig = json_decode(getenv($disktag), true);
 | 
				
			||||||
| 
						 | 
					@ -57,7 +57,7 @@ function setConfig($arr, $disktag = '')
 | 
				
			||||||
    $indisk = 0;
 | 
					    $indisk = 0;
 | 
				
			||||||
    $oparetdisk = 0;
 | 
					    $oparetdisk = 0;
 | 
				
			||||||
    foreach ($arr as $k => $v) {
 | 
					    foreach ($arr as $k => $v) {
 | 
				
			||||||
        if (in_array($k, $innerEnv)) {
 | 
					        if (in_array($k, $InnerEnv)) {
 | 
				
			||||||
            $diskconfig[$k] = $v;
 | 
					            $diskconfig[$k] = $v;
 | 
				
			||||||
            $indisk = 1;
 | 
					            $indisk = 1;
 | 
				
			||||||
        } elseif ($k=='disktag_add') {
 | 
					        } elseif ($k=='disktag_add') {
 | 
				
			||||||
| 
						 | 
					@ -90,6 +90,8 @@ function setConfig($arr, $disktag = '')
 | 
				
			||||||
function get_refresh_token()
 | 
					function get_refresh_token()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    global $constStr;
 | 
					    global $constStr;
 | 
				
			||||||
 | 
					    global $CommonEnv;
 | 
				
			||||||
 | 
					    foreach ($CommonEnv as $env) $envs .= '\'' . $env . '\', ';
 | 
				
			||||||
    $url = path_format($_SERVER['PHP_SELF'] . '/');
 | 
					    $url = path_format($_SERVER['PHP_SELF'] . '/');
 | 
				
			||||||
    if ($_GET['authorization_code'] && isset($_GET['code'])) {
 | 
					    if ($_GET['authorization_code'] && isset($_GET['code'])) {
 | 
				
			||||||
        $_SERVER['disktag'] = $_COOKIE['disktag'];
 | 
					        $_SERVER['disktag'] = $_COOKIE['disktag'];
 | 
				
			||||||
| 
						 | 
					@ -147,6 +149,9 @@ function get_refresh_token()
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if ($_GET['install0']) {
 | 
					    if ($_GET['install0']) {
 | 
				
			||||||
        if ($_POST['disktag_add']!='' && ($_POST['Onedrive_ver']=='MS' || $_POST['Onedrive_ver']=='CN' || $_POST['Onedrive_ver']=='MSC')) {
 | 
					        if ($_POST['disktag_add']!='' && ($_POST['Onedrive_ver']=='MS' || $_POST['Onedrive_ver']=='CN' || $_POST['Onedrive_ver']=='MSC')) {
 | 
				
			||||||
 | 
					            if (in_array($_COOKIE['disktag'], $CommonEnv)) {
 | 
				
			||||||
 | 
					                return message('Do not input ' . $envs . '<br><button onclick="location.href = location.href;">'.getconstStr('Reflesh').'</button><script>document.cookie=\'disktag=; path=/\';</script>', 'Error', 201);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
            $_SERVER['disktag'] = $_COOKIE['disktag'];
 | 
					            $_SERVER['disktag'] = $_COOKIE['disktag'];
 | 
				
			||||||
            $tmp['disktag_add'] = $_POST['disktag_add'];
 | 
					            $tmp['disktag_add'] = $_POST['disktag_add'];
 | 
				
			||||||
            $tmp['diskname'] = $_POST['diskname'];
 | 
					            $tmp['diskname'] = $_POST['diskname'];
 | 
				
			||||||
| 
						 | 
					@ -199,6 +204,11 @@ function_name:' . $_SERVER['function_name'] . '<br>
 | 
				
			||||||
                alert(\'Input Disk Tag\');
 | 
					                alert(\'Input Disk Tag\');
 | 
				
			||||||
                return false;
 | 
					                return false;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					            envs = [' . $envs . '];
 | 
				
			||||||
 | 
					            if (envs.indexOf(t.disktag_add.value)>-1) {
 | 
				
			||||||
 | 
					                alert("Do not input ' . $envs . '");
 | 
				
			||||||
 | 
					                return false;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
            var reg = /^[a-zA-Z]([-_a-zA-Z0-9]{1,20})$/;
 | 
					            var reg = /^[a-zA-Z]([-_a-zA-Z0-9]{1,20})$/;
 | 
				
			||||||
            if (!reg.test(t.disktag_add.value)) {
 | 
					            if (!reg.test(t.disktag_add.value)) {
 | 
				
			||||||
                alert(\''.getconstStr('TagFormatAlert').'\');
 | 
					                alert(\''.getconstStr('TagFormatAlert').'\');
 | 
				
			||||||
| 
						 | 
					@ -345,11 +355,10 @@ function updateHerokuapp($function_name, $apikey)
 | 
				
			||||||
function EnvOpt($function_name, $needUpdate = 0)
 | 
					function EnvOpt($function_name, $needUpdate = 0)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    global $constStr;
 | 
					    global $constStr;
 | 
				
			||||||
    global $commonEnv;
 | 
					    global $ShowedCommonEnv;
 | 
				
			||||||
    global $innerEnv;
 | 
					    global $ShowedInnerEnv;
 | 
				
			||||||
    global $ShowedinnerEnv;
 | 
					    asort($ShowedCommonEnv);
 | 
				
			||||||
    asort($commonEnv);
 | 
					    asort($ShowedInnerEnv);
 | 
				
			||||||
    asort($ShowedinnerEnv);
 | 
					 | 
				
			||||||
    $html = '<title>OneManager '.getconstStr('Setup').'</title>';
 | 
					    $html = '<title>OneManager '.getconstStr('Setup').'</title>';
 | 
				
			||||||
    if ($_POST['updateProgram']==getconstStr('updateProgram')) {
 | 
					    if ($_POST['updateProgram']==getconstStr('updateProgram')) {
 | 
				
			||||||
        $response = json_decode(updateHerokuapp(getConfig('function_name'), getConfig('APIKey'))['body'], true);
 | 
					        $response = json_decode(updateHerokuapp(getConfig('function_name'), getConfig('APIKey'))['body'], true);
 | 
				
			||||||
| 
						 | 
					@ -374,10 +383,10 @@ function_name:' . $_SERVER['function_name'] . '<br>
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        $_SERVER['disk_oprating'] = '';
 | 
					        $_SERVER['disk_oprating'] = '';
 | 
				
			||||||
        foreach ($_POST as $k => $v) {
 | 
					        foreach ($_POST as $k => $v) {
 | 
				
			||||||
            if (in_array($k, $commonEnv)) {
 | 
					            if (in_array($k, $ShowedCommonEnv)) {
 | 
				
			||||||
                if (!(getConfig($k)==''&&$v=='')) $tmp[$k] = $v;
 | 
					                if (!(getConfig($k)==''&&$v=='')) $tmp[$k] = $v;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            if (in_array($k, $innerEnv)||$k=='disktag_del' || $k=='disktag_add') {
 | 
					            if (in_array($k, $ShowedInnerEnv)||$k=='disktag_del' || $k=='disktag_add') {
 | 
				
			||||||
                $tmp[$k] = $v;
 | 
					                $tmp[$k] = $v;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            if ($k == 'disk') $_SERVER['disk_oprating'] = $v;
 | 
					            if ($k == 'disk') $_SERVER['disk_oprating'] = $v;
 | 
				
			||||||
| 
						 | 
					@ -425,7 +434,7 @@ function_name:' . $_SERVER['function_name'] . '<br>
 | 
				
			||||||
        <tr>
 | 
					        <tr>
 | 
				
			||||||
            <td colspan="2">'.getconstStr('PlatformConfig').'</td>
 | 
					            <td colspan="2">'.getconstStr('PlatformConfig').'</td>
 | 
				
			||||||
        </tr>';
 | 
					        </tr>';
 | 
				
			||||||
    foreach ($commonEnv as $key) {
 | 
					    foreach ($ShowedCommonEnv as $key) {
 | 
				
			||||||
        if ($key=='language') {
 | 
					        if ($key=='language') {
 | 
				
			||||||
            $html .= '
 | 
					            $html .= '
 | 
				
			||||||
        <tr>
 | 
					        <tr>
 | 
				
			||||||
| 
						 | 
					@ -494,7 +503,7 @@ function_name:' . $_SERVER['function_name'] . '<br>
 | 
				
			||||||
                $html .= '
 | 
					                $html .= '
 | 
				
			||||||
    <form name="'.$disktag.'" action="" method="post">
 | 
					    <form name="'.$disktag.'" action="" method="post">
 | 
				
			||||||
        <input type="hidden" name="disk" value="'.$disktag.'">';
 | 
					        <input type="hidden" name="disk" value="'.$disktag.'">';
 | 
				
			||||||
                foreach ($ShowedinnerEnv as $key) {
 | 
					                foreach ($ShowedInnerEnv as $key) {
 | 
				
			||||||
                    $html .= '
 | 
					                    $html .= '
 | 
				
			||||||
        <tr>
 | 
					        <tr>
 | 
				
			||||||
            <td><label>' . $key . '</label></td>
 | 
					            <td><label>' . $key . '</label></td>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -38,14 +38,14 @@ function getGET()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function getConfig($str, $disktag = '')
 | 
					function getConfig($str, $disktag = '')
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    global $innerEnv;
 | 
					    global $InnerEnv;
 | 
				
			||||||
    //include 'config.php';
 | 
					    //include 'config.php';
 | 
				
			||||||
    if ($disktag=='') $disktag = $_SERVER['disktag'];
 | 
					    if ($disktag=='') $disktag = $_SERVER['disktag'];
 | 
				
			||||||
    $s = file_get_contents('config.php');
 | 
					    $s = file_get_contents('config.php');
 | 
				
			||||||
    $configs = substr($s, 18, -2);
 | 
					    $configs = substr($s, 18, -2);
 | 
				
			||||||
    if ($configs!='') {
 | 
					    if ($configs!='') {
 | 
				
			||||||
        $envs = json_decode($configs, true);
 | 
					        $envs = json_decode($configs, true);
 | 
				
			||||||
        if (in_array($str, $innerEnv)) {
 | 
					        if (in_array($str, $InnerEnv)) {
 | 
				
			||||||
            if (isset($envs[$disktag][$str])) return $envs[$disktag][$str];
 | 
					            if (isset($envs[$disktag][$str])) return $envs[$disktag][$str];
 | 
				
			||||||
        } else if (isset($envs[$str])) return $envs[$str];
 | 
					        } else if (isset($envs[$str])) return $envs[$str];
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					@ -54,7 +54,7 @@ function getConfig($str, $disktag = '')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function setConfig($arr, $disktag = '')
 | 
					function setConfig($arr, $disktag = '')
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    global $innerEnv;
 | 
					    global $InnerEnv;
 | 
				
			||||||
    if ($disktag=='') $disktag = $_SERVER['disktag'];
 | 
					    if ($disktag=='') $disktag = $_SERVER['disktag'];
 | 
				
			||||||
    //include 'config.php';
 | 
					    //include 'config.php';
 | 
				
			||||||
    $s = file_get_contents('config.php');
 | 
					    $s = file_get_contents('config.php');
 | 
				
			||||||
| 
						 | 
					@ -64,7 +64,7 @@ function setConfig($arr, $disktag = '')
 | 
				
			||||||
    //$indisk = 0;
 | 
					    //$indisk = 0;
 | 
				
			||||||
    $operatedisk = 0;
 | 
					    $operatedisk = 0;
 | 
				
			||||||
    foreach ($arr as $k => $v) {
 | 
					    foreach ($arr as $k => $v) {
 | 
				
			||||||
        if (in_array($k, $innerEnv)) {
 | 
					        if (in_array($k, $InnerEnv)) {
 | 
				
			||||||
            $envs[$disktag][$k] = $v;
 | 
					            $envs[$disktag][$k] = $v;
 | 
				
			||||||
            /*$diskconfig[$k] = $v;
 | 
					            /*$diskconfig[$k] = $v;
 | 
				
			||||||
            $indisk = 1;*/
 | 
					            $indisk = 1;*/
 | 
				
			||||||
| 
						 | 
					@ -103,6 +103,8 @@ function setConfig($arr, $disktag = '')
 | 
				
			||||||
function get_refresh_token()
 | 
					function get_refresh_token()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    global $constStr;
 | 
					    global $constStr;
 | 
				
			||||||
 | 
					    global $CommonEnv;
 | 
				
			||||||
 | 
					    foreach ($CommonEnv as $env) $envs .= '\'' . $env . '\', ';
 | 
				
			||||||
    $url = path_format($_SERVER['PHP_SELF'] . '/');
 | 
					    $url = path_format($_SERVER['PHP_SELF'] . '/');
 | 
				
			||||||
    if ($_GET['authorization_code'] && isset($_GET['code'])) {
 | 
					    if ($_GET['authorization_code'] && isset($_GET['code'])) {
 | 
				
			||||||
        $_SERVER['disktag'] = $_COOKIE['disktag'];
 | 
					        $_SERVER['disktag'] = $_COOKIE['disktag'];
 | 
				
			||||||
| 
						 | 
					@ -160,6 +162,9 @@ function get_refresh_token()
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if ($_GET['install0']) {
 | 
					    if ($_GET['install0']) {
 | 
				
			||||||
        if ($_POST['disktag_add']!='' && ($_POST['Onedrive_ver']=='MS' || $_POST['Onedrive_ver']=='CN' || $_POST['Onedrive_ver']=='MSC')) {
 | 
					        if ($_POST['disktag_add']!='' && ($_POST['Onedrive_ver']=='MS' || $_POST['Onedrive_ver']=='CN' || $_POST['Onedrive_ver']=='MSC')) {
 | 
				
			||||||
 | 
					            if (in_array($_COOKIE['disktag'], $CommonEnv)) {
 | 
				
			||||||
 | 
					                return message('Do not input ' . $envs . '<br><button onclick="location.href = location.href;">'.getconstStr('Reflesh').'</button><script>document.cookie=\'disktag=; path=/\';</script>', 'Error', 201);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
            $_SERVER['disktag'] = $_COOKIE['disktag'];
 | 
					            $_SERVER['disktag'] = $_COOKIE['disktag'];
 | 
				
			||||||
            $tmp['disktag_add'] = $_POST['disktag_add'];
 | 
					            $tmp['disktag_add'] = $_POST['disktag_add'];
 | 
				
			||||||
            $tmp['diskname'] = $_POST['diskname'];
 | 
					            $tmp['diskname'] = $_POST['diskname'];
 | 
				
			||||||
| 
						 | 
					@ -211,6 +216,11 @@ Can not write config to file.<br>
 | 
				
			||||||
                alert(\'Input Disk Tag\');
 | 
					                alert(\'Input Disk Tag\');
 | 
				
			||||||
                return false;
 | 
					                return false;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					            envs = [' . $envs . '];
 | 
				
			||||||
 | 
					            if (envs.indexOf(t.disktag_add.value)>-1) {
 | 
				
			||||||
 | 
					                alert("Do not input ' . $envs . '");
 | 
				
			||||||
 | 
					                return false;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
            var reg = /^[a-zA-Z]([-_a-zA-Z0-9]{1,20})$/;
 | 
					            var reg = /^[a-zA-Z]([-_a-zA-Z0-9]{1,20})$/;
 | 
				
			||||||
            if (!reg.test(t.disktag_add.value)) {
 | 
					            if (!reg.test(t.disktag_add.value)) {
 | 
				
			||||||
                alert(\''.getconstStr('TagFormatAlert').'\');
 | 
					                alert(\''.getconstStr('TagFormatAlert').'\');
 | 
				
			||||||
| 
						 | 
					@ -313,11 +323,10 @@ function RewriteEngineOn()
 | 
				
			||||||
function EnvOpt($function_name, $needUpdate = 0)
 | 
					function EnvOpt($function_name, $needUpdate = 0)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    global $constStr;
 | 
					    global $constStr;
 | 
				
			||||||
    global $commonEnv;
 | 
					    global $ShowedCommonEnv;
 | 
				
			||||||
    global $innerEnv;
 | 
					    global $ShowedInnerEnv;
 | 
				
			||||||
    global $ShowedinnerEnv;
 | 
					    asort($ShowedCommonEnv);
 | 
				
			||||||
    asort($commonEnv);
 | 
					    asort($ShowedInnerEnv);
 | 
				
			||||||
    asort($ShowedinnerEnv);
 | 
					 | 
				
			||||||
    $html = '<title>OneManager '.getconstStr('Setup').'</title>';
 | 
					    $html = '<title>OneManager '.getconstStr('Setup').'</title>';
 | 
				
			||||||
    /*if ($_POST['updateProgram']==getconstStr('updateProgram')) {
 | 
					    /*if ($_POST['updateProgram']==getconstStr('updateProgram')) {
 | 
				
			||||||
        $response = json_decode(updataProgram($function_name, $Region, $namespace), true)['Response'];
 | 
					        $response = json_decode(updataProgram($function_name, $Region, $namespace), true)['Response'];
 | 
				
			||||||
| 
						 | 
					@ -339,7 +348,7 @@ namespace:' . $namespace . '<br>
 | 
				
			||||||
    if ($_POST['submit1']) {
 | 
					    if ($_POST['submit1']) {
 | 
				
			||||||
        $_SERVER['disk_oprating'] = '';
 | 
					        $_SERVER['disk_oprating'] = '';
 | 
				
			||||||
        foreach ($_POST as $k => $v) {
 | 
					        foreach ($_POST as $k => $v) {
 | 
				
			||||||
            if (in_array($k, $commonEnv)||in_array($k, $innerEnv)||$k=='disktag_del' || $k=='disktag_add') {
 | 
					            if (in_array($k, $ShowedCommonEnv)||in_array($k, $ShowedInnerEnv)||$k=='disktag_del' || $k=='disktag_add') {
 | 
				
			||||||
                $tmp[$k] = $v;
 | 
					                $tmp[$k] = $v;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            if ($k == 'disk') $_SERVER['disk_oprating'] = $v;
 | 
					            if ($k == 'disk') $_SERVER['disk_oprating'] = $v;
 | 
				
			||||||
| 
						 | 
					@ -384,7 +393,7 @@ namespace:' . $namespace . '<br>
 | 
				
			||||||
        <tr>
 | 
					        <tr>
 | 
				
			||||||
            <td colspan="2">'.getconstStr('PlatformConfig').'</td>
 | 
					            <td colspan="2">'.getconstStr('PlatformConfig').'</td>
 | 
				
			||||||
        </tr>';
 | 
					        </tr>';
 | 
				
			||||||
    foreach ($commonEnv as $key) {
 | 
					    foreach ($ShowedCommonEnv as $key) {
 | 
				
			||||||
        if ($key=='language') {
 | 
					        if ($key=='language') {
 | 
				
			||||||
            $html .= '
 | 
					            $html .= '
 | 
				
			||||||
        <tr>
 | 
					        <tr>
 | 
				
			||||||
| 
						 | 
					@ -453,7 +462,7 @@ namespace:' . $namespace . '<br>
 | 
				
			||||||
                $html .= '
 | 
					                $html .= '
 | 
				
			||||||
    <form name="'.$disktag.'" action="" method="post">
 | 
					    <form name="'.$disktag.'" action="" method="post">
 | 
				
			||||||
        <input type="hidden" name="disk" value="'.$disktag.'">';
 | 
					        <input type="hidden" name="disk" value="'.$disktag.'">';
 | 
				
			||||||
                foreach ($ShowedinnerEnv as $key) {
 | 
					                foreach ($ShowedInnerEnv as $key) {
 | 
				
			||||||
                    $html .= '
 | 
					                    $html .= '
 | 
				
			||||||
        <tr>
 | 
					        <tr>
 | 
				
			||||||
            <td><label>' . $key . '</label></td>
 | 
					            <td><label>' . $key . '</label></td>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -53,9 +53,9 @@ function GetPathSetting($event, $context)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function getConfig($str, $disktag = '')
 | 
					function getConfig($str, $disktag = '')
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    global $innerEnv;
 | 
					    global $InnerEnv;
 | 
				
			||||||
    if ($disktag=='') $disktag = $_SERVER['disktag'];
 | 
					    if ($disktag=='') $disktag = $_SERVER['disktag'];
 | 
				
			||||||
    if (in_array($str, $innerEnv)) {
 | 
					    if (in_array($str, $InnerEnv)) {
 | 
				
			||||||
        return json_decode(getenv($disktag), true)[$str];
 | 
					        return json_decode(getenv($disktag), true)[$str];
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    return getenv($str);
 | 
					    return getenv($str);
 | 
				
			||||||
| 
						 | 
					@ -63,7 +63,7 @@ function getConfig($str, $disktag = '')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function setConfig($arr, $disktag = '')
 | 
					function setConfig($arr, $disktag = '')
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    global $innerEnv;
 | 
					    global $InnerEnv;
 | 
				
			||||||
    if ($disktag=='') $disktag = $_SERVER['disktag'];
 | 
					    if ($disktag=='') $disktag = $_SERVER['disktag'];
 | 
				
			||||||
    $disktags = explode("|",getConfig('disktag'));
 | 
					    $disktags = explode("|",getConfig('disktag'));
 | 
				
			||||||
    $diskconfig = json_decode(getenv($disktag), true);
 | 
					    $diskconfig = json_decode(getenv($disktag), true);
 | 
				
			||||||
| 
						 | 
					@ -71,7 +71,7 @@ function setConfig($arr, $disktag = '')
 | 
				
			||||||
    $indisk = 0;
 | 
					    $indisk = 0;
 | 
				
			||||||
    $oparetdisk = 0;
 | 
					    $oparetdisk = 0;
 | 
				
			||||||
    foreach ($arr as $k => $v) {
 | 
					    foreach ($arr as $k => $v) {
 | 
				
			||||||
        if (in_array($k, $innerEnv)) {
 | 
					        if (in_array($k, $InnerEnv)) {
 | 
				
			||||||
            $diskconfig[$k] = $v;
 | 
					            $diskconfig[$k] = $v;
 | 
				
			||||||
            $indisk = 1;
 | 
					            $indisk = 1;
 | 
				
			||||||
        } elseif ($k=='disktag_add') {
 | 
					        } elseif ($k=='disktag_add') {
 | 
				
			||||||
| 
						 | 
					@ -111,6 +111,8 @@ function WaitSCFStat()
 | 
				
			||||||
function get_refresh_token()
 | 
					function get_refresh_token()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    global $constStr;
 | 
					    global $constStr;
 | 
				
			||||||
 | 
					    global $CommonEnv;
 | 
				
			||||||
 | 
					    foreach ($CommonEnv as $env) $envs .= '\'' . $env . '\', ';
 | 
				
			||||||
    $url = path_format($_SERVER['PHP_SELF'] . '/');
 | 
					    $url = path_format($_SERVER['PHP_SELF'] . '/');
 | 
				
			||||||
    if ($_GET['authorization_code'] && isset($_GET['code'])) {
 | 
					    if ($_GET['authorization_code'] && isset($_GET['code'])) {
 | 
				
			||||||
        $_SERVER['disktag'] = $_COOKIE['disktag'];
 | 
					        $_SERVER['disktag'] = $_COOKIE['disktag'];
 | 
				
			||||||
| 
						 | 
					@ -169,6 +171,9 @@ function get_refresh_token()
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if ($_GET['install0']) {
 | 
					    if ($_GET['install0']) {
 | 
				
			||||||
        if ($_POST['disktag_add']!='' && ($_POST['Onedrive_ver']=='MS' || $_POST['Onedrive_ver']=='CN' || $_POST['Onedrive_ver']=='MSC')) {
 | 
					        if ($_POST['disktag_add']!='' && ($_POST['Onedrive_ver']=='MS' || $_POST['Onedrive_ver']=='CN' || $_POST['Onedrive_ver']=='MSC')) {
 | 
				
			||||||
 | 
					            if (in_array($_COOKIE['disktag'], $CommonEnv)) {
 | 
				
			||||||
 | 
					                return message('Do not input ' . $envs . '<br><button onclick="location.href = location.href;">'.getconstStr('Reflesh').'</button><script>document.cookie=\'disktag=; path=/\';</script>', 'Error', 201);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
            $_SERVER['disktag'] = $_COOKIE['disktag'];
 | 
					            $_SERVER['disktag'] = $_COOKIE['disktag'];
 | 
				
			||||||
            $tmp['disktag_add'] = $_POST['disktag_add'];
 | 
					            $tmp['disktag_add'] = $_POST['disktag_add'];
 | 
				
			||||||
            $tmp['diskname'] = $_POST['diskname'];
 | 
					            $tmp['diskname'] = $_POST['diskname'];
 | 
				
			||||||
| 
						 | 
					@ -223,6 +228,11 @@ namespace:' . $_SERVER['namespace'] . '<br>
 | 
				
			||||||
                alert(\'Input Disk Tag\');
 | 
					                alert(\'Input Disk Tag\');
 | 
				
			||||||
                return false;
 | 
					                return false;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					            envs = [' . $envs . '];
 | 
				
			||||||
 | 
					            if (envs.indexOf(t.disktag_add.value)>-1) {
 | 
				
			||||||
 | 
					                alert("Do not input ' . $envs . '");
 | 
				
			||||||
 | 
					                return false;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
            var reg = /^[a-zA-Z]([-_a-zA-Z0-9]{1,20})$/;
 | 
					            var reg = /^[a-zA-Z]([-_a-zA-Z0-9]{1,20})$/;
 | 
				
			||||||
            if (!reg.test(t.disktag_add.value)) {
 | 
					            if (!reg.test(t.disktag_add.value)) {
 | 
				
			||||||
                alert(\''.getconstStr('TagFormatAlert').'\');
 | 
					                alert(\''.getconstStr('TagFormatAlert').'\');
 | 
				
			||||||
| 
						 | 
					@ -418,9 +428,9 @@ function updateEnvironment($Envs, $function_name, $Region, $Namespace, $SecretId
 | 
				
			||||||
function SetbaseConfig($Envs, $function_name, $Region, $Namespace, $SecretId, $SecretKey)
 | 
					function SetbaseConfig($Envs, $function_name, $Region, $Namespace, $SecretId, $SecretKey)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    echo json_encode($Envs,JSON_PRETTY_PRINT);
 | 
					    echo json_encode($Envs,JSON_PRETTY_PRINT);
 | 
				
			||||||
    $trynum = 0;
 | 
					    /*$trynum = 0;
 | 
				
			||||||
    while( json_decode(getfunctioninfo($_SERVER['function_name'], $_SERVER['Region'], $_SERVER['namespace'], $SecretId, $SecretKey),true)['Response']['Status']!='Active' ) echo '
 | 
					    while( json_decode(getfunctioninfo($_SERVER['function_name'], $_SERVER['Region'], $_SERVER['namespace'], $SecretId, $SecretKey),true)['Response']['Status']!='Active' ) echo '
 | 
				
			||||||
'.++$trynum;
 | 
					'.++$trynum;*/
 | 
				
			||||||
    //json_decode($a,true)['Response']['Environment']['Variables'][0]['Key']
 | 
					    //json_decode($a,true)['Response']['Environment']['Variables'][0]['Key']
 | 
				
			||||||
    $tmp = json_decode(getfunctioninfo($function_name, $Region, $Namespace, $SecretId, $SecretKey),true)['Response']['Environment']['Variables'];
 | 
					    $tmp = json_decode(getfunctioninfo($function_name, $Region, $Namespace, $SecretId, $SecretKey),true)['Response']['Environment']['Variables'];
 | 
				
			||||||
    foreach ($tmp as $tmp1) {
 | 
					    foreach ($tmp as $tmp1) {
 | 
				
			||||||
| 
						 | 
					@ -487,11 +497,10 @@ function updateProgram($function_name, $Region, $Namespace, $SecretId, $SecretKe
 | 
				
			||||||
function EnvOpt($function_name, $needUpdate = 0)
 | 
					function EnvOpt($function_name, $needUpdate = 0)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    global $constStr;
 | 
					    global $constStr;
 | 
				
			||||||
    global $commonEnv;
 | 
					    global $ShowedCommonEnv;
 | 
				
			||||||
    global $innerEnv;
 | 
					    global $ShowedInnerEnv;
 | 
				
			||||||
    global $ShowedinnerEnv;
 | 
					    asort($ShowedCommonEnv);
 | 
				
			||||||
    asort($commonEnv);
 | 
					    asort($ShowedInnerEnv);
 | 
				
			||||||
    asort($ShowedinnerEnv);
 | 
					 | 
				
			||||||
    $html = '<title>OneManager '.getconstStr('Setup').'</title>';
 | 
					    $html = '<title>OneManager '.getconstStr('Setup').'</title>';
 | 
				
			||||||
    if ($_POST['updateProgram']==getconstStr('updateProgram')) {
 | 
					    if ($_POST['updateProgram']==getconstStr('updateProgram')) {
 | 
				
			||||||
        $response = json_decode(updateProgram($function_name, $_SERVER['Region'], $_SERVER['namespace'], getConfig('SecretId'), getConfig('SecretKey')), true)['Response'];
 | 
					        $response = json_decode(updateProgram($function_name, $_SERVER['Region'], $_SERVER['namespace'], getConfig('SecretId'), getConfig('SecretKey')), true)['Response'];
 | 
				
			||||||
| 
						 | 
					@ -514,7 +523,7 @@ namespace:' . $namespace . '<br>
 | 
				
			||||||
    if ($_POST['submit1']) {
 | 
					    if ($_POST['submit1']) {
 | 
				
			||||||
        $_SERVER['disk_oprating'] = '';
 | 
					        $_SERVER['disk_oprating'] = '';
 | 
				
			||||||
        foreach ($_POST as $k => $v) {
 | 
					        foreach ($_POST as $k => $v) {
 | 
				
			||||||
            if (in_array($k, $commonEnv)||in_array($k, $innerEnv)||$k=='disktag_del' || $k=='disktag_add') {
 | 
					            if (in_array($k, $ShowedCommonEnv)||in_array($k, $ShowedInnerEnv)||$k=='disktag_del' || $k=='disktag_add') {
 | 
				
			||||||
                $tmp[$k] = $v;
 | 
					                $tmp[$k] = $v;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            if ($k == 'disk') $_SERVER['disk_oprating'] = $v;
 | 
					            if ($k == 'disk') $_SERVER['disk_oprating'] = $v;
 | 
				
			||||||
| 
						 | 
					@ -568,7 +577,7 @@ namespace:' . $_SERVER['namespace'] . '<br>
 | 
				
			||||||
        <tr>
 | 
					        <tr>
 | 
				
			||||||
            <td colspan="2">'.getconstStr('PlatformConfig').'</td>
 | 
					            <td colspan="2">'.getconstStr('PlatformConfig').'</td>
 | 
				
			||||||
        </tr>';
 | 
					        </tr>';
 | 
				
			||||||
    foreach ($commonEnv as $key) {
 | 
					    foreach ($ShowedCommonEnv as $key) {
 | 
				
			||||||
        if ($key=='language') {
 | 
					        if ($key=='language') {
 | 
				
			||||||
            $html .= '
 | 
					            $html .= '
 | 
				
			||||||
        <tr>
 | 
					        <tr>
 | 
				
			||||||
| 
						 | 
					@ -637,7 +646,7 @@ namespace:' . $_SERVER['namespace'] . '<br>
 | 
				
			||||||
                $html .= '
 | 
					                $html .= '
 | 
				
			||||||
    <form name="'.$disktag.'" action="" method="post">
 | 
					    <form name="'.$disktag.'" action="" method="post">
 | 
				
			||||||
        <input type="hidden" name="disk" value="'.$disktag.'">';
 | 
					        <input type="hidden" name="disk" value="'.$disktag.'">';
 | 
				
			||||||
                foreach ($ShowedinnerEnv as $key) {
 | 
					                foreach ($ShowedInnerEnv as $key) {
 | 
				
			||||||
                    $html .= '
 | 
					                    $html .= '
 | 
				
			||||||
        <tr>
 | 
					        <tr>
 | 
				
			||||||
            <td><label>' . $key . '</label></td>
 | 
					            <td><label>' . $key . '</label></td>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										5
									
								
								version
								
								
								
								
							
							
						
						
									
										5
									
								
								version
								
								
								
								
							| 
						 | 
					@ -1,7 +1,10 @@
 | 
				
			||||||
 | 
					20200225-1310.12
 | 
				
			||||||
 | 
					Can update by one click any time. fix bugs: special tag, reupload.
 | 
				
			||||||
 | 
					可以不管版本直接一键更新(覆盖)了。修复可以使用特殊onedrive标签的bug,修复断网续传的问题。
 | 
				
			||||||
 | 
					
 | 
				
			||||||
20200222-2130.11
 | 
					20200222-2130.11
 | 
				
			||||||
you can set background now. fix bug: 2nd disk upload.
 | 
					you can set background now. fix bug: 2nd disk upload.
 | 
				
			||||||
可以设置背景图片了。第2个盘上传后链接不对。
 | 
					可以设置背景图片了。第2个盘上传后链接不对。
 | 
				
			||||||
 | 
					 | 
				
			||||||
20200222-1700.09
 | 
					20200222-1700.09
 | 
				
			||||||
Can copy file and folder now.
 | 
					Can copy file and folder now.
 | 
				
			||||||
可以复制文件跟目录了。
 | 
					可以复制文件跟目录了。
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue