예제 #1
0
         $setupinfo = "未安装 <a href='module_main.php?action=setup&hash={$hash}'>安装</a>";
     }
     $win = new OxWindow();
     $win->Init("", "js/blank.js", "");
     $wecome_info = "模块管理";
     $win->AddTitle("<a href='module_main.php'>模块管理</a> &gt;&gt; 模块详情: {$infos['name']}");
     $msg = "<style>.dtb{border-bottom:1px dotted #cccccc}</style>\r\n    <table width='98%' border='0' cellspacing='0' cellpadding='0'>\r\n  <tr>\r\n    <td width='20%' height='28' class='dtb'>模块名称:</td>\r\n    <td width='80%' class='dtb'>{$infos['name']}</td>\r\n  </tr>\r\n  <tr>\r\n    <td height='28' class='dtb'>语言:</td>\r\n    <td class='dtb'>{$infos['lang']} {$alertMsg}</td>\r\n  </tr>\r\n  <tr>\r\n    <td height='28' class='dtb'>文件大小:</td>\r\n    <td class='dtb'>{$infos['filesize']}</td>\r\n  </tr>\r\n  <tr>\r\n    <td height='28' class='dtb'>是否已安装:</td>\r\n    <td class='dtb'>{$setupinfo}</td>\r\n  </tr>\r\n  <tr>\r\n    <td height='28' class='dtb'>团队名称:</td>\r\n    <td class='dtb'>{$infos['team']}</td>\r\n  </tr>\r\n  <tr>\r\n    <td height='28' class='dtb'>发布时间:</td>\r\n    <td class='dtb'>{$infos['time']}</td>\r\n  </tr>\r\n  <tr>\r\n    <td height='28' class='dtb'>电子邮箱:</td>\r\n    <td class='dtb'>{$infos['email']}</td>\r\n  </tr>\r\n  <tr>\r\n    <td height='28' class='dtb'>官方网址:</td>\r\n    <td class='dtb'>{$infos['url']}</td>\r\n  </tr>\r\n  <tr>\r\n    <td height='28' class='dtb'>使用协议:</td>\r\n    <td class='dtb'><a href='module_main.php?action=showreadme&hash={$hash}' target='_blank'>点击浏览...</a></td>\r\n  </tr>\r\n  <tr>\r\n    <td height='28'>模块包含的文件:<br />(文件路径相对于当前目录)</td><td>&nbsp;</td>\r\n  </tr>\r\n  <tr>\r\n    <td height='164' colspan='2'>\r\n     <textarea name='filelists' id='filelists' style='width:90%;height:200px'>{$filelist}</textarea>\r\n    </td>\r\n  </tr>\r\n</table>\r\n    ";
     $win->AddMsgItem("<div style='padding-left:10px;line-height:150%'>{$msg}</div>");
     $winform = $win->GetWindow('hand', '');
     $win->Display();
     $dm->Clear();
     exit;
 } else {
     if ($action == 'edit') {
         $dm = new DedeModule($mdir);
         $minfos = $dm->GetModuleInfo($hash);
         extract($minfos, EXTR_SKIP);
         if (!isset($lang)) {
             $lang = 'gb2312';
         }
         if (!isset($moduletype)) {
             $moduletype = 'soft';
         }
         $menustring = $dm->GetSystemFile($hash, 'menustring');
         $setupsql40 = htmlspecialchars($dm->GetSystemFile($hash, 'setupsql40'));
         $readmetxt = $dm->GetSystemFile($hash, 'readme');
         $delsql = $dm->GetSystemFile($hash, 'delsql');
         $filelist = $dm->GetSystemFile($hash, 'oldfilelist', false);
         $indexurl = str_replace('**', '=', $indexurl);
         $dm->Clear();
         require_once dirname(__FILE__) . '/templets/module_edit.htm';
예제 #2
0
    ShowMsg($msg, "javascript:;");
    exit;
}
include $moduleCacheFile;
$modules = split(',', $selModule);
$totalMod = count($modules);
if ($step >= $totalMod) {
    $msg = "<font color='red'>完成所有模块的安装!</font><br /><br />";
    $msg .= "<a href='module-install.php?step=9999' target='_top'>点击此进行下一步操作 &gt;&gt;</a>";
    ShowMsg($msg, 'javascript:;');
    exit;
}
$moduleHash = $modules[$step];
$moduleFile = $allmodules[$moduleHash];
$dm = new DedeModule($moduleDir);
$minfos = $dm->GetModuleInfo($moduleHash);
extract($minfos, EXTR_SKIP);
$menustring = addslashes($dm->GetSystemFile($moduleHash, 'menustring'));
$query = "INSERT INTO `#@__sys_module`(`hashcode` , `modname` , `indexname` , `indexurl` , `ismember` , `menustring` )\r\n                                    VALUES ('{$moduleHash}' , '{$name}' , '{$indexname}' , '{$indexurl}' , '{$ismember}' , '{$menustring}' ) ";
$rs = $dsql->ExecuteNoneQuery("Delete From `#@__sys_module` where hashcode like '{$moduleHash}' ");
$rs = $dsql->ExecuteNoneQuery($query);
if (!$rs) {
    $msg = "<font color='red'>保存数据库信息失败,无法完成你选择的模块安装!</font><br /><br />";
    $msg .= "<a href='module-install.php?step=9999' target='_top'>点击此进行下一步操作 &gt;&gt;</a>";
    exit;
}
//写文件
$dm->WriteFiles($moduleHash, 1);
$dm->WriteSystemFile($moduleHash, 'readme');
$setupsql = $dm->GetSystemFile($moduleHash, 'setupsql40');
//运行SQL
예제 #3
0
                 break;
             }
         }
     }
     if ($dedefileindex == -1) {
         unlink($tmpfilename);
         ShowMsg("对不起,你上传的压缩包中不存在dede模块文件!<br /><br /><a href='javascript:history.go(-1);'>&gt;&gt;返回重新上传&gt;&gt;</a>", "javascript:;");
         exit;
     }
     $ziptmp = $mdir . '/ziptmp';
     $z->Extract($tmpfilename, $ziptmp, $dedefileindex);
     unlink($tmpfilename);
     $tmpfilename = $mdir . "/ziptmp/" . $dedefile;
 }
 $dm = new DedeModule($mdir);
 $infos = $dm->GetModuleInfo($tmpfilename, 'file');
 if (empty($infos['hash'])) {
     unlink($tmpfilename);
     $dm->Clear();
     ShowMsg("对不起,你上传的文件可能不是织梦模块的标准格式文件!<br /><br /><a href='javascript:history.go(-1);'>&gt;&gt;返回重新上传&gt;&gt;</a>", "javascript:;");
     exit;
 }
 $okfile = $mdir . '/' . $infos['hash'] . '.xml';
 if ($dm->HasModule($infos['hash']) && empty($delhas)) {
     unlink($tmpfilename);
     $dm->Clear();
     ShowMsg("对不起,你上传的模块已经存在,<br />如果要覆盖请先删除原来版本或选择强制删除的选项!<br /><br /><a href='javascript:history.go(-1);'>&gt;&gt;返回重新上传&gt;&gt;</a>", "javascript:;");
     exit;
 }
 @unlink($okfile);
 copy($tmpfilename, $okfile);
예제 #4
0
 /**
  * caijixia for dedecms
  * @version        $Id: cjx.class.php 112 2013-05-28 01:22:57Z qinjinpeng $
  * @copyright Copyright (c) 2011,caijixia for dedecms,caijixia.com.
  * @license   This is NOT a freeware, use is subject to license terms
  *
  * @param     NULL
  * @return    NULL
 */
 function ac_updatenow()
 {
     require_once DEDEINC . "/dedemodule.class.php";
     $mdir = DEDEDATA . '/module';
     $ver = $this->gv('ver');
     $file = $this->downfile('http://www.dedeapps.com/uploads/onlineupdate/' . $ver . '_' . $this->gv('soft_lang') . '.xml');
     file_put_contents($mdir . '/cjxupdate.xml', $file);
     $dm = new DedeModule($mdir);
     $infos = $dm->GetModuleInfo($mdir . '/cjxupdate.xml', 'file');
     if (empty($infos['hash'])) {
         ShowMsg('升级失败', 1, 2);
         exit;
     }
     copy($mdir . '/cjxupdate.xml', $mdir . '/' . $infos['hash'] . '.xml');
     $dm->WriteFiles($infos['hash'], 1);
     @unlink($mdir . '/cjxupdate.xml');
     @unlink($mdir . '/' . $infos['hash'] . '.xml');
     ShowMsg('升级完成', 1, 2);
 }