Parcourir la source

兼容旧版模块上传

tags/6.0.3
tianya il y a 3 ans
Parent
révision
29a9e2e6b1
4 fichiers modifiés avec 30 ajouts et 19 suppressions
  1. +16
    -8
      src/dede/module_main.php
  2. +1
    -0
      src/dede/templets/module_main.htm
  3. +2
    -2
      src/include/dedeatt.class.php
  4. +11
    -9
      src/include/dedemodule.class.php

+ 16
- 8
src/dede/module_main.php Voir le fichier

@@ -79,6 +79,7 @@ function ViewDevelopoer();
// 检验开发者信息
$dm = new DedeModule($mdir);
$info = $dm->GetModuleInfo($hash);
if ($info == null) {
ShowMsg("获取模块信息错误,模块文件可能被篡改", -1);
exit;
@@ -96,6 +97,11 @@ function ViewDevelopoer();
}
$authAt = date("Y-m-d", $devInfo['auth_at']);
if (!isset($info['dev_id'])) {
$devInfo['realname'] = $devInfo['dev_name'] = $info['team']." <font color=red>未认证</font>";
$authAt = "0000-00-00";
}
ShowMsg("<div class='text-left'><p>开发者名称:{$devInfo['dev_name']}</p><p>开发者全称:{$devInfo['realname']}</p><p>开发者ID:{$devInfo['dev_id']} <a class='btn btn-secondary btn-sm' target='_blank' href='{$cfg_biz_dedebizUrl}/developer?dev_id={$devInfo['dev_id']}'>查看详情</a></p>$offUrl<p>认证于:{$authAt}</p></a>", "javascript:;");
exit;
}
@@ -309,7 +315,7 @@ function DelModule();
$infos = $dm->GetModuleInfo($hash);
$alertMsg = ($infos['lang'] == $cfg_soft_lang ? '' : '<br /><font color="red">(这个模块的语言编码与你系统的编码不一致,请向开发者确认它的兼容性)</font>');
$dev_id = empty($infos['dev_id'])? "未认证 <a style='color:red' target='_blank' href='{$cfg_biz_dedebizUrl}/developer'>前去认证</a>" : "{$infos['dev_id']} <a class='btn btn-secondary btn-sm' target='_blank' href='{$cfg_biz_dedebizUrl}/developer?dev_id={$infos['dev_id']}'>查看详情</a>";
$win = new OxWindow();
$win->Init("module_main.php", "js/blank.js", "post");
$wecome_info = "模块管理";
@@ -332,7 +338,7 @@ function DelModule();
</tr>
<tr>
<td height='28' class='dtb'>开发者ID:</td>
<td class='dtb'>{$infos['dev_id']} <a class='btn btn-secondary btn-sm' target='_blank' href='{$cfg_biz_dedebizUrl}/developer?dev_id={$infos['dev_id']}'>查看详情</a></td>
<td class='dtb'>{$dev_id}</td>
</tr>
<tr>
<td height='28' class='dtb'>发布时间:</td>
@@ -378,6 +384,7 @@ function UnInstall();
else $v['type'] = '文件';
$filelist .= "{$v['type']}|{$v['name']}\r\n";
}
$dev_id = empty($infos['dev_id'])? "未认证 <a style='color:red' target='_blank' href='{$cfg_biz_dedebizUrl}/developer'>前去认证</a>" : "{$infos['dev_id']} <a class='btn btn-secondary btn-sm' target='_blank' href='{$cfg_biz_dedebizUrl}/developer?dev_id={$infos['dev_id']}'>查看详情</a>";
$win = new OxWindow();
$win->Init("module_main.php", "js/blank.js", "post");
$wecome_info = "模块管理";
@@ -400,7 +407,7 @@ function UnInstall();
</tr>
<tr>
<td height='28' class='dtb'>开发者ID:</td>
<td class='dtb'>{$infos['dev_id']} <a class='btn btn-secondary btn-sm' target='_blank' href='{$cfg_biz_dedebizUrl}/developer?dev_id={$infos['dev_id']}'>查看详情</a></td>
<td class='dtb'>{$dev_id}</td>
</tr>
<tr>
<td height='28' class='dtb'>发布时间:</td>
@@ -421,10 +428,10 @@ function UnInstall();
<tr>
<td height='28'>对于模块的文件处理方法:</td>
<td>
<input type='radio' name='isreplace' value='0' checked='checked' />
手工删除文件,仅运行卸载程序
<input name='isreplace' type='radio' value='2' />
删除模块的所有文件
<label><input type='radio' name='isreplace' value='0' checked='checked' />
手工删除文件,仅运行卸载程序</label>
<label><input name='isreplace' type='radio' value='2' />
删除模块的所有文件</label>
</td>
</tr>
</table>
@@ -515,6 +522,7 @@ function ViewOne();
} else {
$setupinfo = "未安装 <a href='module_main.php?action=setup&hash={$hash}'>安装</a>";
}
$dev_id = empty($infos['dev_id'])? "未认证 <a style='color:red' target='_blank' href='{$cfg_biz_dedebizUrl}/developer'>前去认证</a>" : "{$infos['dev_id']} <a class='btn btn-secondary btn-sm' target='_blank' href='{$cfg_biz_dedebizUrl}/developer?dev_id={$infos['dev_id']}'>查看详情</a>";
$win = new OxWindow();
$win->Init("", "js/blank.js", "");
$wecome_info = "模块管理";
@@ -535,7 +543,7 @@ function ViewOne();
</tr>
<tr>
<td height='28' class='dtb'>开发者ID:</td>
<td class='dtb'>{$infos['dev_id']} <a class='btn btn-secondary btn-sm' target='_blank' href='{$cfg_biz_dedebizUrl}/developer?dev_id={$infos['dev_id']}'>查看详情</a></td>
<td class='dtb'>{$dev_id}</td>
</tr>
<tr>
<td height='28' class='dtb'>发布时间:</td>


+ 1
- 0
src/dede/templets/module_main.htm Voir le fichier

@@ -29,6 +29,7 @@
<div class="bodytitletxt" style="padding-left:10px;">模块管理</div>
<div class="bodytitletxt" style="float: right;padding-right: 10px;">
<a href="<?php echo $cfg_biz_dedebizUrl;?>?from=module" target="_blank">应用市场</a>
<a href="module_upload.php">模块上传</a>
<a href="module_make.php">模块打包</a>
</div>
</div>


+ 2
- 2
src/include/dedeatt.class.php Voir le fichier

@@ -21,7 +21,7 @@
class DedeAtt
{
var $Count = -1;
var $Items = ""; //属性元素的集合
var $Items = array(); //属性元素的集合
/**
* //获得某个属性
@@ -95,7 +95,7 @@ class DedeAttParse
{
var $SourceString = "";
var $SourceMaxSize = 1024;
var $CAtt = ""; //属性的数据描述类
var $CAtt; //属性的数据描述类
var $CharToLow = TRUE;
/**


+ 11
- 9
src/include/dedemodule.class.php Voir le fichier

@@ -189,15 +189,17 @@ class DedeModule
foreach ($minfos as $k => $v) $minfos[$k] = $this->AppCode($v);
}
// 验证模块信息
$pubKey = @base64url_decode($minfos['pubkey']);
@openssl_public_decrypt(base64url_decode($minfos['info']), $decontent, $pubKey);
$enInfo = (array)json_decode($decontent);
if (count($enInfo) == 0) {
return null;
}
if ($enInfo['module_name'] != $minfos['name'] || $enInfo['dev_id'] != $minfos['dev_id']) {
return null;
if (isset($minfos['pubkey'])) {
// 验证模块信息
$pubKey = @base64url_decode($minfos['pubkey']);
@openssl_public_decrypt(base64url_decode($minfos['info']), $decontent, $pubKey);
$enInfo = (array)json_decode($decontent);
if (count($enInfo) == 0) {
return null;
}
if ($enInfo['module_name'] != $minfos['name'] || $enInfo['dev_id'] != $minfos['dev_id']) {
return null;
}
}
return $minfos;


Chargement…
Annuler
Enregistrer