From 717b4542566e147bf6e5a7ba5d98a37cf05c7d75 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Wed, 1 Dec 2021 14:38:07 +0800 Subject: [PATCH] add setup=auth --- platform/HuaweiFG_file.php | 81 ++++++++++++++++++++++++++++++-------- 1 file changed, 64 insertions(+), 17 deletions(-) diff --git a/platform/HuaweiFG_file.php b/platform/HuaweiFG_file.php index 64e6199..abddc7f 100644 --- a/platform/HuaweiFG_file.php +++ b/platform/HuaweiFG_file.php @@ -1,4 +1,7 @@ '; $html .= '
'; } - if (getConfig('HW_urn')==''||getConfig('HW_key')==''||getConfig('HW_secret')=='') $html .= ' + //if (getConfig('HW_urn')==''||getConfig('HW_key')==''||getConfig('HW_secret')=='') + $html .= ' 在函数代码操作页上方找到URN,鼠标放上去后显示URN,复制填入:

点击链接,新增访问密钥, 在下载的credentials.csv文件中找到对应信息,填入:

-
'; +
'; $html .= '

'; @@ -287,17 +282,18 @@ language:
'; } function notnull(t) {'; - if (getConfig('HW_urn')==''||getConfig('HW_key')==''||getConfig('HW_secret')=='') $html .= ' + //if (getConfig('HW_urn')==''||getConfig('HW_key')==''||getConfig('HW_secret')=='') + $html .= ' if (t.HW_urn.value==\'\') { alert(\'input URN\'); return false; } if (t.HW_key.value==\'\') { - alert(\'input name\'); + alert(\'input Access Key Id\'); return false; } if (t.HW_secret.value==\'\') { - alert(\'input pwd\'); + alert(\'input Secret Access Key\'); return false; }'; $html .= ' @@ -872,3 +868,54 @@ class Signer function WaitFunction() { return true; } + +function changeAuthKey() { + if ($_POST['HW_key']!=''&&$_POST['HW_secret']!='') { + $tmp['HW_key'] = $_POST['HW_key']; + $tmp['HW_secret'] = $_POST['HW_secret']; + $response = setConfigResponse( SetbaseConfig($tmp, getConfig('HW_urn'), $tmp['HW_key'], $tmp['HW_secret']) ); + if (api_error($response)) { + $html = api_error_msg($response); + $title = 'Error'; + return message($html, $title, 400); + } else { + $html = getconstStr('Success') . ' + '; + return message($html, $title, 201, 1); + } + } + $html = ' +
+ 点击链接,新增访问密钥, + 在下载的credentials.csv文件中找到对应信息,填入:
+
+
+ +
+ '; + return message($html, 'Change platform Auth token or key', 200); +}