From 4bdb655a935a1a9f89857aaadeba4cbcba079d1b Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Tue, 27 Jun 2023 18:20:44 +0800 Subject: [PATCH] feat: add ospp keys and commands --- assets/ospp.json | 50 ++++++++++++++++++++++++++++++++++++++++++++++++ web/cli.php | 5 +++++ web/utils.php | 5 +++++ 3 files changed, 60 insertions(+) create mode 100644 assets/ospp.json diff --git a/assets/ospp.json b/assets/ospp.json new file mode 100644 index 0000000..370511c --- /dev/null +++ b/assets/ospp.json @@ -0,0 +1,50 @@ +{ + "key": { + "2010": ["Office14", "VYBBJ-TRJPB-QFQRF-QFT4D-H3GVB"], + "2013": ["Office15", "YC7DK-G2NP3-2QQC3-J6H88-GVGXT"], + "2016": ["Office16", "XQNVK-8JYDB-WJ9W3-YJ8YR-WFG99"], + "2019": ["Office16", "NMMKJ-6RK4F-KMJVX-8D9MJ-6MWKP"] + }, + "command": { + "/dstatus": { + "en-us": "Display license information for installed product keys.", + "zh-cn": "显示当前已安装产品密钥的许可证信息", + "zh-tw": "顯示當前已安裝產品密鑰的許可證信息" + }, + "/dstatusall": { + "en-us": "Display license information for installed licenses.", + "zh-cn": "显示当前已安装的所有许可证信息", + "zh-tw": "顯示當前已安裝的所有許可證信息" + }, + "/unpkey:XXXXX": { + "en-us": "Uninstall a product key with the last five digits of it.", + "zh-cn": "卸载已安装的产品密钥(最后5位)", + "zh-tw": "卸載已安裝的產品密鑰(最後5位)" + }, + "/inpkey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX": { + "en-us": "Install a product key with user-provided product key.", + "zh-cn": "安装产品密钥", + "zh-tw": "安裝產品密鑰" + }, + "/sethst:@HOST@": { + "en-us": "Set a KMS host name with user-provided host name.", + "zh-cn": "设置 KMS 主机名", + "zh-tw": "設置 KMS 主機名" + }, + "/setprt:@PORT@": { + "en-us": "Set a KMS port with user-provided port number.", + "zh-cn": "设置 KMS 主机端口", + "zh-tw": "設置 KMS 主機端口" + }, + "/remhst": { + "en-us": "Remove KMS host name and sets port to default.", + "zh-cn": "删除 KMS 主机名", + "zh-tw": "刪除 KMS 主機名" + }, + "/act": { + "en-us": "Activate installed Office product keys.", + "zh-cn": "激活 Office", + "zh-tw": "激活 Office" + } + } +} diff --git a/web/cli.php b/web/cli.php index 95c6ee5..c993db6 100644 --- a/web/cli.php +++ b/web/cli.php @@ -109,6 +109,11 @@ class CliOutput { echo "\nOffice\n"; echo " -> $urlPrefix/office\n\n"; } + + /// Print office message under command line. + public function showOffice(): void { + + } } $cli = new CliOutput(); diff --git a/web/utils.php b/web/utils.php index dcadf75..8357c5e 100644 --- a/web/utils.php +++ b/web/utils.php @@ -26,3 +26,8 @@ function loadGvlks(bool $isWinServer = false): array { // load kms client keys f $gvlkData = json_decode(file_get_contents($assetPath), true); return $isWinServer ? $gvlkData['win-server'] : $gvlkData['win']; } + +function loadOsppData(): array { + $osppPath = '../assets/ospp.json'; + return json_decode(file_get_contents($osppPath), true); +}