guest visit setting

This commit is contained in:
xiaomlove
2021-02-03 02:03:39 +08:00
parent dfaf0a9015
commit ec521729dc
5 changed files with 150 additions and 58 deletions

View File

@@ -680,6 +680,15 @@ $lang_settings = array
'text_email_notification_note' => "是否允许用户在收取新短讯、评论等时候收到邮件提示。",
'text_users_get' => "首次升级至此等级的用户将获得",
'text_invitations_default' => "个邀请名额。默认",
'row_guest_visit_type' => "游客访问",
'text_guest_visit_type_normal' => '正常',
'text_guest_visit_type_static_page' => '展示指定静态页',
'text_guest_visit_type_custom_content' => '展示自定义内容',
'text_guest_visit_type_redirect' => '跳转指定 URL',
'row_guest_visit_value_static_page' => '指定静态页',
'row_guest_visit_value_custom_content' => '自定义内容',
'row_guest_visit_value_redirect' => '指定 URL',
'text_guest_visit_value_static_page' => '位于resources/static-pages/ 目录下的文件',
);
?>

View File

@@ -680,6 +680,15 @@ $lang_settings = array
'text_email_notification_note' => "是否允許用戶在收取新短訊、評論等時候收到郵件輔助說明。",
'text_users_get' => "首次升級至此等級的用戶將獲得",
'text_invitations_default' => "個邀請名額。預設",
'row_guest_visit_type' => "遊客訪問",
'text_guest_visit_type_normal' => '正常',
'text_guest_visit_type_static_page' => '展示指定靜態頁',
'text_guest_visit_type_custom_content' => '展示自定義內容',
'text_guest_visit_type_redirect' => '跳轉指定 URL',
'row_guest_visit_value_static_page' => '指定靜態頁',
'row_guest_visit_value_custom_content' => '自定義內容',
'row_guest_visit_value_redirect' => '指定 URL',
'text_guest_visit_value_static_page' => '位於resources/static-pages/ 目錄下的文件',
);
?>

View File

@@ -680,6 +680,15 @@ $lang_settings = array
'text_email_notification_note' => "Allow users to receive email notification when he gets new pm, comment, etc.",
'text_users_get' => "Users would get ",
'text_invitations_default' => " invitations the first time he is promoted to this class. Default ",
'row_guest_visit_type' => "游客访问",
'text_guest_visit_type_normal' => '正常',
'text_guest_visit_type_static_page' => '展示指定静态页',
'text_guest_visit_type_custom_content' => '展示自定义内容',
'text_guest_visit_type_redirect' => '跳转指定 URL',
'row_guest_visit_value_static_page' => '指定静态页',
'row_guest_visit_value_custom_content' => '自定义内容',
'row_guest_visit_value_redirect' => '指定 URL',
'text_guest_visit_value_static_page' => '位于resources/static-pages/ 目录下的文件',
);
?>

View File

@@ -156,7 +156,10 @@ elseif ($action == 'savesettings_smtp') // save smtp
elseif ($action == 'savesettings_security') // save security
{
stdhead($lang_settings['head_save_security_settings']);
$validConfig = array('securelogin', 'securetracker', 'https_announce_url','iv','maxip','maxloginattempts','changeemail','cheaterdet','nodetect');
$validConfig = array(
'securelogin', 'securetracker', 'https_announce_url','iv','maxip','maxloginattempts','changeemail','cheaterdet','nodetect',
'guest_visit_type', 'guest_visit_value_static_page', 'guest_visit_value_custom_content', 'guest_visit_value_redirect',
);
GetVar($validConfig);
$SECURITY = [];
foreach($validConfig as $config) {
@@ -284,7 +287,8 @@ elseif ($action == 'securitysettings') //security settings
$SECURITY = get_setting('security');
stdhead($lang_settings['head_security_settings']);
print ($notice);
print ("<form method='post' action='".$_SERVER["SCRIPT_NAME"]."'><input type='hidden' name='action' value='savesettings_security'>");
print("<tbody>");
print ("<form method='post' action='".$_SERVER["SCRIPT_NAME"]."' name='securitysettings_form'><input type='hidden' name='action' value='savesettings_security'>");
tr($lang_settings['row_enable_ssl'],"<input type='radio' name='securelogin'" . ($SECURITY["securelogin"] == "yes" ? " checked" : "") . " value='yes'> ".$lang_settings['text_yes']. " <input type='radio' name='securelogin'" . ($SECURITY["securelogin"] == "no" ? " checked" : "") . " value='no'> ".$lang_settings['text_no']. " <input type='radio' name='securelogin'" . ($SECURITY["securelogin"] == "op" ? " checked" : "") . " value='op'> ".$lang_settings['text_optional']."<br />".$lang_settings['text_ssl_note'], 1);
tr($lang_settings['row_enable_ssl_tracker'],"<input type='radio' name='securetracker'" . ($SECURITY["securetracker"] == "yes" ? " checked" : "") . " value='yes'> ".$lang_settings['text_yes']. " <input type='radio' name='securetracker'" . ($SECURITY["securetracker"] == "no" ? " checked" : "") . " value='no'> ".$lang_settings['text_no']. " <input type='radio' name='securetracker'" . ($SECURITY["securetracker"] == "op" ? " checked" : "") . " value='op'> ".$lang_settings['text_optional']."<br />".$lang_settings['text_ssl_note'], 1);
tr($lang_settings['row_https_announce_url'],"<input type='text' style=\"width: 300px\" name=https_announce_url value='".($SECURITY["https_announce_url"] ? $SECURITY["https_announce_url"] : "")."'> ".$lang_settings['text_https_announce_url_note'] . $_SERVER["HTTP_HOST"]."/announce.php", 1);
@@ -294,63 +298,30 @@ elseif ($action == 'securitysettings') //security settings
tr($lang_settings['row_max_ips'],"<input type='text' style=\"width: 300px\" name=maxip value='" . ($SECURITY["maxip"] ? $SECURITY["maxip"] : "1")."'> ".$lang_settings['text_max_ips_note'], 1);
tr($lang_settings['row_max_login_attemps'],"<input type='text' style=\"width: 300px\" name=maxloginattempts value='" . ($SECURITY["maxloginattempts"] ? $SECURITY["maxloginattempts"] : "7")."'> ".$lang_settings['text_max_login_attemps_note'], 1);
$guestVisitRadios = [
[
'label' => '正常',
'value' => 'normal',
],
[
'label' => '展示指定页面',
'value' => 'static-page',
'target' => [
'type' => 'select',
'label' => '指定页面路径',
'options' => glob(ROOT_PATH . 'resources/static-pages/*'),
],
],
[
'label' => '展示自定义内容',
'value' => 'custom-content',
'target' => [
'type' => 'textarea',
'label' => '自定义内容',
],
],
[
'label' => '重定向到指定 URL',
'value' => 'redirect',
'target' => [
'type' => 'input',
'label' => '指定 URL',
],
],
];
$guestVisitHtmlArr = [];
$guestVisitTargetHtmlArr = [];
foreach($guestVisitRadios as $value) {
$guestVisitHtmlArr[] = sprintf(
'<label><input type="radio" name="guest_visit_type" value="%s" onclick="">%s</label>',
$value['value'], $value['label']
);
if (!empty($value['target']['type'])) {
$targetType = $value['target']['type'];
if ($targetType == 'input') {
$input = sprintf('<input type="text" name="guest_visit_value_%s" value="" style="width: 300px" />', $value['value']);
$guestVisitTargetHtmlArr[] = tr($value['target']['label'], $input, 1, '', true);
} elseif ($targetType == 'textarea') {
} elseif ($targetType == 'select') {
$select = sprintf('<select name="guest_visit_value_%s">', $value['value']);
foreach ($value['target']['options'] as $option) {
$select .= sprintf('<option value="%s">%s</option>', basename($option), basename($option));
}
$select .= '</select>';
$guestVisitTargetHtmlArr[] = tr($value['target']['label'], $select, 1, '', true);
}
}
$guestVisitTypeRadio = '<label><input type="radio" name="guest_visit_type" value="normal"' . ($SECURITY['guest_visit_type'] == 'normal' ? ' checked' : '') . ' onclick="document.getElementById(\'tbody_static_page\').style.display=\'none\';document.getElementById(\'tbody_custom_content\').style.display=\'none\';document.getElementById(\'tbody_redirect\').style.display=\'none\';">' . $lang_settings['text_guest_visit_type_normal'] . '</label>';
$guestVisitTypeRadio .= '<br/><label><input type="radio" name="guest_visit_type" value="static_page"' . ($SECURITY['guest_visit_type'] == 'static_page' ? ' checked' : '') . ' onclick="document.getElementById(\'tbody_static_page\').style.display=\'table-row-group\';document.getElementById(\'tbody_custom_content\').style.display=\'none\';document.getElementById(\'tbody_redirect\').style.display=\'none\';">' . $lang_settings['text_guest_visit_type_static_page'] . '</label>';
$guestVisitTypeRadio .= '<br/><label><input type="radio" name="guest_visit_type" value="custom_content"' . ($SECURITY['guest_visit_type'] == 'custom_content' ? ' checked' : '') . ' onclick="document.getElementById(\'tbody_static_page\').style.display=\'none\';document.getElementById(\'tbody_custom_content\').style.display=\'table-row-group\';document.getElementById(\'tbody_redirect\').style.display=\'none\';">' . $lang_settings['text_guest_visit_type_custom_content'] . '</label>';
$guestVisitTypeRadio .= '<br/><label><input type="radio" name="guest_visit_type" value="redirect"' . ($SECURITY['guest_visit_type'] == 'redirect' ? ' checked' : '') . ' onclick="document.getElementById(\'tbody_static_page\').style.display=\'none\';document.getElementById(\'tbody_custom_content\').style.display=\'none\';document.getElementById(\'tbody_redirect\').style.display=\'table-row-group\';">' . $lang_settings['text_guest_visit_type_redirect'] . '</label>';
tr($lang_settings['row_guest_visit_type'], $guestVisitTypeRadio, 1);
print '</tbody><tbody id="tbody_static_page" style="display: ' . ($SECURITY['guest_visit_type'] == 'static_page' ? 'table-row-group' : 'none') . '">';
$guestVisitStaticPageSelect = '<select name="guest_visit_value_static_page">';
foreach (glob(ROOT_PATH . 'resources/static-pages/*') as $page) {
$pageName = basename($page);
$guestVisitStaticPageSelect.= sprintf('<option value="%s"%s>%s</option>', $pageName, $SECURITY['guest_visit_value_static_page'] == $pageName ? ' selected' : '', $pageName);
}
tr("游客访问", implode('<br/>', $guestVisitHtmlArr), 1);
print implode('', $guestVisitTargetHtmlArr);
$guestVisitStaticPageSelect .= '</select> ' . $lang_settings['text_guest_visit_value_static_page'];
tr($lang_settings['row_guest_visit_value_static_page'], $guestVisitStaticPageSelect, 1);
print '</tbody><tbody id="tbody_custom_content" style="display: ' . ($SECURITY['guest_visit_type'] == 'custom_content' ? 'table-row-group' : 'none') . '">';
print '<tr><td class="rowhead nowrap" valign="top" align="right">' . $lang_settings['row_guest_visit_value_custom_content'] . '</td><td>';
textbbcode('securitysettings_form', 'guest_visit_value_custom_content', $SECURITY['guest_visit_value_custom_content'] ?? '');
print '</td></tr>';
print '</tbody><tbody id="tbody_redirect" style="display: ' . ($SECURITY['guest_visit_type'] == 'redirect' ? 'table-row-group' : 'none') . '">';
$input = sprintf('<input type="text" name="guest_visit_value_redirect" value="%s" style="width: 300px;" />', $SECURITY['guest_visit_value_redirect'] ?? '');
tr($lang_settings['row_guest_visit_value_redirect'], $input, 1);
print '</tbody>';
tr($lang_settings['row_save_settings'],"<input type='submit' name='save' value='".$lang_settings['submit_save_settings']."'>", 1);
print ("</form>");

View File

@@ -0,0 +1,94 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="ahot-aplus" content="1">
<meta name="aplus-rate-ahot" content="0.5">
<title>阿里云备案阻断页</title>
<link rel="icon" href="https://img.alicdn.com/tfs/TB1_ZXuNcfpK1RjSZFOXXa6nFXa-32-32.ico" type="image/x-icon">
<meta name="data-spm" content="5176" />
<meta name="keywords" content="">
<meta name="description" content="">
<meta property="og:title" content="阿里云备案阻断页" />
<meta property="og:description" content="" />
<meta property="og:image" content="https://img.alicdn.com/tfs/TB1qNVdXlGw3KVjSZFDXXXWEpXa-620-620.png" />
<style>
body {
min-height:100vh;
margin:0;
padding:0;
background:#fff;
;
}
.seo-html-content{
display:none!important;
}
@media screen and (max-width: 768px) {
body {
overflow-x: hidden;
font-size: 12px;
}
}
div.small-icon .cart-name{
display: none;
}
</style>
<script>
window.$PAGE_CONFIG = {
id:'142776',
env: 'production',
previewEnv: '',
PLUGINS: {},
renderEngine:1,
SOLUTION_HEADER_FOOTER_CONFG:{"headerSection":"完整头部","footerSection":"展示"}
};
</script>
<script>
if (window.innerWidth <= 768) {
var meta = document.querySelector('meta[name="viewport"]');
meta.content = 'width=375px,user-scalable=no,viewport-fit=cover';
meta.setAttribute('homon','true');
}
</script>
</head>
<body data-spm="14418478"><script type="text/javascript">
(function (d) {
var t=d.createElement("script");t.type="text/javascript";t.async=true;t.id="tb-beacon-aplus";
t.setAttribute("exparams","category=&userid=&aplus&yunid=35385%2a%2a%2a%2a%40qq%2ecom&yunpk=1700198864854652&channel=&cps=");
t.src="//g.alicdn.com/alilog/mlog/aplus_v2.js";
d.getElementsByTagName("head")[0].appendChild(t);
})(document);
</script>
<script src="https://www.aliyun.com/assets/publish/ace-base-assets"></script>
<link rel="stylesheet" href="https://g.alicdn.com/homon/page-render/3.0.17/v1/index-pc.css" />
<link rel="stylesheet" href="https://g.alicdn.com/??hmod/ace-beian-interdict/0.0.8/index.css" />
<div id="J_fetch">
<textarea style="display: none">
{}
</textarea>
</div>
<textarea id="J_data" style="display: none;">
[{"settings":{},"componentId":45592,"hidden":"false","fullName":"@ali/hmod-ace-beian-interdict","uuid":"1164210480","limitConfig":{},"version":"0.0.8","componentVersionId":328597,"name":"hmod-ace-beian-interdict"}]
</textarea>
<div id="J_1164210480" style="top:-60px; position: relative;"></div>
<div data-homon-module class="aliyun-module" data-section-id="" data-id="1164210480" data-spm="J_1164210480" data-module-id="1164210480" data-module-name="@ali/hmod-ace-beian-interdict" data-version="0.0.8" data-hidden="false" data-block-render="">
</div>
<div class="aliyun-module-config">
<textarea class="aliyun-module-data" data-target="1164210480" style="display:none;">
{"cnConfig":{"title":"网站暂时无法访问","list":[{"cont":[{"text":"请等待网站备案后尝试访问。"}],"title":"如果您是网站普通访客:"},{"title":"如果您是网站所有者,网站无法访问常见原因如下:","cont":[{"text":"1. 网站未完成备案、未在接入商完成备案接入。"},{"text":"2. 网站内容与备案信息不符、备案信息不准确、网站存在不适宜传播的内容等。"}]}],"subtitle":"该网站未根据工信部相关法律进行备案","gist":"法律依据:《非经营性互联网信息服务备案管理办法》","action":"点击进入备案管理平台","url":"https://beian.aliyun.com/"},"intlConfig":{"title":"The website is currently inaccessible...","list":[{"cont":[{"text":"Visit the website again after the website obtains an ICP filing."}],"title":"If you fail to access the website as a visitor:"},{"title":"If you fail to access the website as the website owner, the possible causes are as follows:","cont":[{"text":"1. You have not applied for an ICP filing for your website, or you have not added Alibaba Cloud to the ICP filing information as a service provider."},{"text":"2. The content that the website provides does not comply with the ICP filing information, the ICP filing information is inaccurate, or the website contains content that is not suitable for dissemination."}]}],"subtitle":"The website has not obtained an ICP filing according to the law of the Ministry of Industry and Information Technology of the People's Republic of China","gist":"Relevant law: Measures for the Archival Administration of Non-commercial Internet Information Services","action":"Click to go to the ICP filing management platform","url":"https://beian.aliyun.com/"},"styleConfig":{"width":""},"icon":"https://img.alicdn.com/tfs/TB1AqalCpY7gK0jSZKzXXaikpXa-370-254.png"}
</textarea>
<textarea class="aliyun-module-settings" data-target="1164210480" style="display:none;">
{"recommend":{"visibleMode":"default"},"anchor":{"visibleMode":"all"},"pc":{"background":"","horizontal":"默认","verticalNumber":0,"marginTop":"","marginBottom":"0","contentBackground":"","paddingHoz":"0","paddingTop":"0","paddingBottom":"0","backgroundImage":"","autoHeight":false},"h5":{"background":"","horizontal":"默认","verticalNumber":0,"marginTop":"0","marginBottom":"0","contentBackground":"","paddingHoz":"0","paddingTop":"0","paddingBottom":"0","backgroundImage":"","autoHeight":false}}
</textarea>
</div>
<script src="https://g.alicdn.com/??hmod/ace-beian-interdict/0.0.8/index.js,hmod/ace-beian-interdict/0.0.8/services.js"></script>
<script src="https://g.alicdn.com/homon/page-render/3.0.17/v1/index-pc.js">
</script>
</body>
</html>