Add files via upload

This commit is contained in:
qkqpttgf
2020-02-18 21:57:38 +08:00
committed by GitHub
parent e2946ad471
commit a81339b87f
4 changed files with 73 additions and 42 deletions
+17 -16
View File
@@ -61,13 +61,8 @@ function getConfig($str, $disktag = '')
function setConfig($arr, $disktag = '')
{
echo '进入设置:'.json_encode($arr,JSON_PRETTY_PRINT).'
';
global $innerEnv;
if ($disktag=='') $disktag = $_SERVER['disktag'];
//$disktags = json_decode(getConfig('disktag'), true);
//if ($_SERVER['disk_oprating']) $disktag = $_SERVER['disk_oprating'];
//else $disktag = $_SERVER['disktag'];
$disktags = explode("|",getConfig('disktag'));
$diskconfig = json_decode(getenv($disktag), true);
$tmp = [];
@@ -98,8 +93,8 @@ function setConfig($arr, $disktag = '')
if ($disktag_s!='') $tmp['disktag'] = substr($disktag_s, 0, -1);
else $tmp['disktag'] = '';
}
echo '正式设置:'.json_encode($tmp,JSON_PRETTY_PRINT).'
';
// echo '正式设置:'.json_encode($tmp,JSON_PRETTY_PRINT).'
//';
return setHerokuConfig($tmp, getConfig('function_name'), getConfig('APIKey'));
}
@@ -169,7 +164,8 @@ function get_refresh_token()
$tmp['Onedrive_ver'] = $_POST['Onedrive_ver'];
if ($_POST['Onedrive_ver']=='MSC') {
$tmp['client_id'] = $_POST['client_id'];
$tmp['client_secret'] = $_POST['client_secret'];
$tmp['client_secret'] = equal_replace(base64_encode($_POST['client_secret']));
//$_POST['client_secret'];
}
$response = json_decode( setConfig($tmp, $_COOKIE['disktag']), true )['Response'];
$title = getconstStr('MayinEnv');
@@ -356,8 +352,9 @@ function EnvOpt($function_name, $needUpdate = 0)
global $constStr;
global $commonEnv;
global $innerEnv;
global $ShowedinnerEnv;
asort($commonEnv);
asort($innerEnv);
asort($ShowedinnerEnv);
$html = '<title>OneManager '.getconstStr('Setup').'</title>';
/*if ($_POST['updateProgram']==getconstStr('updateProgram')) {
$response = json_decode(updataProgram($function_name, $Region, $namespace), true)['Response'];
@@ -416,7 +413,7 @@ namespace:' . $namespace . '<br>
$preurl = path_format($_SERVER['PHP_SELF'] . '/');
}
$html .= '
<a href="'.$preurl.'">'.getconstStr('Back').'</a>&nbsp;&nbsp;&nbsp;
<a href="'.$preurl.'">'.getconstStr('Back').'</a>&nbsp;&nbsp;&nbsp;<a href="/'.$_SERVER['base_path'].'">'.getconstStr('Back').getconstStr('Home').'</a><br>
<a href="https://github.com/qkqpttgf/OneManager-php">Github</a><br>';
/*if ($needUpdate) {
$html .= '<pre>' . $_SERVER['github_version'] . '</pre>
@@ -426,7 +423,7 @@ namespace:' . $namespace . '<br>
} else {
$html .= getconstStr('NotNeedUpdate');
}*/
$html .= '
$html .= '<br>
<table border=1 width=100%>
<form name="common" action="" method="post">
<tr>
@@ -496,19 +493,23 @@ namespace:' . $namespace . '<br>
<input type="submit" name="submit1" value="Del disk">
</td>
</tr>
</form>
</form>';
if (getConfig('refresh_token', $disktag)!='') {
$html .= '
<form name="'.$disktag.'" action="" method="post">
<input type="hidden" name="disk" value="'.$disktag.'">';
foreach ($innerEnv as $key) {
$html .= '
foreach ($ShowedinnerEnv as $key) {
$html .= '
<tr>
<td><label>' . $key . '</label></td>
<td width=100%><input type="text" name="' . $key .'" value="' . getConfig($key, $disktag) . '" placeholder="' . getconstStr('EnvironmentsDescription')[$key] . '" style="width:100%"></td>
</tr>';
}
$html .= '
<tr><td><input type="submit" name="submit1" value="'.getconstStr('Setup').'"></td></tr>
</form>';
}
$html .= '
<tr><td><input type="submit" name="submit1" value="'.getconstStr('Setup').'"></td></tr>
</form>
</table><br>';
}
}