From 6a757c7c1e5dbe02ac3738d9760aec9d12781fdc Mon Sep 17 00:00:00 2001 From: tianya Date: Mon, 19 Dec 2022 21:51:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=95=86=E4=B8=9A=E4=BA=91?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=8F=8A=E6=94=AF=E4=BB=98=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/admin/archives_do.php | 4 +- src/admin/inc/inc_action_info.php | 6 + src/admin/inc/inc_archives_functions.php | 4 +- src/admin/inc/inc_menu.php | 1 + src/admin/index_body.php | 4 +- src/admin/makehtml_homepage.php | 4 +- src/admin/sys_cloud.php | 65 +++++++ src/admin/sys_login.php | 14 ++ src/admin/sys_payment.php | 180 ------------------ src/admin/templets/makehtml_homepage.htm | 4 +- src/admin/templets/sys_cloud.htm | 195 +++++++++++++++++++ src/admin/templets/sys_login.htm | 151 +++++++++++++++ src/admin/templets/sys_payment.htm | 226 ++++++++++++++++++----- src/apps/recommend.php | 4 +- src/system/archive/searchview.class.php | 6 +- src/system/helpers/cache.helper.php | 18 +- src/system/inc/inc_fun_funAdmin.php | 6 +- src/system/libraries/dedebiz.class.php | 46 ++++- src/user/inc/inc_pwd_functions.php | 6 +- src/user/index_do.php | 4 +- src/user/templets/album_add.htm | 2 +- src/user/templets/album_edit.htm | 2 +- src/user/templets/archives_add.htm | 2 +- src/user/templets/archives_edit.htm | 2 +- src/user/templets/archives_sg_add.htm | 2 +- src/user/templets/archives_sg_edit.htm | 2 +- src/user/templets/article_add.htm | 2 +- src/user/templets/article_edit.htm | 2 +- 28 files changed, 679 insertions(+), 285 deletions(-) create mode 100644 src/admin/sys_cloud.php create mode 100644 src/admin/sys_login.php create mode 100644 src/admin/templets/sys_cloud.htm create mode 100644 src/admin/templets/sys_login.htm diff --git a/src/admin/archives_do.php b/src/admin/archives_do.php index 04f0e6c2..22da1658 100644 --- a/src/admin/archives_do.php +++ b/src/admin/archives_do.php @@ -645,9 +645,7 @@ else if ($dopost == "makekw") { $dsql->SetQuery($query); $dsql->Execute(); 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()) { //跳过已经有关键词文档 if (trim($row['keywords']) != '') continue; diff --git a/src/admin/inc/inc_action_info.php b/src/admin/inc/inc_action_info.php index b6d7953e..a2c47a5a 100644 --- a/src/admin/inc/inc_action_info.php +++ b/src/admin/inc/inc_action_info.php @@ -351,6 +351,12 @@ $actionSearch[9] = array( 'purview' => 'sys_Edit', 'linkurl' => 'sys_info_mark.php' ), + 5 => array( + 'title' => '云服务设置', + 'description' => '主流云服务平台支持', + 'purview' => 'sys_Edit', + 'linkurl' => 'sys_cloud.php' + ), 6 => array( 'title' => '软件下载设置', 'description' => '软件下载连接显示方式,下载方式,镜像服务器等等进行配置', diff --git a/src/admin/inc/inc_archives_functions.php b/src/admin/inc/inc_archives_functions.php index 4bc906b3..d8cf2251 100644 --- a/src/admin/inc/inc_archives_functions.php +++ b/src/admin/inc/inc_archives_functions.php @@ -553,9 +553,7 @@ function AnalyseHtmlBody($body, &$description, &$litpic, &$keywords, $dtype = '' //采用DedeBIZ Core分词组件分词 if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) { $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)); $keywords = $data->data; $client->Close(); diff --git a/src/admin/inc/inc_menu.php b/src/admin/inc/inc_menu.php index 5367e4f8..87fd8dbc 100644 --- a/src/admin/inc/inc_menu.php +++ b/src/admin/inc/inc_menu.php @@ -62,6 +62,7 @@ if ($cuserLogin->getUserType() >= 10) { + ".(DEDEBIZ_SAFE_MODE? "" : "")." diff --git a/src/admin/index_body.php b/src/admin/index_body.php index 6a3fad4a..71fed2e1 100644 --- a/src/admin/index_body.php +++ b/src/admin/index_body.php @@ -82,9 +82,7 @@ else if ($dopost == 'setskin') { openssl_public_decrypt(base64_decode($cfg_auth_code), $decotent, DEDEPUB); $core_info = new stdClass; 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(); $client->Close(); } diff --git a/src/admin/makehtml_homepage.php b/src/admin/makehtml_homepage.php index f817eed6..cd6bcd87 100644 --- a/src/admin/makehtml_homepage.php +++ b/src/admin/makehtml_homepage.php @@ -20,9 +20,7 @@ if ($dopost == "view") { exit(); } else if ($dopost == "make") { 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 = json_decode($data->data); if ($data) { diff --git a/src/admin/sys_cloud.php b/src/admin/sys_cloud.php new file mode 100644 index 00000000..e6e6acc3 --- /dev/null +++ b/src/admin/sys_cloud.php @@ -0,0 +1,65 @@ +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"); diff --git a/src/admin/sys_login.php b/src/admin/sys_login.php new file mode 100644 index 00000000..f2aa7d3b --- /dev/null +++ b/src/admin/sys_login.php @@ -0,0 +1,14 @@ + 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 = ""; - break; - case 'select': - //生成选择框 - $reval_title = $formarry['title']; - $items = explode(',', $formarry['iterm']); - $reval_form = "\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 = '

~title~:~form~~description~

'; - } else { - if (file_exists($tplname)) $this->ArrFromTPL = file_get_contents($tplname); - else $this->ArrFromTPL = $tplname; - } - } -} -$tplstring = " - - ~title~: - ~form~ ~description~ - -"; -//安装支付接口 -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"; $dlist = new DataListCP(); $dlist->SetTemplet(DEDEADMIN."/templets/sys_payment.htm"); diff --git a/src/admin/templets/makehtml_homepage.htm b/src/admin/templets/makehtml_homepage.htm index 1b23a474..78eb9497 100644 --- a/src/admin/templets/makehtml_homepage.htm +++ b/src/admin/templets/makehtml_homepage.htm @@ -57,9 +57,7 @@ appid = $cfg_bizcore_appid; - $client->key = $cfg_bizcore_key; + $client = new DedeBizClient(); $data = $client->AdminPWDExists(); if ($data->code == -1){ ?> diff --git a/src/admin/templets/sys_cloud.htm b/src/admin/templets/sys_cloud.htm new file mode 100644 index 00000000..20fd7a93 --- /dev/null +++ b/src/admin/templets/sys_cloud.htm @@ -0,0 +1,195 @@ + + + + + + + 云服务设置 + + + + + + + + + + + + + + + + +
+ + + + + +
云服务设置
+
+ +
+
+
+ +

+ 阿里巴巴集团旗下公司,是全球领先的云计算及人工智能科技公司之一。提供免费试用、云服务器、云数据库、云安全、云企业应用等云计算服务,以及大数据、人工智能服务、精准定制基于场景的行业解决方案。免费备案,7x24小时售后支持,助企业无忧上云。 +

+
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ +

+ 华为云提供稳定可靠、安全可信、可持续发展的云服务,致力于让云无处不在,让智能无所不及,共建智能世界云底座。助力企业降本增效,全球300万客户的共同选择。7x24小时专业服务支持,5天内无理由退订,免费快速备案。 +

+
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ +

+ 腾讯云为数百万的企业和开发者提供安全稳定的云计算服务,涵盖云服务器、云数据库、云存储、视频与CDN、域名注册等全方位云服务和各行业解决方案。 +

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + \ No newline at end of file diff --git a/src/admin/templets/sys_login.htm b/src/admin/templets/sys_login.htm new file mode 100644 index 00000000..2577e236 --- /dev/null +++ b/src/admin/templets/sys_login.htm @@ -0,0 +1,151 @@ + + + + + + + 登录设置 + + + + + + + + + + + + + + + +
+ + + + + +
用户登录设置更多接口
+
+
+
+ +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ +
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+ + +
+
+ + + \ No newline at end of file diff --git a/src/admin/templets/sys_payment.htm b/src/admin/templets/sys_payment.htm index 57baaa27..0c53612e 100644 --- a/src/admin/templets/sys_payment.htm +++ b/src/admin/templets/sys_payment.htm @@ -1,52 +1,180 @@ - - - - 支付接口设置 - - - - - - - - - - - - - - - - {dede:datalist empty=''} - - - - - - - {/dede:datalist} - - - -
- - - - - -
支付接口设置更多接口
-
支付方式描述排序管理
暂无文档
{dede:field.name/}{dede:field.description/}{dede:field.rank/} - - 安装 - - 修改 - 删除 - -
{dede:pagelist listsize='6'/}
- + + + + + 支付接口设置 + + + + + + + + + + + + + + + +
+ + + + + +
支付接口设置更多接口
+
+ +
+
+
+
+ +

+ 微信支付是腾讯公司的支付业务品牌,微信支付商户平台支持线下场所、公众号、小程序、PC网站、APP、企业微信等经营场景快速接入微信支付。微信支付全面打通O2O生活消费领域,提供专业的互联网+行业解决方案,微信支付支持微信红包和微信理财通,是移动支付的首选。 +

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+ + +
+
+
+ + +
+ +
+
+
+
+
+ +

+ 支付宝,全球领先的独立第三方支付平台,致力于为广大用户提供安全快速的电子支付/网上支付/安全支付/手机支付体验,及转账收款/水电煤缴费/信用卡还款/AA收款等生活服务应用。 +

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+ +
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+
+
+
+
+ + +
+ +
+
+
+
+
+ + +
+ +
+
+
+
+ + \ No newline at end of file diff --git a/src/apps/recommend.php b/src/apps/recommend.php index be0e2264..d8d52d33 100755 --- a/src/apps/recommend.php +++ b/src/apps/recommend.php @@ -42,9 +42,7 @@ else if ($action == 'send') { $mailbody .= "Powered by DedeBIZ"; $headers = "From: ".$cfg_adminemail."\r\nReply-To: ".$cfg_adminemail; 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->Close(); } else { diff --git a/src/system/archive/searchview.class.php b/src/system/archive/searchview.class.php index 3c70d804..34d90cc1 100755 --- a/src/system/archive/searchview.class.php +++ b/src/system/archive/searchview.class.php @@ -152,15 +152,13 @@ class SearchView function GetKeywords($keyword) { 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); $row = $this->dsql->GetOne("SELECT spwords FROM `#@__search_keywords` WHERE keyword='".addslashes($keyword)."'; "); if (!is_array($row)) { if (strlen($keyword) > 7) { 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); $kvs = explode(",", $data->data); $keywords = $keyword." "; diff --git a/src/system/helpers/cache.helper.php b/src/system/helpers/cache.helper.php index 479d1490..e09efd87 100755 --- a/src/system/helpers/cache.helper.php +++ b/src/system/helpers/cache.helper.php @@ -20,14 +20,12 @@ if (!defined('DEDEINC')) exit('dedebiz'); if (!function_exists('GetCache')) { 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); //商业组件缓存 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); $data = $client->CacheGet($key); $result = unserialize($data->data); @@ -60,13 +58,11 @@ if (!function_exists('GetCache')) { if (!function_exists('SetCache')) { 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); //商业组件缓存 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); $data = $client->CacheSet($key,serialize($value),$timeout); $result = unserialize($data->data); @@ -92,13 +88,11 @@ if (!function_exists('DelCache')) { //删缓存 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); //商业组件缓存 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); $data = $client->CacheDel($key); $client->Close(); diff --git a/src/system/inc/inc_fun_funAdmin.php b/src/system/inc/inc_fun_funAdmin.php index fce54437..7cd7c41e 100755 --- a/src/system/inc/inc_fun_funAdmin.php +++ b/src/system/inc/inc_fun_funAdmin.php @@ -24,16 +24,14 @@ function SpGetPinyin($str, $ishead = 0, $isclose = 1) if ($pinyins==null) { $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; $restr = ''; if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) { if ($cfg_soft_lang == "utf-8") { $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, ""); $restr = $data->data; $client->Close(); diff --git a/src/system/libraries/dedebiz.class.php b/src/system/libraries/dedebiz.class.php index 83903a5d..95110c13 100644 --- a/src/system/libraries/dedebiz.class.php +++ b/src/system/libraries/dedebiz.class.php @@ -8,8 +8,11 @@ class DedeBizClient var $appid; var $key; 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 = ""; if (!function_exists("socket_create")) { $this->err = (object)array( @@ -20,7 +23,7 @@ class DedeBizClient return; } $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) { $this->err = (object)array( "code" => -1, @@ -64,8 +67,16 @@ class DedeBizClient ); 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( "method" => "ping", @@ -195,6 +206,35 @@ class DedeBizClient ); 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+ function MakeSign(&$req) { diff --git a/src/user/inc/inc_pwd_functions.php b/src/user/inc/inc_pwd_functions.php index 23698d90..fa1f22e6 100755 --- a/src/user/inc/inc_pwd_functions.php +++ b/src/user/inc/inc_pwd_functions.php @@ -43,11 +43,9 @@ function random($length, $numeric = 0) 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_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)) { - $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->Close(); } else { diff --git a/src/user/index_do.php b/src/user/index_do.php index db59dc36..7ae90f0f 100755 --- a/src/user/index_do.php +++ b/src/user/index_do.php @@ -35,9 +35,7 @@ if ($fmdo == 'sendMail') { $mailbody .= "Powered by DedeBIZ开发团队\r\n"; $headers = "From: ".$cfg_adminemail."\r\nReply-To: ".$cfg_adminemail; 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->Close(); } else { diff --git a/src/user/templets/album_add.htm b/src/user/templets/album_add.htm index 5a08d0a9..a0f9a062 100755 --- a/src/user/templets/album_add.htm +++ b/src/user/templets/album_add.htm @@ -22,7 +22,7 @@ - 返回 + 返回
diff --git a/src/user/templets/album_edit.htm b/src/user/templets/album_edit.htm index f111b391..ee106ca0 100755 --- a/src/user/templets/album_edit.htm +++ b/src/user/templets/album_edit.htm @@ -22,7 +22,7 @@ - 返回 + 返回 diff --git a/src/user/templets/archives_add.htm b/src/user/templets/archives_add.htm index 510844ea..d29e3849 100755 --- a/src/user/templets/archives_add.htm +++ b/src/user/templets/archives_add.htm @@ -22,7 +22,7 @@ - 返回 + 返回 diff --git a/src/user/templets/archives_edit.htm b/src/user/templets/archives_edit.htm index 00b1b2e0..5a88e193 100755 --- a/src/user/templets/archives_edit.htm +++ b/src/user/templets/archives_edit.htm @@ -22,7 +22,7 @@ - 返回 + 返回 diff --git a/src/user/templets/archives_sg_add.htm b/src/user/templets/archives_sg_add.htm index a43185be..f323cf83 100755 --- a/src/user/templets/archives_sg_add.htm +++ b/src/user/templets/archives_sg_add.htm @@ -22,7 +22,7 @@ - 返回 + 返回 diff --git a/src/user/templets/archives_sg_edit.htm b/src/user/templets/archives_sg_edit.htm index 5eb96762..995daca9 100755 --- a/src/user/templets/archives_sg_edit.htm +++ b/src/user/templets/archives_sg_edit.htm @@ -22,7 +22,7 @@ - 返回 + 返回 diff --git a/src/user/templets/article_add.htm b/src/user/templets/article_add.htm index 09096575..f612c6a8 100755 --- a/src/user/templets/article_add.htm +++ b/src/user/templets/article_add.htm @@ -22,7 +22,7 @@ - 返回 + 返回 diff --git a/src/user/templets/article_edit.htm b/src/user/templets/article_edit.htm index c0bc3d81..e8d1a08c 100755 --- a/src/user/templets/article_edit.htm +++ b/src/user/templets/article_edit.htm @@ -22,7 +22,7 @@ - 返回 + 返回