@@ -645,9 +645,7 @@ else if ($dopost == "makekw") { | |||||
$dsql->SetQuery($query); | $dsql->SetQuery($query); | ||||
$dsql->Execute(); | $dsql->Execute(); | ||||
if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) { | if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) { | ||||
$client = new DedeBizClient($cfg_bizcore_hostname, $cfg_bizcore_port); | |||||
$client->appid = $cfg_bizcore_appid; | |||||
$client->key = $cfg_bizcore_key; | |||||
$client = new DedeBizClient(); | |||||
while ($row = $dsql->GetArray()) { | while ($row = $dsql->GetArray()) { | ||||
//跳过已经有关键词文档 | //跳过已经有关键词文档 | ||||
if (trim($row['keywords']) != '') continue; | if (trim($row['keywords']) != '') continue; | ||||
@@ -351,6 +351,12 @@ $actionSearch[9] = array( | |||||
'purview' => 'sys_Edit', | 'purview' => 'sys_Edit', | ||||
'linkurl' => 'sys_info_mark.php' | 'linkurl' => 'sys_info_mark.php' | ||||
), | ), | ||||
5 => array( | |||||
'title' => '云服务设置', | |||||
'description' => '主流云服务平台支持', | |||||
'purview' => 'sys_Edit', | |||||
'linkurl' => 'sys_cloud.php' | |||||
), | |||||
6 => array( | 6 => array( | ||||
'title' => '软件下载设置', | 'title' => '软件下载设置', | ||||
'description' => '软件下载连接显示方式,下载方式,镜像服务器等等进行配置', | 'description' => '软件下载连接显示方式,下载方式,镜像服务器等等进行配置', | ||||
@@ -553,9 +553,7 @@ function AnalyseHtmlBody($body, &$description, &$litpic, &$keywords, $dtype = '' | |||||
//采用DedeBIZ Core分词组件分词 | //采用DedeBIZ Core分词组件分词 | ||||
if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) { | if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) { | ||||
$keywords = ''; | $keywords = ''; | ||||
$client = new DedeBizClient($cfg_bizcore_hostname, $cfg_bizcore_port); | |||||
$client->appid = $cfg_bizcore_appid; | |||||
$client->key = $cfg_bizcore_key; | |||||
$client = new DedeBizClient(); | |||||
$data = $client->Spliteword($subject.Html2Text($message)); | $data = $client->Spliteword($subject.Html2Text($message)); | ||||
$keywords = $data->data; | $keywords = $data->data; | ||||
$client->Close(); | $client->Close(); | ||||
@@ -62,6 +62,7 @@ if ($cuserLogin->getUserType() >= 10) { | |||||
<m:item name='系统用户管理' link='sys_admin_user.php' rank='sys_User' target='main' /> | <m:item name='系统用户管理' link='sys_admin_user.php' rank='sys_User' target='main' /> | ||||
<m:item name='用户组设定' link='sys_group.php' rank='sys_Group' target='main' /> | <m:item name='用户组设定' link='sys_group.php' rank='sys_Group' target='main' /> | ||||
<m:item name='图片水印设置' link='sys_info_mark.php' rank='sys_Edit' target='main' /> | <m:item name='图片水印设置' link='sys_info_mark.php' rank='sys_Edit' target='main' /> | ||||
<m:item name='云服务设置' link='sys_cloud.php' rank='sys_Edit' target='main' /> | |||||
<m:item name='软件下载设置' link='soft_config.php' rank='sys_SoftConfig' target='main' /> | <m:item name='软件下载设置' link='soft_config.php' rank='sys_SoftConfig' target='main' /> | ||||
<m:item name='防采集串混淆' link='article_string_mix.php' rank='sys_StringMix' target='main' /> | <m:item name='防采集串混淆' link='article_string_mix.php' rank='sys_StringMix' target='main' /> | ||||
".(DEDEBIZ_SAFE_MODE? "" : "<m:item name='数据备份还原' link='sys_data.php' rank='sys_Data' target='main' />")." | ".(DEDEBIZ_SAFE_MODE? "" : "<m:item name='数据备份还原' link='sys_data.php' rank='sys_Data' target='main' />")." | ||||
@@ -82,9 +82,7 @@ else if ($dopost == 'setskin') { | |||||
openssl_public_decrypt(base64_decode($cfg_auth_code), $decotent, DEDEPUB); | openssl_public_decrypt(base64_decode($cfg_auth_code), $decotent, DEDEPUB); | ||||
$core_info = new stdClass; | $core_info = new stdClass; | ||||
if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) { | if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) { | ||||
$client = new DedeBizClient($cfg_bizcore_hostname, $cfg_bizcore_port); | |||||
$client->appid = $cfg_bizcore_appid; | |||||
$client->key = $cfg_bizcore_key; | |||||
$client = new DedeBizClient(); | |||||
$core_info = $client->SystemInfo(); | $core_info = $client->SystemInfo(); | ||||
$client->Close(); | $client->Close(); | ||||
} | } | ||||
@@ -20,9 +20,7 @@ if ($dopost == "view") { | |||||
exit(); | exit(); | ||||
} else if ($dopost == "make") { | } else if ($dopost == "make") { | ||||
if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) { | if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) { | ||||
$client = new DedeBizClient($cfg_bizcore_hostname, $cfg_bizcore_port); | |||||
$client->appid = $cfg_bizcore_appid; | |||||
$client->key = $cfg_bizcore_key; | |||||
$client = new DedeBizClient(); | |||||
$data = $client->AdminPWDExists(); | $data = $client->AdminPWDExists(); | ||||
$data = json_decode($data->data); | $data = json_decode($data->data); | ||||
if ($data) { | if ($data) { | ||||
@@ -0,0 +1,65 @@ | |||||
<?php | |||||
/** | |||||
* 云服务配置 | |||||
* | |||||
* @version $id:sys_cloud.php 22:28 2022年12月5日 tianya $ | |||||
* @package DedeBIZ.Administrator | |||||
* @copyright Copyright (c) 2022 DedeBIZ.COM | |||||
* @license https://www.dedebiz.com/license | |||||
* @link https://www.dedebiz.com | |||||
*/ | |||||
require_once(dirname(__FILE__) . "/config.php"); | |||||
CheckPurview('sys_Edit'); | |||||
$dopost = isset($dopost) ? $dopost : ''; | |||||
$client = new DedeBizClient(); | |||||
if ($dopost == "cloud_get") { | |||||
$rs = $client->CloudGet(); | |||||
if ($rs->code === 200) { | |||||
echo json_encode(array( | |||||
"code" => 0, | |||||
"msg" => "", | |||||
"data" => $rs->data, | |||||
)); | |||||
} else { | |||||
echo json_encode(array( | |||||
"code"=>-1, | |||||
"msg"=>'获取配置信息失败', | |||||
)); | |||||
} | |||||
exit; | |||||
} else if($dopost == "cloud_set"){ | |||||
$config = array( | |||||
"aliyun_enabled" => $aliyun_enabled, | |||||
"aliyun_access_key_id" => $aliyun_access_key_id, | |||||
"aliyun_access_key_secret" => $aliyun_access_key_secret, | |||||
"huaweicloud_enabled" => $huaweicloud_enabled, | |||||
"huawei_access_key_id" => $huawei_access_key_id, | |||||
"huawei_secret_access_key" => $huawei_secret_access_key, | |||||
"tencent_enabled" => $tencent_enabled, | |||||
"tencent_secret_id" => $tencent_secret_id, | |||||
"tencent_secret_key" => $tencent_secret_key, | |||||
); | |||||
$rs = $client->CloudSet($config); | |||||
if ($rs->code === 200) { | |||||
echo json_encode(array( | |||||
"code" => 0, | |||||
"msg" => "", | |||||
"data" => "ok", | |||||
)); | |||||
} else { | |||||
echo json_encode(array( | |||||
"code" => -1, | |||||
"msg" => "设置失败,请检查服务是否正确", | |||||
)); | |||||
} | |||||
exit; | |||||
} | |||||
if (!$client->IsEnabled()) { | |||||
echo DedeAlert("商业扩展未启动或连接失败,请检查配置是否正确",ALERT_WARNING); | |||||
exit(); | |||||
} | |||||
include DedeInclude("templets/sys_cloud.htm"); |
@@ -0,0 +1,14 @@ | |||||
<?php | |||||
/** | |||||
* 系统登录配置 | |||||
* | |||||
* @version $id:sys_info.php 22:28 2022年12月5日 tianya $ | |||||
* @package DedeBIZ.Administrator | |||||
* @copyright Copyright (c) 2022 DedeBIZ.COM | |||||
* @license https://www.dedebiz.com/license | |||||
* @link https://www.dedebiz.com | |||||
*/ | |||||
require_once(dirname(__FILE__)."/config.php"); | |||||
CheckPurview('sys_Edit'); | |||||
include DedeInclude("templets/sys_login.htm"); |
@@ -13,187 +13,7 @@ require_once(DEDEINC.'/datalistcp.class.php'); | |||||
CheckPurview('sys_Data'); | CheckPurview('sys_Data'); | ||||
$dopost = (empty($dopost)) ? '' : $dopost; | $dopost = (empty($dopost)) ? '' : $dopost; | ||||
$pid = (empty($pid)) ? 0 : intval($pid); | $pid = (empty($pid)) ? 0 : intval($pid); | ||||
class Array2form | |||||
{ | |||||
var $FormArray = array(); | |||||
var $ArrFromTPL = ''; | |||||
function __construct($formarray = array()) | |||||
{ | |||||
if (count($formarray) > 1) { | |||||
$this->FormArray = $formarray; | |||||
//var_dump($this->FormArray); | |||||
$this->SetDefaultTpl(); | |||||
} | |||||
} | |||||
//获取一个特定项目的表单 | |||||
function GetIterm($itermid = '', $itermtype = 1) | |||||
{ | |||||
$reval = $reval_form = $reval_title = $reval_des = $myformItem = ''; | |||||
if (is_array($this->FormArray)) { | |||||
foreach ($this->FormArray as $key => $val) { | |||||
if ($key == $itermid) { | |||||
$reval_title = $val['title']; | |||||
$reval_des = $val['description']; | |||||
$reval_form = $this->GetForm($key, $val, $val['type']); | |||||
//进行模板标签替换 | |||||
if ($itermtype == 1) | |||||
$reval = preg_replace( | |||||
array("/~title~/", "/~form~/", "/~description~/"), | |||||
array($reval_title, $reval_form, $reval_des), | |||||
$this->ArrFromTPL | |||||
); | |||||
else return $reval_form; | |||||
} | |||||
} | |||||
} else { | |||||
return FALSE; | |||||
} | |||||
return empty($reval) ? '' : $reval; | |||||
} | |||||
function GetForm($key, $formarry = array(), $formtype = 'text') | |||||
{ | |||||
switch ($formtype) { | |||||
case 'text': | |||||
//生成文本修改框 | |||||
$valstr = (empty($formarry['value'])) ? "value=''" : "value='{$formarry['value']}'"; | |||||
$reval_form = "<input type='text' name='{$key}' id='{$key}' class='admin-input-md' {$valstr}>"; | |||||
break; | |||||
case 'select': | |||||
//生成选择框 | |||||
$reval_title = $formarry['title']; | |||||
$items = explode(',', $formarry['iterm']); | |||||
$reval_form = "<select name='{$key}' class='admin-input-xs'>"; | |||||
if (is_array($items)) { | |||||
foreach ($items as $v) { | |||||
$v = trim($v); | |||||
if ($v == '') continue; | |||||
//统一中文冒号转为英文 | |||||
$v = str_replace(":", ":", $v); | |||||
if (preg_match("/[\:]/", $v)) { | |||||
list($value, $name) = preg_split('#:#', $v); | |||||
$reval_form .= ($formarry['value'] == $value) ? "<option value='$value' selected>$name</option>\r\n" : "<option value='$value'>$name</option>\r\n"; | |||||
} else { | |||||
$reval_form .= ($formarry['value'] == $v) ? "<option value='$v' selected>$v</option>\r\n" : "<option value='$v'>$v</option>\r\n"; | |||||
} | |||||
} | |||||
} | |||||
$reval_form .= "</select>\r\n"; | |||||
break; | |||||
} | |||||
return $reval_form; | |||||
} | |||||
//获取所有的表单文档 | |||||
function GetAll() | |||||
{ | |||||
$reval = empty($reval) ? '' : $reval; | |||||
if (is_array($this->FormArray)) { | |||||
foreach ($this->FormArray as $key => $val) { | |||||
$reval .= $this->GetIterm($key); | |||||
} | |||||
return $reval; | |||||
} else { | |||||
return FALSE; | |||||
} | |||||
} | |||||
//获取一个特定项目的表单 | |||||
function SetDefaultTpl($tplname = '') | |||||
{ | |||||
if (empty($tplname)) { | |||||
$this->ArrFromTPL = '<p>~title~:~form~<small>~description~</small></p>'; | |||||
} else { | |||||
if (file_exists($tplname)) $this->ArrFromTPL = file_get_contents($tplname); | |||||
else $this->ArrFromTPL = $tplname; | |||||
} | |||||
} | |||||
} | |||||
$tplstring = " | |||||
<tr> | |||||
<td align='center'>~title~:</td> | |||||
<td>~form~ <small>~description~</small></td> | |||||
</tr> | |||||
"; | |||||
//安装支付接口 | |||||
if ($dopost == 'install') { | |||||
$row = $dsql->GetOne("SELECT * FROM `#@__payment` WHERE id='$pid'"); | |||||
if (is_array($row)) { | |||||
if ($cfg_soft_lang == 'utf-8') { | |||||
$config_row = AutoCharset(unserialize(utf82gb($row['config']))); | |||||
} else if ($cfg_soft_lang == 'gb2312') { | |||||
$config_row = unserialize($row['config']); | |||||
} | |||||
//print_r($config_row);exit; | |||||
$af = new Array2form($config_row); | |||||
$af->SetDefaultTpl($tplstring); | |||||
$reval = $af->GetAll(); | |||||
} | |||||
include DedeInclude('templets/sys_payment_install.htm'); | |||||
exit; | |||||
} | |||||
//配置支付接口 | |||||
else if ($dopost == 'config') { | |||||
if ($pay_name == "" || $pay_desc == "" || $pay_fee == "") { | |||||
ShowMsg("您有未填写的项目", "-1"); | |||||
exit(); | |||||
} | |||||
$row = $dsql->GetOne("SELECT * FROM `#@__payment` WHERE id='$pid'"); | |||||
if ($cfg_soft_lang == 'utf-8') { | |||||
$config = AutoCharset(unserialize(utf82gb($row['config']))); | |||||
} else if ($cfg_soft_lang == 'gb2312') { | |||||
$config = unserialize($row['config']); | |||||
} | |||||
$payments = "'code' => '".$row['code']."',"; | |||||
foreach ($config as $key => $v) { | |||||
$config[$key]['value'] = ${$key}; | |||||
$payments .= "'".$key."' => '".$config[$key]['value']."',"; | |||||
} | |||||
$payments = substr($payments, 0, -1); | |||||
$payment = "\$payment=array(".$payments.")"; | |||||
$configstr = "<"."?php\r\n".$payment."\r\n?".">\r\n"; | |||||
if (!empty($payment)) { | |||||
$m_file = DEDEDATA."/payment/".$row['code'].".php"; | |||||
$fp = fopen($m_file, "w") or die("写入文件 $safeconfigfile 失败,请检查权限"); | |||||
fwrite($fp, $configstr); | |||||
fclose($fp); | |||||
} | |||||
if ($cfg_soft_lang == 'utf-8') { | |||||
$config = AutoCharset($config, 'utf-8', 'gb2312'); | |||||
$config = serialize($config); | |||||
$config = gb2utf8($config); | |||||
} else { | |||||
$config = serialize($config); | |||||
} | |||||
$query = "UPDATE `#@__payment` SET name = '$pay_name',fee='$pay_fee',description='$pay_desc',config='$config',enabled='1' WHERE id='$pid'"; | |||||
$dsql->ExecuteNoneQuery($query); | |||||
if ($pm == 'edit') $msg = "保存修改成功"; | |||||
else $msg = "安装成功"; | |||||
ShowMsg($msg, "sys_payment.php"); | |||||
exit(); | |||||
} | |||||
//删除支付接口 | |||||
else if ($dopost == 'uninstall') { | |||||
$row = $dsql->GetOne("SELECT * FROM `#@__payment` WHERE id='$pid'"); | |||||
if ($cfg_soft_lang == 'utf-8') { | |||||
$config = AutoCharset(unserialize(utf82gb($row['config']))); | |||||
} else if ($cfg_soft_lang == 'gb2312') { | |||||
$config = unserialize($row['config']); | |||||
} | |||||
foreach ($config as $key => $v) $config[$key]['value'] = ""; | |||||
if ($cfg_soft_lang == 'utf-8') { | |||||
$config = AutoCharset($config, 'utf-8', 'gb2312'); | |||||
$config = serialize($config); | |||||
$config = gb2utf8($config); | |||||
} else { | |||||
$config = serialize($config); | |||||
} | |||||
$query = "UPDATE `#@__payment` SET fee='',config='$config',enabled='0' WHERE id='$pid'"; | |||||
$dsql->ExecuteNoneQuery($query); | |||||
//同时需要删除对应的缓存 | |||||
$m_file = DEDEDATA."/payment/".$row['code'].".php"; | |||||
@unlink($m_file); | |||||
ShowMsg("删除成功", "sys_payment.php"); | |||||
exit(); | |||||
} | |||||
$sql = "SELECT * FROM `#@__payment` ORDER BY `rank` ASC"; | $sql = "SELECT * FROM `#@__payment` ORDER BY `rank` ASC"; | ||||
$dlist = new DataListCP(); | $dlist = new DataListCP(); | ||||
$dlist->SetTemplet(DEDEADMIN."/templets/sys_payment.htm"); | $dlist->SetTemplet(DEDEADMIN."/templets/sys_payment.htm"); | ||||
@@ -57,9 +57,7 @@ | |||||
</tr> | </tr> | ||||
<?php | <?php | ||||
if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) { | if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) { | ||||
$client = new DedeBizClient($cfg_bizcore_hostname, $cfg_bizcore_port); | |||||
$client->appid = $cfg_bizcore_appid; | |||||
$client->key = $cfg_bizcore_key; | |||||
$client = new DedeBizClient(); | |||||
$data = $client->AdminPWDExists(); | $data = $client->AdminPWDExists(); | ||||
if ($data->code == -1){ | if ($data->code == -1){ | ||||
?> | ?> | ||||
@@ -0,0 +1,195 @@ | |||||
<!DOCTYPE html> | |||||
<html> | |||||
<head> | |||||
<meta charset="utf-8"> | |||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"> | |||||
<title>云服务设置</title> | |||||
<link rel="stylesheet" href="../static/web/font/css/font-awesome.min.css"> | |||||
<link rel="stylesheet" href="../static/web/css/bootstrap.min.css"> | |||||
<link rel="stylesheet" href="../static/web/css/admin.css"> | |||||
<script src="../static/web/js/jquery.min.js"></script> | |||||
<script src="../static/web/js/bootstrap.bundle.min.js"></script> | |||||
<script src="js/main.js"></script> | |||||
</head> | |||||
<body> | |||||
<table cellpadding="3" cellspacing="1" align="center" class="table maintable my-3"> | |||||
<tr> | |||||
<td bgcolor="#f5f5f5" colspan="4"> | |||||
<table cellspacing="0" cellpadding="0" class="table table-borderless w-100"> | |||||
<tr> | |||||
<td>云服务设置</td> | |||||
<!-- <td align="right"><span><a href="https://www.dedebiz.com/help" target="_blank" | |||||
class="btn btn-success btn-sm">更多云服务</a></span></td> --> | |||||
</tr> | |||||
</table> | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td colspan="4"> | |||||
<ul class="nav nav-tabs" id="myTab" role="tablist"> | |||||
<li class="nav-item" role="presentation"> | |||||
<button class="nav-link active" id="aliyun-tab" data-toggle="tab" data-target="#aliyun" | |||||
type="button" role="tab" aria-controls="aliyun" aria-selected="true">阿里云</button> | |||||
</li> | |||||
<li class="nav-item" role="presentation"> | |||||
<button class="nav-link" id="huaweicloud-tab" data-toggle="tab" data-target="#huaweicloud" | |||||
type="button" role="tab" aria-controls="huaweicloud" aria-selected="false">华为云</button> | |||||
</li> | |||||
<li class="nav-item" role="presentation"> | |||||
<button class="nav-link" id="tencent-tab" data-toggle="tab" data-target="#tencent" type="button" | |||||
role="tab" aria-controls="tencent" aria-selected="false">腾讯云</button> | |||||
</li> | |||||
</ul> | |||||
<div class="tab-content py-3" id="myTabContent"> | |||||
<div class="tab-pane fade show active" id="aliyun" role="tabpanel" aria-labelledby="aliyun-tab"> | |||||
<div class="form-group"> | |||||
<label for="iptAppID">描述</label> | |||||
<p> | |||||
阿里巴巴集团旗下公司,是全球领先的云计算及人工智能科技公司之一。提供免费试用、云服务器、云数据库、云安全、云企业应用等云计算服务,以及大数据、人工智能服务、精准定制基于场景的行业解决方案。免费备案,7x24小时售后支持,助企业无忧上云。 | |||||
</p> | |||||
</div> | |||||
<div class="form-group"> | |||||
<label for="iptAliyunAccessKeyID">AccessKey ID</label> | |||||
<input type="text" class="form-control" id="iptAliyunAccessKeyID"> | |||||
</div> | |||||
<div class="form-group"> | |||||
<label for="iptAliyunAccessKeySecret ">AccessKey Secret</label> | |||||
<input type="text" class="form-control" id="iptAliyunAccessKeySecret"> | |||||
</div> | |||||
<div class="form-group form-check"> | |||||
<input type="checkbox" class="form-check-input" id="cloudType1"> | |||||
<label class="form-check-label" for="cloudType1">是否启用</label> | |||||
</div> | |||||
</div> | |||||
<div class="tab-pane fade" id="huaweicloud" role="tabpanel" aria-labelledby="huaweicloud-tab"> | |||||
<div class="form-group"> | |||||
<label for="iptAppID">描述</label> | |||||
<p> | |||||
华为云提供稳定可靠、安全可信、可持续发展的云服务,致力于让云无处不在,让智能无所不及,共建智能世界云底座。助力企业降本增效,全球300万客户的共同选择。7x24小时专业服务支持,5天内无理由退订,免费快速备案。 | |||||
</p> | |||||
</div> | |||||
<div class="form-group"> | |||||
<label for="iptHuaweicloudAccessKeyId">Access Key Id</label> | |||||
<input type="text" class="form-control" id="iptHuaweicloudAccessKeyId"> | |||||
</div> | |||||
<div class="form-group"> | |||||
<label for="iptHuaweicloudSecretAccessKey">Secret Access Key</label> | |||||
<input type="text" class="form-control" id="iptHuaweicloudSecretAccessKey"> | |||||
</div> | |||||
<div class="form-group form-check"> | |||||
<input type="checkbox" class="form-check-input" id="cloudType2"> | |||||
<label class="form-check-label" for="cloudType2">是否启用</label> | |||||
</div> | |||||
</div> | |||||
<div class="tab-pane fade" id="tencent" role="tabpanel" aria-labelledby="tencent-tab"> | |||||
<div class="form-group"> | |||||
<label for="iptAppID">描述</label> | |||||
<p> | |||||
腾讯云为数百万的企业和开发者提供安全稳定的云计算服务,涵盖云服务器、云数据库、云存储、视频与CDN、域名注册等全方位云服务和各行业解决方案。 | |||||
</p> | |||||
</div> | |||||
<div class="form-group"> | |||||
<label for="iptTencentSecretId">SecretId</label> | |||||
<input type="text" class="form-control" id="iptTencentSecretId"> | |||||
</div> | |||||
<div class="form-group"> | |||||
<label for="iptTencentSecretKey">SecretKey</label> | |||||
<input type="text" class="form-control" id="iptTencentSecretKey"> | |||||
</div> | |||||
<div class="form-group form-check"> | |||||
<input type="checkbox" class="form-check-input" id="cloudType3"> | |||||
<label class="form-check-label" for="cloudType3">是否启用</label> | |||||
</div> | |||||
</div> | |||||
<button id="btnSave" type="submit" class="btn btn-success">保存</button> | |||||
</div> | |||||
</td> | |||||
</tr> | |||||
</table> | |||||
<script> | |||||
var cloudConfig = { | |||||
aliyun_enabled: false, | |||||
aliyun_access_key_id: '', | |||||
aliyun_access_key_secret: '', | |||||
huaweicloud_enabled: false, | |||||
huawei_access_key_id: '', | |||||
huawei_secret_access_key: '', | |||||
tencent_enabled: false, | |||||
tencent_secret_id: '', | |||||
tencent_secret_key: '', | |||||
}; | |||||
function LoadConfig() { | |||||
$.get("sys_cloud.php?dopost=cloud_get", function (data) { | |||||
try { | |||||
rs = JSON.parse(data); | |||||
if (rs.code === 0) { | |||||
cloudConfig = JSON.parse(rs.data); | |||||
if (cloudConfig.aliyun_enabled) { | |||||
$("#cloudType1").prop("checked", true); | |||||
} else { | |||||
$("#cloudType1").prop("checked", false); | |||||
} | |||||
$("#iptAliyunAccessKeyID").val(cloudConfig.aliyun_access_key_id); | |||||
$("#iptAliyunAccessKeySecret").val(cloudConfig.aliyun_access_key_secret); | |||||
if (cloudConfig.huaweicloud_enabled) { | |||||
$("#cloudType2").prop("checked", true); | |||||
} else { | |||||
$("#cloudType2").prop("checked", false); | |||||
} | |||||
$("#iptHuaweicloudAccessKeyId").val(cloudConfig.huawei_access_key_id); | |||||
$("#iptHuaweicloudSecretAccessKey").val(cloudConfig.huawei_secret_access_key); | |||||
if (cloudConfig.tencent_enabled) { | |||||
$("#cloudType3").prop("checked", true); | |||||
} else { | |||||
$("#cloudType3").prop("checked", false); | |||||
} | |||||
$("#iptTencentSecretId").val(cloudConfig.tencent_secret_id); | |||||
$("#iptTencentSecretKey").val(cloudConfig.tencent_secret_key); | |||||
} | |||||
} catch (error) { | |||||
console.log("解析配置失败") | |||||
} | |||||
}); | |||||
} | |||||
$(document).ready(function () { | |||||
$("#btnSave").click(function () { | |||||
if ($("#cloudType1").is(":checked")) { | |||||
cloudConfig.aliyun_enabled = true; | |||||
} else { | |||||
cloudConfig.aliyun_enabled = false; | |||||
} | |||||
cloudConfig.aliyun_access_key_id = $("#iptAliyunAccessKeyID").val(); | |||||
cloudConfig.aliyun_access_key_secret = $("#iptAliyunAccessKeySecret").val(); | |||||
if ($("#cloudType2").is(":checked")) { | |||||
cloudConfig.huaweicloud_enabled = true; | |||||
} else { | |||||
cloudConfig.huaweicloud_enabled = false; | |||||
} | |||||
cloudConfig.huawei_access_key_id = $("#iptHuaweicloudAccessKeyId").val(); | |||||
cloudConfig.huawei_secret_access_key = $("#iptHuaweicloudSecretAccessKey").val(); | |||||
if ($("#cloudType3").is(":checked")) { | |||||
cloudConfig.tencent_enabled = true; | |||||
} else { | |||||
cloudConfig.tencent_enabled = false; | |||||
} | |||||
cloudConfig.tencent_secret_id = $("#iptTencentSecretId").val(); | |||||
cloudConfig.tencent_secret_key = $("#iptTencentSecretKey").val(); | |||||
$.post("sys_cloud.php?dopost=cloud_set", cloudConfig, function (result) { | |||||
let data = JSON.parse(result); | |||||
if (data.code === 0) { | |||||
ShowMsg("云服务设置成功"); | |||||
LoadConfig(); | |||||
} else { | |||||
ShowMsg("设置失败,请检查服务是否正确"); | |||||
} | |||||
}); | |||||
}) | |||||
LoadConfig(); | |||||
}) | |||||
</script> | |||||
</body> | |||||
</html> |
@@ -0,0 +1,151 @@ | |||||
<!DOCTYPE html> | |||||
<html> | |||||
<head> | |||||
<meta charset="utf-8"> | |||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"> | |||||
<title>登录设置</title> | |||||
<link rel="stylesheet" href="../static/web/font/css/font-awesome.min.css"> | |||||
<link rel="stylesheet" href="../static/web/css/bootstrap.min.css"> | |||||
<link rel="stylesheet" href="../static/web/css/admin.css"> | |||||
<script src="../static/web/js/jquery.min.js"></script> | |||||
<script src="../static/web/js/bootstrap.bundle.min.js"></script> | |||||
</head> | |||||
<body> | |||||
<table cellpadding="3" cellspacing="1" align="center" class="table maintable my-3"> | |||||
<tr> | |||||
<td bgcolor="#f5f5f5" colspan="4"> | |||||
<table cellspacing="0" cellpadding="0" class="table table-borderless w-100"> | |||||
<tr> | |||||
<td>用户登录设置</td> | |||||
<td align="right"><span><a href="https://www.dedebiz.com/help" target="_blank" | |||||
class="btn btn-success btn-sm">更多接口</a></span></td> | |||||
</tr> | |||||
</table> | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td colspan="4"> | |||||
<form> | |||||
<div class="form-group"> | |||||
<label for="iptAppID">登录方式</label> | |||||
<div class="form-check form-check-inline"> | |||||
<input name="loginType" class="form-check-input" type="checkbox" id="loginType1" value="option1" checked disabled> | |||||
<label class="form-check-label" for="loginType1">用户名密码</label> | |||||
</div> | |||||
<div class="form-check form-check-inline"> | |||||
<input name="loginType" class="form-check-input" type="checkbox" id="loginType2" value="option2"> | |||||
<label class="form-check-label" for="loginType2">手机验证码</label> | |||||
</div> | |||||
<div class="form-check form-check-inline"> | |||||
<input name="loginType" class="form-check-input" type="checkbox" id="loginType3" value="option2"> | |||||
<label class="form-check-label" for="loginType3">微信登录</label> | |||||
</div> | |||||
<div class="form-check form-check-inline"> | |||||
<input name="loginType" class="form-check-input" type="checkbox" id="loginType4" value="option2"> | |||||
<label class="form-check-label" for="loginType4">抖音登录</label> | |||||
</div> | |||||
</div> | |||||
</form> | |||||
<ul class="nav nav-tabs" id="myTab" role="tablist"> | |||||
<li class="nav-item" role="presentation"> | |||||
<button class="nav-link" id="alipay-tab" data-toggle="tab" data-target="#alipay" type="button" | |||||
role="tab" aria-controls="alipay" aria-selected="false">手机验证码</button> | |||||
</li> | |||||
<li class="nav-item" role="presentation"> | |||||
<button class="nav-link" id="bank-tab" data-toggle="tab" data-target="#bank" type="button" | |||||
role="tab" aria-controls="bank" aria-selected="false">微信登录</button> | |||||
</li> | |||||
<li class="nav-item" role="presentation"> | |||||
<button class="nav-link" id="balance-tab" data-toggle="tab" data-target="#balance" type="button" | |||||
role="tab" aria-controls="balance" aria-selected="false">抖音登录</button> | |||||
</li> | |||||
</ul> | |||||
<div class="tab-content py-3" id="myTabContent"> | |||||
<div class="tab-pane fade show active" id="wechat" role="tabpanel" aria-labelledby="wechat-tab"> | |||||
<form> | |||||
<div class="form-group form-check"> | |||||
<input type="checkbox" class="form-check-input" id="exampleCheck1"> | |||||
<label class="form-check-label" for="exampleCheck1">是否启用</label> | |||||
</div> | |||||
</form> | |||||
</div> | |||||
<div class="tab-pane fade" id="alipay" role="tabpanel" aria-labelledby="alipay-tab"> | |||||
<form> | |||||
<div class="form-group"> | |||||
<label for="iptAppID">APPID</label> | |||||
<input type="appid" class="form-control" id="iptAppID"> | |||||
</div> | |||||
<div class="form-group"> | |||||
<label for="iptAppSecret">应用私钥</label> | |||||
<input type="appid" class="form-control" id="iptAppSecret"> | |||||
</div> | |||||
<div class="form-group"> | |||||
<label for="iptAppSecret">应用公钥证书</label> | |||||
<input type="appid" class="form-control" id="iptAppSecret"> | |||||
</div> | |||||
<div class="form-group"> | |||||
<label for="iptAppSecret">支付宝公钥证书</label> | |||||
<input type="appid" class="form-control" id="iptAppSecret"> | |||||
</div> | |||||
<div class="form-group"> | |||||
<label for="iptAppSecret">支付宝根证书</label> | |||||
<input type="appid" class="form-control" id="iptAppSecret"> | |||||
</div> | |||||
<div class="form-group"> | |||||
<label for="iptAppSecret">签名类型</label> | |||||
<input type="appid" class="form-control" id="iptAppSecret"> | |||||
</div> | |||||
<div class="form-group form-check"> | |||||
<input type="checkbox" class="form-check-input" id="exampleCheck1"> | |||||
<label class="form-check-label" for="exampleCheck1">是否启用</label> | |||||
</div> | |||||
</form> | |||||
</div> | |||||
<div class="tab-pane fade" id="bank" role="tabpanel" aria-labelledby="bank-tab"> | |||||
<form> | |||||
<div class="form-group"> | |||||
<label for="iptAppID">账户名</label> | |||||
<input type="appid" class="form-control" id="iptAppID"> | |||||
</div> | |||||
<div class="form-group"> | |||||
<label for="iptAppSecret">账号</label> | |||||
<input type="appid" class="form-control" id="iptAppSecret"> | |||||
</div> | |||||
<div class="form-group"> | |||||
<label for="iptAppSecret">开户行</label> | |||||
<input type="appid" class="form-control" id="iptAppSecret"> | |||||
</div> | |||||
<div class="form-group form-check"> | |||||
<input type="checkbox" class="form-check-input" id="exampleCheck1"> | |||||
<label class="form-check-label" for="exampleCheck1">是否启用</label> | |||||
</div> | |||||
</form> | |||||
</div> | |||||
<div class="tab-pane fade" id="balance" role="tabpanel" aria-labelledby="balance-tab"> | |||||
<form> | |||||
<div class="form-group form-check"> | |||||
<input type="checkbox" class="form-check-input" id="exampleCheck1"> | |||||
<label class="form-check-label" for="exampleCheck1">是否启用</label> | |||||
</div> | |||||
</form> | |||||
</div> | |||||
<div class="tab-pane fade" id="cod" role="tabpanel" aria-labelledby="cod-tab"> | |||||
<form> | |||||
<div class="form-group form-check"> | |||||
<input type="checkbox" class="form-check-input" id="exampleCheck1"> | |||||
<label class="form-check-label" for="exampleCheck1">是否启用</label> | |||||
</div> | |||||
</form> | |||||
</div> | |||||
<button type="submit" class="btn btn-success">保存</button> | |||||
</div> | |||||
</td> | |||||
</tr> | |||||
</table> | |||||
</body> | |||||
</html> |
@@ -1,52 +1,180 @@ | |||||
<!DOCTYPE html> | <!DOCTYPE html> | ||||
<html> | <html> | ||||
<head> | |||||
<meta charset="utf-8"> | |||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"> | |||||
<title>支付接口设置</title> | |||||
<link rel="stylesheet" href="../static/web/font/css/font-awesome.min.css"> | |||||
<link rel="stylesheet" href="../static/web/css/bootstrap.min.css"> | |||||
<link rel="stylesheet" href="../static/web/css/admin.css"> | |||||
</head> | |||||
<body> | |||||
<table cellpadding="3" cellspacing="1" align="center" class="table maintable my-3"> | |||||
<tr> | |||||
<td bgcolor="#f5f5f5" colspan="4"> | |||||
<table cellspacing="0" cellpadding="0" class="table table-borderless w-100"> | |||||
<tr> | |||||
<td>支付接口设置</td> | |||||
<td align="right"><span><a href="https://www.dedebiz.com/help" target="_blank" class="btn btn-success btn-sm">更多接口</a></span></td> | |||||
</tr> | |||||
</table> | |||||
</td> | |||||
</tr> | |||||
<tr bgcolor="#e9ecef" align="center"> | |||||
<td width="20%">支付方式</td> | |||||
<td width="40%">描述</td> | |||||
<td width="10%">排序</td> | |||||
<td width="20%">管理</td> | |||||
</tr> | |||||
{dede:datalist empty='<tr><td colspan="4" align="center">暂无文档</td></tr>'} | |||||
<tr align="center" onmousemove="javascript:this.bgColor='#e9ecef';" onmouseout="javascript:this.bgColor='#ffffff';"> | |||||
<td>{dede:field.name/}</td> | |||||
<td align="left">{dede:field.description/}</td> | |||||
<td>{dede:field.rank/}</td> | |||||
<td> | |||||
<?php if ($fields['enabled'] == 0) {?> | |||||
<a class='btn btn-success btn-sm' href='sys_payment.php?dopost=install&pid={dede:field.id/}'>安装</a> | |||||
<?php | |||||
} | |||||
if ($fields['enabled'] == 1) { | |||||
?> | |||||
<a class='btn btn-success btn-sm' href='sys_payment.php?dopost=install&pid={dede:field.id/}&pm=edit'>修改</a> | |||||
<a class='btn btn-success btn-sm' href='sys_payment.php?dopost=uninstall&pid={dede:field.id/}'>删除</a> | |||||
<?php }?> | |||||
</td> | |||||
</tr> | |||||
{/dede:datalist} | |||||
<tr> | |||||
<td bgcolor="#f5f5f5" align="center" colspan="4">{dede:pagelist listsize='6'/}</td> | |||||
</tr> | |||||
</table> | |||||
</body> | |||||
<head> | |||||
<meta charset="utf-8"> | |||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"> | |||||
<title>支付接口设置</title> | |||||
<link rel="stylesheet" href="../static/web/font/css/font-awesome.min.css"> | |||||
<link rel="stylesheet" href="../static/web/css/bootstrap.min.css"> | |||||
<link rel="stylesheet" href="../static/web/css/admin.css"> | |||||
<script src="../static/web/js/jquery.min.js"></script> | |||||
<script src="../static/web/js/bootstrap.bundle.min.js"></script> | |||||
</head> | |||||
<body> | |||||
<table cellpadding="3" cellspacing="1" align="center" class="table maintable my-3"> | |||||
<tr> | |||||
<td bgcolor="#f5f5f5" colspan="4"> | |||||
<table cellspacing="0" cellpadding="0" class="table table-borderless w-100"> | |||||
<tr> | |||||
<td>支付接口设置</td> | |||||
<td align="right"><span><a href="https://www.dedebiz.com/help" target="_blank" | |||||
class="btn btn-success btn-sm">更多接口</a></span></td> | |||||
</tr> | |||||
</table> | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td colspan="4"> | |||||
<ul class="nav nav-tabs" id="myTab" role="tablist"> | |||||
<li class="nav-item" role="presentation"> | |||||
<button class="nav-link active" id="wechat-tab" data-toggle="tab" data-target="#wechat" | |||||
type="button" role="tab" aria-controls="wechat" aria-selected="true">微信支付</button> | |||||
</li> | |||||
<li class="nav-item" role="presentation"> | |||||
<button class="nav-link" id="alipay-tab" data-toggle="tab" data-target="#alipay" type="button" | |||||
role="tab" aria-controls="alipay" aria-selected="false">支付宝</button> | |||||
</li> | |||||
<li class="nav-item" role="presentation"> | |||||
<button class="nav-link" id="bank-tab" data-toggle="tab" data-target="#bank" type="button" | |||||
role="tab" aria-controls="bank" aria-selected="false">银行转帐</button> | |||||
</li> | |||||
<li class="nav-item" role="presentation"> | |||||
<button class="nav-link" id="balance-tab" data-toggle="tab" data-target="#balance" type="button" | |||||
role="tab" aria-controls="balance" aria-selected="false">余额支付</button> | |||||
</li> | |||||
<li class="nav-item" role="presentation"> | |||||
<button class="nav-link" id="cod-tab" data-toggle="tab" data-target="#cod" type="button" | |||||
role="tab" aria-controls="cod" aria-selected="false">货到付款</button> | |||||
</li> | |||||
</ul> | |||||
<div class="tab-content py-3" id="myTabContent"> | |||||
<div class="tab-pane fade show active" id="wechat" role="tabpanel" aria-labelledby="wechat-tab"> | |||||
<form> | |||||
<div class="form-group"> | |||||
<label>描述</label> | |||||
<p> | |||||
微信支付是腾讯公司的支付业务品牌,微信支付商户平台支持线下场所、公众号、小程序、PC网站、APP、企业微信等经营场景快速接入微信支付。微信支付全面打通O2O生活消费领域,提供专业的互联网+行业解决方案,微信支付支持微信红包和微信理财通,是移动支付的首选。 | |||||
</p> | |||||
</div> | |||||
<div class="form-group"> | |||||
<label for="iptAppID">AppID</label> | |||||
<input type="appid" class="form-control" id="iptAppID"> | |||||
</div> | |||||
<div class="form-group"> | |||||
<label for="iptAppSecret">AppSecret</label> | |||||
<input type="appid" class="form-control" id="iptAppSecret"> | |||||
</div> | |||||
<div class="form-group"> | |||||
<label for="iptAppSecret">商户号</label> | |||||
<input type="appid" class="form-control" id="iptAppSecret"> | |||||
</div> | |||||
<div class="form-group"> | |||||
<label for="iptAppSecret">APIv3秘钥</label> | |||||
<input type="appid" class="form-control" id="iptAppSecret"> | |||||
</div> | |||||
<div class="form-group"> | |||||
<label for="iptAppSecret">商户证书序列号</label> | |||||
<input type="appid" class="form-control" id="iptAppSecret"> | |||||
</div> | |||||
<div class="form-group"> | |||||
<label for="iptAppSecret">商户证书文件</label> | |||||
<div class="custom-file"> | |||||
<input type="file" class="custom-file-input" id="validatedInputGroupCustomFile" required> | |||||
<label class="custom-file-label" for="validatedInputGroupCustomFile">选择商户证书文件...</label> | |||||
</div> | |||||
</div> | |||||
<div class="form-group form-check"> | |||||
<input type="checkbox" class="form-check-input" id="exampleCheck1"> | |||||
<label class="form-check-label" for="exampleCheck1">是否启用</label> | |||||
</div> | |||||
<button type="submit" class="btn btn-success">保存</button> | |||||
</form> | |||||
</div> | |||||
<div class="tab-pane fade" id="alipay" role="tabpanel" aria-labelledby="alipay-tab"> | |||||
<form> | |||||
<div class="form-group"> | |||||
<label for="iptAppID">描述</label> | |||||
<p> | |||||
支付宝,全球领先的独立第三方支付平台,致力于为广大用户提供安全快速的电子支付/网上支付/安全支付/手机支付体验,及转账收款/水电煤缴费/信用卡还款/AA收款等生活服务应用。 | |||||
</p> | |||||
</div> | |||||
<div class="form-group"> | |||||
<label for="iptAppID">APPID</label> | |||||
<input type="appid" class="form-control" id="iptAppID"> | |||||
</div> | |||||
<div class="form-group"> | |||||
<label for="iptAppSecret">应用私钥</label> | |||||
<input type="appid" class="form-control" id="iptAppSecret"> | |||||
</div> | |||||
<div class="form-group"> | |||||
<label for="iptAppSecret">应用公钥证书</label> | |||||
<input type="appid" class="form-control" id="iptAppSecret"> | |||||
</div> | |||||
<div class="form-group"> | |||||
<label for="iptAppSecret">支付宝公钥证书</label> | |||||
<input type="appid" class="form-control" id="iptAppSecret"> | |||||
</div> | |||||
<div class="form-group"> | |||||
<label for="iptAppSecret">支付宝根证书</label> | |||||
<input type="appid" class="form-control" id="iptAppSecret"> | |||||
</div> | |||||
<div class="form-group"> | |||||
<label for="iptAppSecret">签名类型</label> | |||||
<input type="appid" class="form-control" id="iptAppSecret" value="RSA2" disabled> | |||||
</div> | |||||
<div class="form-group form-check"> | |||||
<input type="checkbox" class="form-check-input" id="exampleCheck1"> | |||||
<label class="form-check-label" for="exampleCheck1">是否启用</label> | |||||
</div> | |||||
<button type="submit" class="btn btn-success">保存</button> | |||||
</form> | |||||
</div> | |||||
<div class="tab-pane fade" id="bank" role="tabpanel" aria-labelledby="bank-tab"> | |||||
<form> | |||||
<div class="form-group"> | |||||
<label for="iptAppID">账户名</label> | |||||
<input type="appid" class="form-control" id="iptAppID"> | |||||
</div> | |||||
<div class="form-group"> | |||||
<label for="iptAppSecret">账号</label> | |||||
<input type="appid" class="form-control" id="iptAppSecret"> | |||||
</div> | |||||
<div class="form-group"> | |||||
<label for="iptAppSecret">开户行</label> | |||||
<input type="appid" class="form-control" id="iptAppSecret"> | |||||
</div> | |||||
<div class="form-group form-check"> | |||||
<input type="checkbox" class="form-check-input" id="exampleCheck1"> | |||||
<label class="form-check-label" for="exampleCheck1">是否启用</label> | |||||
</div> | |||||
<button type="submit" class="btn btn-success">保存</button> | |||||
</form> | |||||
</div> | |||||
<div class="tab-pane fade" id="balance" role="tabpanel" aria-labelledby="balance-tab"> | |||||
<form> | |||||
<div class="form-group form-check"> | |||||
<input type="checkbox" class="form-check-input" id="exampleCheck1"> | |||||
<label class="form-check-label" for="exampleCheck1">是否启用</label> | |||||
</div> | |||||
<button type="submit" class="btn btn-success">保存</button> | |||||
</form> | |||||
</div> | |||||
<div class="tab-pane fade" id="cod" role="tabpanel" aria-labelledby="cod-tab"> | |||||
<form> | |||||
<div class="form-group form-check"> | |||||
<input type="checkbox" class="form-check-input" id="exampleCheck1"> | |||||
<label class="form-check-label" for="exampleCheck1">是否启用</label> | |||||
</div> | |||||
<button type="submit" class="btn btn-success">保存</button> | |||||
</form> | |||||
</div> | |||||
</div> | |||||
</td> | |||||
</tr> | |||||
</table> | |||||
</body> | |||||
</html> | </html> |
@@ -42,9 +42,7 @@ else if ($action == 'send') { | |||||
$mailbody .= "Powered by DedeBIZ"; | $mailbody .= "Powered by DedeBIZ"; | ||||
$headers = "From: ".$cfg_adminemail."\r\nReply-To: ".$cfg_adminemail; | $headers = "From: ".$cfg_adminemail."\r\nReply-To: ".$cfg_adminemail; | ||||
if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) { | if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) { | ||||
$client = new DedeBizClient($cfg_bizcore_hostname, $cfg_bizcore_port); | |||||
$client->appid = $cfg_bizcore_appid; | |||||
$client->key = $cfg_bizcore_key; | |||||
$client = new DedeBizClient(); | |||||
$client->MailSend($email,$mailtitle,$mailtitle,$mailbody); | $client->MailSend($email,$mailtitle,$mailtitle,$mailbody); | ||||
$client->Close(); | $client->Close(); | ||||
} else { | } else { | ||||
@@ -152,15 +152,13 @@ class SearchView | |||||
function GetKeywords($keyword) | function GetKeywords($keyword) | ||||
{ | { | ||||
global $cfg_soft_lang; | global $cfg_soft_lang; | ||||
global $cfg_bizcore_appid, $cfg_bizcore_key, $cfg_bizcore_hostname, $cfg_bizcore_port; | |||||
global $cfg_bizcore_appid, $cfg_bizcore_key; | |||||
$keyword = cn_substr($keyword, 50); | $keyword = cn_substr($keyword, 50); | ||||
$row = $this->dsql->GetOne("SELECT spwords FROM `#@__search_keywords` WHERE keyword='".addslashes($keyword)."'; "); | $row = $this->dsql->GetOne("SELECT spwords FROM `#@__search_keywords` WHERE keyword='".addslashes($keyword)."'; "); | ||||
if (!is_array($row)) { | if (!is_array($row)) { | ||||
if (strlen($keyword) > 7) { | if (strlen($keyword) > 7) { | ||||
if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) { | if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) { | ||||
$client = new DedeBizClient($cfg_bizcore_hostname, $cfg_bizcore_port); | |||||
$client->appid = $cfg_bizcore_appid; | |||||
$client->key = $cfg_bizcore_key; | |||||
$client = new DedeBizClient(); | |||||
$data = $client->Spliteword($keyword); | $data = $client->Spliteword($keyword); | ||||
$kvs = explode(",", $data->data); | $kvs = explode(",", $data->data); | ||||
$keywords = $keyword." "; | $keywords = $keyword." "; | ||||
@@ -20,14 +20,12 @@ if (!defined('DEDEINC')) exit('dedebiz'); | |||||
if (!function_exists('GetCache')) { | if (!function_exists('GetCache')) { | ||||
function GetCache($prefix, $key) | function GetCache($prefix, $key) | ||||
{ | { | ||||
global $cfg_bizcore_appid, $cfg_bizcore_key, $cfg_bizcore_hostname, $cfg_bizcore_port; | |||||
global $cfg_bizcore_appid, $cfg_bizcore_key; | |||||
$key = md5($key); | $key = md5($key); | ||||
//商业组件缓存 | //商业组件缓存 | ||||
if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) { | if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) { | ||||
$client = new DedeBizClient($cfg_bizcore_hostname, $cfg_bizcore_port); | |||||
$client->appid = $cfg_bizcore_appid; | |||||
$client->key = $cfg_bizcore_key; | |||||
$client = new DedeBizClient(); | |||||
$key = trim($prefix.'_'.$key); | $key = trim($prefix.'_'.$key); | ||||
$data = $client->CacheGet($key); | $data = $client->CacheGet($key); | ||||
$result = unserialize($data->data); | $result = unserialize($data->data); | ||||
@@ -60,13 +58,11 @@ if (!function_exists('GetCache')) { | |||||
if (!function_exists('SetCache')) { | if (!function_exists('SetCache')) { | ||||
function SetCache($prefix, $key, $value, $timeout = 3600) | function SetCache($prefix, $key, $value, $timeout = 3600) | ||||
{ | { | ||||
global $cfg_bizcore_appid, $cfg_bizcore_key, $cfg_bizcore_hostname, $cfg_bizcore_port; | |||||
global $cfg_bizcore_appid, $cfg_bizcore_key; | |||||
$key = md5($key); | $key = md5($key); | ||||
//商业组件缓存 | //商业组件缓存 | ||||
if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) { | if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) { | ||||
$client = new DedeBizClient($cfg_bizcore_hostname, $cfg_bizcore_port); | |||||
$client->appid = $cfg_bizcore_appid; | |||||
$client->key = $cfg_bizcore_key; | |||||
$client = new DedeBizClient(); | |||||
$key = trim($prefix.'_'.$key); | $key = trim($prefix.'_'.$key); | ||||
$data = $client->CacheSet($key,serialize($value),$timeout); | $data = $client->CacheSet($key,serialize($value),$timeout); | ||||
$result = unserialize($data->data); | $result = unserialize($data->data); | ||||
@@ -92,13 +88,11 @@ if (!function_exists('DelCache')) { | |||||
//删缓存 | //删缓存 | ||||
function DelCache($prefix, $key) | function DelCache($prefix, $key) | ||||
{ | { | ||||
global $cfg_bizcore_appid, $cfg_bizcore_key, $cfg_bizcore_hostname, $cfg_bizcore_port; | |||||
global $cfg_bizcore_appid, $cfg_bizcore_key; | |||||
$key = md5($key); | $key = md5($key); | ||||
//商业组件缓存 | //商业组件缓存 | ||||
if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) { | if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) { | ||||
$client = new DedeBizClient($cfg_bizcore_hostname, $cfg_bizcore_port); | |||||
$client->appid = $cfg_bizcore_appid; | |||||
$client->key = $cfg_bizcore_key; | |||||
$client = new DedeBizClient(); | |||||
$key = trim($prefix.'_'.$key); | $key = trim($prefix.'_'.$key); | ||||
$data = $client->CacheDel($key); | $data = $client->CacheDel($key); | ||||
$client->Close(); | $client->Close(); | ||||
@@ -24,16 +24,14 @@ function SpGetPinyin($str, $ishead = 0, $isclose = 1) | |||||
if ($pinyins==null) { | if ($pinyins==null) { | ||||
$pinyins = array(); | $pinyins = array(); | ||||
} | } | ||||
global $cfg_bizcore_appid, $cfg_bizcore_key, $cfg_bizcore_hostname, $cfg_bizcore_port; | |||||
global $cfg_bizcore_appid, $cfg_bizcore_key; | |||||
global $cfg_soft_lang; | global $cfg_soft_lang; | ||||
$restr = ''; | $restr = ''; | ||||
if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) { | if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) { | ||||
if ($cfg_soft_lang == "utf-8") { | if ($cfg_soft_lang == "utf-8") { | ||||
$str = gb2utf8($str); | $str = gb2utf8($str); | ||||
} | } | ||||
$client = new DedeBizClient($cfg_bizcore_hostname, $cfg_bizcore_port); | |||||
$client->appid = $cfg_bizcore_appid; | |||||
$client->key = $cfg_bizcore_key; | |||||
$client = new DedeBizClient(); | |||||
$data = $client->Pinyin($str, ""); | $data = $client->Pinyin($str, ""); | ||||
$restr = $data->data; | $restr = $data->data; | ||||
$client->Close(); | $client->Close(); | ||||
@@ -8,8 +8,11 @@ class DedeBizClient | |||||
var $appid; | var $appid; | ||||
var $key; | var $key; | ||||
var $err; | var $err; | ||||
function __construct($ipaddr, $port) | |||||
function __construct() | |||||
{ | { | ||||
global $cfg_bizcore_appid,$cfg_bizcore_key,$cfg_bizcore_hostname, $cfg_bizcore_port; | |||||
$this->appid = $cfg_bizcore_appid; | |||||
$this->key = $cfg_bizcore_key; | |||||
$this->err = ""; | $this->err = ""; | ||||
if (!function_exists("socket_create")) { | if (!function_exists("socket_create")) { | ||||
$this->err = (object)array( | $this->err = (object)array( | ||||
@@ -20,7 +23,7 @@ class DedeBizClient | |||||
return; | return; | ||||
} | } | ||||
$this->socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); | $this->socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); | ||||
$rs = @socket_connect($this->socket, $ipaddr, $port); | |||||
$rs = @socket_connect($this->socket, $cfg_bizcore_hostname, $cfg_bizcore_port); | |||||
if (!$rs) { | if (!$rs) { | ||||
$this->err = (object)array( | $this->err = (object)array( | ||||
"code" => -1, | "code" => -1, | ||||
@@ -64,8 +67,16 @@ class DedeBizClient | |||||
); | ); | ||||
return $this->request($req); | return $this->request($req); | ||||
} | } | ||||
function IsEnabled() | |||||
{ | |||||
$rs = $this->Ping(); | |||||
if ($rs->code===200 && $rs->data === "Hello www.dedebiz.com") { | |||||
return true; | |||||
} | |||||
return false; | |||||
} | |||||
//检测是否连接 | //检测是否连接 | ||||
function Ping($i) | |||||
function Ping() | |||||
{ | { | ||||
$req = array( | $req = array( | ||||
"method" => "ping", | "method" => "ping", | ||||
@@ -195,6 +206,35 @@ class DedeBizClient | |||||
); | ); | ||||
return $this->request($req); | return $this->request($req); | ||||
} | } | ||||
//云服务设置 | |||||
function CloudSet($config=array()) | |||||
{ | |||||
$req = array( | |||||
"method" => "cloud_set", | |||||
"parms" => array( | |||||
"aliyun_enabled" => $config['aliyun_enabled'], | |||||
"aliyun_access_key_id" => $config['aliyun_access_key_id'], | |||||
"aliyun_access_key_secret" => $config['aliyun_access_key_secret'], | |||||
"huaweicloud_enabled" => $config['huaweicloud_enabled'], | |||||
"huawei_access_key_id" => $config['huawei_access_key_id'], | |||||
"huawei_secret_access_key" => $config['huawei_secret_access_key'], | |||||
"tencent_enabled" => $config['tencent_enabled'], | |||||
"tencent_secret_id" => $config['tencent_secret_id'], | |||||
"tencent_secret_key" => $config['tencent_secret_key'], | |||||
) | |||||
); | |||||
return $this->request($req); | |||||
} | |||||
function CloudGet() | |||||
{ | |||||
$req = array( | |||||
"method" => "cloud_get", | |||||
"parms" => array( | |||||
"name" => "dedebiz" | |||||
) | |||||
); | |||||
return $this->request($req); | |||||
} | |||||
//拼接规则就是method+ | //拼接规则就是method+ | ||||
function MakeSign(&$req) | function MakeSign(&$req) | ||||
{ | { | ||||
@@ -43,11 +43,9 @@ function random($length, $numeric = 0) | |||||
function sendmail($email, $mailtitle, $mailbody, $headers) | function sendmail($email, $mailtitle, $mailbody, $headers) | ||||
{ | { | ||||
global $cfg_sendmail_bysmtp, $cfg_smtp_server, $cfg_smtp_port, $cfg_smtp_usermail, $cfg_smtp_user, $cfg_smtp_password, $cfg_adminemail; | global $cfg_sendmail_bysmtp, $cfg_smtp_server, $cfg_smtp_port, $cfg_smtp_usermail, $cfg_smtp_user, $cfg_smtp_password, $cfg_adminemail; | ||||
global $cfg_bizcore_appid,$cfg_bizcore_key,$cfg_bizcore_hostname,$cfg_bizcore_port; | |||||
global $cfg_bizcore_appid,$cfg_bizcore_key; | |||||
if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) { | if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) { | ||||
$client = new DedeBizClient($cfg_bizcore_hostname, $cfg_bizcore_port); | |||||
$client->appid = $cfg_bizcore_appid; | |||||
$client->key = $cfg_bizcore_key; | |||||
$client = new DedeBizClient(); | |||||
$client->MailSend($email,$mailtitle,$mailtitle,$mailbody); | $client->MailSend($email,$mailtitle,$mailtitle,$mailbody); | ||||
$client->Close(); | $client->Close(); | ||||
} else { | } else { | ||||
@@ -35,9 +35,7 @@ if ($fmdo == 'sendMail') { | |||||
$mailbody .= "Powered by DedeBIZ开发团队\r\n"; | $mailbody .= "Powered by DedeBIZ开发团队\r\n"; | ||||
$headers = "From: ".$cfg_adminemail."\r\nReply-To: ".$cfg_adminemail; | $headers = "From: ".$cfg_adminemail."\r\nReply-To: ".$cfg_adminemail; | ||||
if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) { | if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) { | ||||
$client = new DedeBizClient($cfg_bizcore_hostname, $cfg_bizcore_port); | |||||
$client->appid = $cfg_bizcore_appid; | |||||
$client->key = $cfg_bizcore_key; | |||||
$client = new DedeBizClient(); | |||||
$client->MailSend($cfg_ml->fields['email'],$mailtitle,$mailtitle,$mailbody); | $client->MailSend($cfg_ml->fields['email'],$mailtitle,$mailtitle,$mailbody); | ||||
$client->Close(); | $client->Close(); | ||||
} else { | } else { | ||||
@@ -22,7 +22,7 @@ | |||||
<li class="breadcrumb-item"><a href="<?php echo $cfg_memberurl;?>/">会员中心</a></li> | <li class="breadcrumb-item"><a href="<?php echo $cfg_memberurl;?>/">会员中心</a></li> | ||||
<li class="breadcrumb-item">发布<?php echo $cInfos['typename'];?></li></li> | <li class="breadcrumb-item">发布<?php echo $cInfos['typename'];?></li></li> | ||||
</ol> | </ol> | ||||
<span class="navbar-text"><a href="javascript:history.back(-1);" class="btn btn-outline-success btn-sm">返回</a></span> | |||||
<span class="navbar-text"><a href="javascript:location.href='content_list.php?channelid=<?php echo $cInfos['id'];?>'" class="btn btn-outline-success btn-sm">返回</a></span> | |||||
</nav> | </nav> | ||||
<form name="addcontent" action="album_add.php" method="post" enctype="multipart/form-data" onsubmit="return checkSubmit();"> | <form name="addcontent" action="album_add.php" method="post" enctype="multipart/form-data" onsubmit="return checkSubmit();"> | ||||
<input type="hidden" name="dopost" value="save"> | <input type="hidden" name="dopost" value="save"> | ||||
@@ -22,7 +22,7 @@ | |||||
<li class="breadcrumb-item"><a href="<?php echo $cfg_memberurl;?>/">会员中心</a></li> | <li class="breadcrumb-item"><a href="<?php echo $cfg_memberurl;?>/">会员中心</a></li> | ||||
<li class="breadcrumb-item">修改<?php echo $row['title']?></li></li> | <li class="breadcrumb-item">修改<?php echo $row['title']?></li></li> | ||||
</ol> | </ol> | ||||
<span class="navbar-text"><a href="javascript:history.back(-1);" class="btn btn-outline-success btn-sm">返回</a></span> | |||||
<span class="navbar-text"><a href="javascript:location.href='content_list.php?channelid=<?php echo $cInfos['id'];?>'" class="btn btn-outline-success btn-sm">返回</a></span> | |||||
</nav> | </nav> | ||||
<form name="addcontent" action="album_edit.php" method="post" enctype="multipart/form-data" onsubmit="return checkSubmit();"> | <form name="addcontent" action="album_edit.php" method="post" enctype="multipart/form-data" onsubmit="return checkSubmit();"> | ||||
<input type="hidden" name="dopost" value="save"> | <input type="hidden" name="dopost" value="save"> | ||||
@@ -22,7 +22,7 @@ | |||||
<li class="breadcrumb-item"><a href="<?php echo $cfg_memberurl;?>/">会员中心</a></li> | <li class="breadcrumb-item"><a href="<?php echo $cfg_memberurl;?>/">会员中心</a></li> | ||||
<li class="breadcrumb-item">发布<?php echo $cInfos['typename'];?></li></li> | <li class="breadcrumb-item">发布<?php echo $cInfos['typename'];?></li></li> | ||||
</ol> | </ol> | ||||
<span class="navbar-text"><a href="javascript:history.back(-1);" class="btn btn-outline-success btn-sm">返回</a></span> | |||||
<span class="navbar-text"><a href="javascript:location.href='content_list.php?channelid=<?php echo $cInfos['id'];?>'" class="btn btn-outline-success btn-sm">返回</a></span> | |||||
</nav> | </nav> | ||||
<form name="addcontent" action="archives_add.php" method="post" enctype="multipart/form-data" onsubmit="return checkSubmit(`<?php echo $cInfos['titlename'];?>`);"> | <form name="addcontent" action="archives_add.php" method="post" enctype="multipart/form-data" onsubmit="return checkSubmit(`<?php echo $cInfos['titlename'];?>`);"> | ||||
<input type="hidden" name="dopost" value="save"> | <input type="hidden" name="dopost" value="save"> | ||||
@@ -22,7 +22,7 @@ | |||||
<li class="breadcrumb-item"><a href="<?php echo $cfg_memberurl;?>/">会员中心</a></li> | <li class="breadcrumb-item"><a href="<?php echo $cfg_memberurl;?>/">会员中心</a></li> | ||||
<li class="breadcrumb-item">修改<?php echo $row['title']?></li></li> | <li class="breadcrumb-item">修改<?php echo $row['title']?></li></li> | ||||
</ol> | </ol> | ||||
<span class="navbar-text"><a href="javascript:history.back(-1);" class="btn btn-outline-success btn-sm">返回</a></span> | |||||
<span class="navbar-text"><a href="javascript:location.href='content_list.php?channelid=<?php echo $cInfos['id'];?>'" class="btn btn-outline-success btn-sm">返回</a></span> | |||||
</nav> | </nav> | ||||
<form name="addcontent" action="archives_edit.php?aid=<?php echo $aid;?>" method="post" enctype="multipart/form-data" onsubmit="return checkSubmit(`<?php echo $cInfos['titlename'];?>`);"> | <form name="addcontent" action="archives_edit.php?aid=<?php echo $aid;?>" method="post" enctype="multipart/form-data" onsubmit="return checkSubmit(`<?php echo $cInfos['titlename'];?>`);"> | ||||
<input type="hidden" name="dopost" value="save"> | <input type="hidden" name="dopost" value="save"> | ||||
@@ -22,7 +22,7 @@ | |||||
<li class="breadcrumb-item"><a href="<?php echo $cfg_memberurl;?>/">会员中心</a></li> | <li class="breadcrumb-item"><a href="<?php echo $cfg_memberurl;?>/">会员中心</a></li> | ||||
<li class="breadcrumb-item">发布<?php echo $cInfos['typename'];?></li></li> | <li class="breadcrumb-item">发布<?php echo $cInfos['typename'];?></li></li> | ||||
</ol> | </ol> | ||||
<span class="navbar-text"><a href="javascript:history.back(-1);" class="btn btn-outline-success btn-sm">返回</a></span> | |||||
<span class="navbar-text"><a href="javascript:location.href='content_list.php?channelid=<?php echo $cInfos['id'];?>'" class="btn btn-outline-success btn-sm">返回</a></span> | |||||
</nav> | </nav> | ||||
<form name="addcontent" action="archives_sg_add.php" method="post" enctype="multipart/form-data" onsubmit="return checkSubmit(`<?php echo $cInfos['titlename'];?>`);"> | <form name="addcontent" action="archives_sg_add.php" method="post" enctype="multipart/form-data" onsubmit="return checkSubmit(`<?php echo $cInfos['titlename'];?>`);"> | ||||
<input type="hidden" name="dopost" value="save"> | <input type="hidden" name="dopost" value="save"> | ||||
@@ -22,7 +22,7 @@ | |||||
<li class="breadcrumb-item"><a href="<?php echo $cfg_memberurl;?>/">会员中心</a></li> | <li class="breadcrumb-item"><a href="<?php echo $cfg_memberurl;?>/">会员中心</a></li> | ||||
<li class="breadcrumb-item">修改<?php echo $row['title']?></li></li> | <li class="breadcrumb-item">修改<?php echo $row['title']?></li></li> | ||||
</ol> | </ol> | ||||
<span class="navbar-text"><a href="javascript:history.back(-1);" class="btn btn-outline-success btn-sm">返回</a></span> | |||||
<span class="navbar-text"><a href="javascript:location.href='content_list.php?channelid=<?php echo $cInfos['id'];?>'" class="btn btn-outline-success btn-sm">返回</a></span> | |||||
</nav> | </nav> | ||||
<form name="addcontent" action="archives_sg_edit.php?aid=<?php echo $aid;?>" method="post" enctype="multipart/form-data" onsubmit="return checkSubmit(`<?php echo $cInfos['titlename'];?>`);"> | <form name="addcontent" action="archives_sg_edit.php?aid=<?php echo $aid;?>" method="post" enctype="multipart/form-data" onsubmit="return checkSubmit(`<?php echo $cInfos['titlename'];?>`);"> | ||||
<input type="hidden" name="dopost" value="save"> | <input type="hidden" name="dopost" value="save"> | ||||
@@ -22,7 +22,7 @@ | |||||
<li class="breadcrumb-item"><a href="<?php echo $cfg_memberurl;?>/">会员中心</a></li> | <li class="breadcrumb-item"><a href="<?php echo $cfg_memberurl;?>/">会员中心</a></li> | ||||
<li class="breadcrumb-item">发布<?php echo $cInfos['typename'];?></li></li> | <li class="breadcrumb-item">发布<?php echo $cInfos['typename'];?></li></li> | ||||
</ol> | </ol> | ||||
<span class="navbar-text"><a href="javascript:history.back(-1);" class="btn btn-outline-success btn-sm">返回</a></span> | |||||
<span class="navbar-text"><a href="javascript:location.href='content_list.php?channelid=<?php echo $cInfos['id'];?>'" class="btn btn-outline-success btn-sm">返回</a></span> | |||||
</nav> | </nav> | ||||
<form name="addcontent" action="article_add.php" method="post" enctype="multipart/form-data" onsubmit="return checkSubmit(`<?php echo $cInfos['titlename'];?>`);"> | <form name="addcontent" action="article_add.php" method="post" enctype="multipart/form-data" onsubmit="return checkSubmit(`<?php echo $cInfos['titlename'];?>`);"> | ||||
<input type="hidden" name="dopost" value="save"> | <input type="hidden" name="dopost" value="save"> | ||||
@@ -22,7 +22,7 @@ | |||||
<li class="breadcrumb-item"><a href="<?php echo $cfg_memberurl;?>/">会员中心</a></li> | <li class="breadcrumb-item"><a href="<?php echo $cfg_memberurl;?>/">会员中心</a></li> | ||||
<li class="breadcrumb-item">修改<?php echo $row['title']?></li></li> | <li class="breadcrumb-item">修改<?php echo $row['title']?></li></li> | ||||
</ol> | </ol> | ||||
<span class="navbar-text"><a href="javascript:history.back(-1);" class="btn btn-outline-success btn-sm">返回</a></span> | |||||
<span class="navbar-text"><a href="javascript:location.href='content_list.php?channelid=<?php echo $cInfos['id'];?>'" class="btn btn-outline-success btn-sm">返回</a></span> | |||||
</nav> | </nav> | ||||
<form name="addcontent" action="article_edit.php" method="post" enctype="multipart/form-data" onsubmit="return checkSubmit(`<?php echo $cInfos['titlename'];?>`);"> | <form name="addcontent" action="article_edit.php" method="post" enctype="multipart/form-data" onsubmit="return checkSubmit(`<?php echo $cInfos['titlename'];?>`);"> | ||||
<input type="hidden" name="dopost" value="save"> | <input type="hidden" name="dopost" value="save"> | ||||