From 4d55e3a799fa74a60bbbf94a80e59c25e2094607 Mon Sep 17 00:00:00 2001 From: tianya Date: Thu, 24 Mar 2022 21:09:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E5=9D=97=E8=AE=A4=E8=AF=81=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/admin/module_main.php | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/src/admin/module_main.php b/src/admin/module_main.php index 6abee929..7de6842f 100644 --- a/src/admin/module_main.php +++ b/src/admin/module_main.php @@ -108,7 +108,7 @@ else if ($action == 'setup') { exit; } $alertMsg = ($infos['lang'] == $cfg_soft_lang ? '' : '
(这个模块的语言编码与您系统的编码不一致,请向开发者确认它的兼容性)'); - $filelists = $dm->GetFileLists($hash); + $filelists = (array)$dm->GetFileLists($hash); $filelist = ''; $prvdirs = array(); $incdir = array(); @@ -150,6 +150,16 @@ else if ($action == 'setup') { $win = new OxWindow(); $win->Init("module_main.php", "js/blank.js", "post"); $wecome_info = "模块管理"; + $devURL = DEDECDNURL."/developers/{$infos['dev_id']}.json"; + $dhd = new DedeHttpDown(); + $dhd->OpenUrl($devURL); + $devContent = $dhd->GetHtml(); + $devInfo = (array)json_decode($devContent); + $s = "未认证"; + if (($devInfo['dev_id'] == $infos['dev_id']) && !empty($devInfo['dev_id'])) { + $s = "已认证"; + } + $win->AddTitle(" 模块管理 >> 安装模块:{$infos['name']}"); $win->AddHidden("hash", $hash); $win->AddHidden("action", 'setupstart'); @@ -169,7 +179,7 @@ else if ($action == 'setup') { 开发者ID: - {$infos['dev_id']} 未认证 + {$infos['dev_id']} {$s} 发布时间: @@ -221,7 +231,7 @@ else if ($action == 'setupstart') { exit(); } $dm = new DedeModule($mdir); - $minfos = $dm->GetModuleInfo($hash); + $minfos = (array)$dm->GetModuleInfo($hash); extract($minfos, EXTR_SKIP); $menustring = addslashes($dm->GetSystemFile($hash, 'menustring')); $indexurl = str_replace('**', '=', $indexurl); @@ -338,7 +348,7 @@ else if ($action == 'uninstall') { $infos = $dm->GetModuleInfo($hash); if ($infos['url'] == '') $infos['url'] = ' '; $alertMsg = ($infos['lang'] == $cfg_soft_lang ? '' : '
(这个模块的语言编码与您系统的编码不一致,请向开发者确认它的兼容性)'); - $filelists = $dm->GetFileLists($hash); + $filelists = (array)$dm->GetFileLists($hash); $filelist = ''; foreach ($filelists as $v) { if (empty($v['name'])) continue; @@ -407,7 +417,7 @@ function UnInstallRun(); else if ($action == 'uninstallok') { $dsql->ExecuteNoneQuery("DELETE FROM `#@__sys_module` WHERE hashcode LIKE '$hash' "); $dm = new DedeModule($mdir); - $minfos = $dm->GetModuleInfo($hash); + $minfos = (array)$dm->GetModuleInfo($hash); extract($minfos, EXTR_SKIP); if (!isset($moduletype) || $moduletype != 'patch') { $dm->DeleteFiles($hash, $isreplace); @@ -464,9 +474,18 @@ else if ($action == 'view') { $infos = $dm->GetModuleInfo($hash); if ($infos['url'] == '') $infos['url'] = ' '; $alertMsg = ($infos['lang'] == $cfg_soft_lang ? '' : '
(这个模块的语言编码与您系统的编码不一致,请向开发者确认它的兼容性)'); - $filelists = $dm->GetFileLists($hash); + $filelists = (array)$dm->GetFileLists($hash); $filelist = ''; $setupinfo = ''; + $devURL = DEDECDNURL."/developers/{$infos['dev_id']}.json"; + $dhd = new DedeHttpDown(); + $dhd->OpenUrl($devURL); + $devContent = $dhd->GetHtml(); + $devInfo = (array)json_decode($devContent); + $s = "未认证"; + if (($devInfo['dev_id'] == $infos['dev_id']) && !empty($devInfo['dev_id'])) { + $s = "已认证"; + } foreach ($filelists as $v) { if (empty($v['name'])) continue; if ($v['type'] == 'dir') $v['type'] = '目录'; @@ -478,7 +497,8 @@ else if ($action == 'view') { } else { $setupinfo = "未安装 安装"; } - $dev_id = empty($infos['dev_id'])? "安装未认证" : "{$infos['dev_id']} 未认证"; + + $dev_id = empty($infos['dev_id'])? "安装{$s}" : "{$infos['dev_id']} {$s}"; $win = new OxWindow(); $win->Init("", "js/blank.js", ""); $wecome_info = "模块管理"; @@ -529,7 +549,7 @@ function Edit(); --------------*/ else if ($action == 'edit') { $dm = new DedeModule($mdir); - $minfos = $dm->GetModuleInfo($hash); + $minfos = (array)$dm->GetModuleInfo($hash); extract($minfos, EXTR_SKIP); if (!isset($lang)) $lang = 'gb2312'; if (!isset($moduletype)) $moduletype = 'soft';