|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- <?php
-
- require_once(dirname(__FILE__)."/config.php");
- CheckPurview('sys_MakeHtml');
- require_once(DEDEINC."/archive/partview.class.php");
- if (empty($dopost)) $dopost = '';
- if ($dopost == "view") {
- $pv = new PartView();
- $templet = str_replace("{style}", $cfg_df_style, $templet);
- $pv->SetTemplet($cfg_basedir.$cfg_templets_dir."/".$templet);
- $pv->Display();
- exit();
- } else if ($dopost == "make") {
- if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) {
- $client = new DedeBizClient();
- $data = $client->AdminPWDExists();
- $data = json_decode($data->data);
- if ($data) {
- $rs = (array)($data->result);
- if ($rs["admin_pwd_exists"] == "false") {
-
- if ($dedebiz_admin == "" || $dedebiz_admin !== $re_dedebiz_admin) {
- echo "<link rel=\"stylesheet\" href=\"/static/web/css/bootstrap.min.css\"><style>.modal {position:static}</style>";
- echo "<div class=\"alert alert-warning\">密码不能为空或密码输入错误</div><br>";
- $client->Close();
- exit;
- }
- $data = $client->AdminPWDCreate($dedebiz_admin);
- if ($data->data != "ok") {
- echo "<link rel=\"stylesheet\" href=\"/static/web/css/bootstrap.min.css\"><style>.modal {position:static}</style>";
- echo "<div class=\"alert alert-warning\">密码失败:${$data}</div><br>";
- $client->Close();
- exit;
- }
- } else {
- if ($dedebiz_admin == "") {
- echo "<link rel=\"stylesheet\" href=\"/static/web/css/bootstrap.min.css\"><style>.modal {position:static}</style>";
- echo "<div class=\"alert alert-warning\">密码不能为空</div><br>";
- $client->Close();
- exit;
- }
- $data = $client->AdminSetIndexLockState($dedebiz_admin, $lockindex);
- if ($data->data != "ok") {
- echo "<link rel=\"stylesheet\" href=\"/static/web/css/bootstrap.min.css\"><style>.modal {position:static}</style>";
- echo "<div class=\"alert alert-warning\">密码输入错误,请填写正确密码</div><br>";
- $client->Close();
- exit;
- }
- }
- }
- $client->Close();
- }
- $remotepos = empty($remotepos) ? '../index.html' : $remotepos;
- $serviterm = empty($serviterm) ? "" : $serviterm;
- if (preg_match('#\.(php|pl|cgi|asp|aspx|jsp|php5|php4|php3|shtm|shtml|htm)$#i', trim($position))) {
- ShowMsg("文件扩展名已被系统禁止", "javascript:;");
- exit();
- }
- $homeFile = DEDEADMIN."/".$position;
- $homeFile = str_replace("\\", "/", $homeFile);
- $homeFile = str_replace("//", "/", $homeFile);
- $fp = fopen($homeFile, "w") or die("您指定的文件名有问题,无法创建文件");
- fclose($fp);
- if ($saveset == 1) {
- $iquery = "UPDATE `#@__homepageset` SET templet='$templet',position='$position' ";
- $dsql->ExecuteNoneQuery($iquery);
- }
-
- if ($showmod == 1) {
-
- $templet = str_replace("{style}", $cfg_df_style, $templet);
- $pv = new PartView();
- $GLOBALS['_arclistEnv'] = 'index';
- $pv->SetTemplet($cfg_basedir.$cfg_templets_dir."/".$templet);
- $pv->SaveToHtml($homeFile);
- ShowMsg("更新静态首页,<a href='$position' target='_blank'>点击浏览</a>", "javascript:;");
- } else {
-
- if (file_exists($homeFile)) @unlink($homeFile);
- ShowMsg("更新动态首页,<a href='/index.php' target='_blank'>点击浏览</a>", "javascript:;");
- }
- $iquery = "UPDATE `#@__homepageset` SET showmod='$showmod'";
- $dsql->ExecuteNoneQuery($iquery);
- if ($serviterm == "") {
- $config = array();
- } else {
- list($servurl, $servuser, $servpwd) = explode(',', $serviterm);
- $config = array(
- 'hostname' => $servurl, 'username' => $servuser,
- 'password' => $servpwd, 'debug' => 'TRUE'
- );
- }
- exit();
- }
- $row = $dsql->GetOne("SELECT * FROM `#@__homepageset`");
- include DedeInclude('templets/makehtml_homepage.htm');
- ?>
|