From b7d4ddd710956ef2d583c809e47e3481ba25bcbf Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Sun, 1 Aug 2021 14:46:55 +0800 Subject: [PATCH] feat: office support --- backend/kms-office.php | 74 ++++++++++++++++++++++++++++++++++++++++++ backend/route.php | 10 ++++++ 2 files changed, 84 insertions(+) create mode 100644 backend/kms-office.php diff --git a/backend/kms-office.php b/backend/kms-office.php new file mode 100644 index 0000000..eab9566 --- /dev/null +++ b/backend/kms-office.php @@ -0,0 +1,74 @@ + $officeKmsCmd) { + $office[$index] .= PHP_EOL . $activeCmd; + } +} + +function showOfficeHelp() { + loadOfficeCmd(); + global $office; + $index = '2010'; + foreach ($office as $index => $officeKmsCmd) { + echo str_pad('', 34, ' ') . 'Office Professional Plus ' . $index . ' VL Activation Command' . PHP_EOL; + echo str_pad('', 120, '-') . PHP_EOL; + echo $officeKmsCmd; + echo str_pad('', 120, '-') . PHP_EOL . PHP_EOL; + } + // TODO: Warning of VL version + // Usage of ospp.vbs +} + +function webOfficeHelp() { + // TODO: Web of Office KMS Activation +} + +?> \ No newline at end of file diff --git a/backend/route.php b/backend/route.php index 2fdb187..a626ca5 100644 --- a/backend/route.php +++ b/backend/route.php @@ -3,6 +3,7 @@ include 'kms-cli.php'; include 'kms-web.php'; include 'kms-help.php'; +include 'kms-office.php'; if (isset($_SERVER['HTTP_HOST'])) { // 获取服务域名 $webSite = $_SERVER['HTTP_HOST']; @@ -22,6 +23,15 @@ if ($url == '/' || $url == '/help') { // 操作提示 exit; } +if ($url == '/office') { // office激活帮助 + if ($_GET['cli'] == 'true') { + showOfficeHelp(); + } else { + webOfficeHelp(); + } + exit; +} + if ($url == '/win') { // KMS密钥获取 if ($_GET['cli'] == 'true') { showWinKeys();