更新至v1.87.1,更新内容在Dzzoffice笔记中查看

This commit is contained in:
小胡
2024-01-27 14:46:55 +08:00
Unverified
parent 267edf2912
commit 5e712bf0cd
9 changed files with 135 additions and 90 deletions

View File

@@ -18,7 +18,7 @@
<ul class="select-properties col-lg-12 col-md-12 col-sm-12 col-xs-12">
<!--{loop $perms $k $val}-->
<li class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<div class="form-check">
<div class="form-check">
<input class="form-check-input" type="checkbox" name="perms[]" value="$val[1]" id="inputval$val[1]"<!--{if $groupperm[perm] & $val[1]}--> checked="checked" <!--{/if}-->>
<label class="form-check-label" for="inputval$val[1]"><span class="{$val[2]} view-eidt perm_chk" data-perm="$val[1]"></span><span>$val[0]</span></label>
</div>

View File

@@ -192,11 +192,7 @@
<label class="col-sm-2">{lang sitelogo}</label>
<div class="col-sm-10">
<div class="file-hidde-content">
<!--{if $setting[sitelogo] > 0}-->
<img src="index.php?mod=io&op=thumbnail&size=small&path={eval echo dzzencode('attach::'.$setting[sitelogo]);}" class="upold-add">
<!--{else}-->
<img src="static/image/common/logo.png" class="upold-add">
<!--{/if}-->
<img src="{eval echo $_G['setting']['sitelogo']?'index.php?mod=io&op=thumbnail&size=small&path='.dzzencode('attach::'.$_G['setting']['sitelogo']):'static/image/common/logo.png';}" class="upold-add">
<input type="file" name="files[]" value="" class="file-hidde" />
<input type="hidden" name="settingnew[sitelogo]" value="$setting[sitelogo]" class="build-images" />
<div class="progress-bar"></div>

View File

@@ -14,7 +14,7 @@ if(!defined('CORE_VERSION')) {
define('CORE_VERSION', '2.02');
define('CORE_RELEASE', '20180909');
define('CORE_FIXBUG' , '20000000');
define('CORE_XHVERSION', '1.87');
define('CORE_XHRELEASE', '20240110');
define('CORE_XHVERSION', '1.87.1');
define('CORE_XHRELEASE', '20240127');
define('CORE_XHFIXBUG' , '20240110');
}

View File

@@ -32,6 +32,7 @@
}
.login-right {
max-width: 50%;
text-align: center;
}
<!--{if $_G[setting][loginset][kbcolor]}-->
.card{

View File

@@ -3,64 +3,20 @@
<!--{template common/header_simple_start}-->
<script src="static/bootstrap/js/bootstrap.min.js?{VERHASH}"></script>
<!--{template common/header_simple_end}-->
<nav class="navbar sticky-top navbar-dark navbar-expand-lg navbar-light">
<div class="container-fluid">
<a class="leftTopmenu navbar-brand" href="{$_G[siteurl]}">
<img src="{eval echo $_G['setting']['sitelogo']?'index.php?mod=io&op=thumbnail&size=small&path='.dzzencode('attach::'.$_G['setting']['sitelogo']):'static/image/common/logo.png';}" class="d-inline-block align-middle">
$_G['setting']['sitename']
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarScroll" aria-controls="navbarScroll" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarScroll">
<header class="fixed-top lyear-layout-header">
<nav class="navbar sticky-top navbar-dark navbar-expand-lg navbar-light">
<div class="container-fluid">
<!--{template header_left}-->
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarScroll" aria-controls="navbarScroll" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarScroll">
<!--{template header_search}-->
<!--{template header_right}-->
</div>
</div>
</nav>
<script type="text/javascript">
jQuery(document).ready(function(e) {
_header.init('{FORMHASH}');//初始化头部效果
//_header.Topcolor();
//_notice.init();
_notice.getNotificationCount();
});
_notice={};
_notice.flashStep=1;
_notice.checkurl='index.php?mod=system&op=notification&filter=checknew';
_notice.normalTitle= document.title;
_notice.getNotificationCount=function(){
jQuery.getJSON(_notice.checkurl,function(json){
var sum=parseInt(json.sum);
_notice.showTips(sum);
if(json.timeout>0) window.setTimeout(_notice.getNotificationCount,json.timeout);
});
}
_notice.showTips=function(sum){
if(sum>0){
jQuery('#dzz_notification>span.badge').html(sum).removeClass('hide');
jQuery('#dzz_notification>span.dzz').hide();
_notice.flashTitle();
}else{
jQuery('#dzz_notification>span.badge').addClass('hide');
jQuery('#dzz_notification>span.dzz').show();
_notice.flashTitle(1);
}
}
_notice.flashTitle=function(flag){
//仅窗口不在焦点时闪烁title回到焦点时停止闪烁并将title恢复正常
if(flag || CurrentActive){//当前处于焦点
document.title=_notice.normalTitle;
_notice.flashTitleRun = false;
return;//退出循环
}
_notice.flashTitleRun = true;
_notice.flashStep++;
if (_notice.flashStep==3) {_notice.flashStep=1;}
if (_notice.flashStep==1) {document.title="【您有新的通知】";}
if (_notice.flashStep==2) {document.title="【$_G[setting][sitename]】";}
setTimeout(function(){_notice.flashTitle();},500); //循环
}
</script>
</div>
</div>
</nav>
</header>
<!--{else}-->
<!--{template common/header_simple}-->
<style>
@@ -86,12 +42,8 @@
<!--{if $param[msgtype] == 1 || $param[msgtype] == 2 && !$_G[inajax]}-->
<div id="ct" class="text-center" style="display: flex;align-items: center;justify-content: center;min-height: -webkit-fill-available;margin: 0;text-align: center;">
<div id="messagetext">
<!--{if $_G['setting']['sitelogo']}-->
<img src="{eval echo $_G['setting']['sitelogo']?'index.php?mod=io&op=thumbnail&size=small&path='.dzzencode('attach::'.$_G['setting']['sitelogo']):'static/image/common/logo.png';}">
<!--{else}-->
<img src="static/image/common/logo.png">
<!--{/if}-->
<h4 style="font-size: large;">$show_message</h4>
<img src="<!--{if $_G['setting']['bbclosed'] && !$_G['adminid']}-->static/image/common/logo.png<!--{else}-->{eval echo $_G['setting']['sitelogo']?'index.php?mod=io&op=thumbnail&size=small&path='.dzzencode('attach::'.$_G['setting']['sitelogo']):'static/image/common/logo.png';}<!--{/if}-->">
<h4>$show_message</h4>
<!--{if !$_G['setting']['bbclosed']|| !$_G['adminid'] ==0}-->
<!--{if $url_forward}-->
<!--{if !$param[redirectmsg]}-->

View File

@@ -157,26 +157,119 @@ if(!isset($_GET['loginsubmit'])) {//是否提交
showTips(array('success'=>array('message'=>$messageText,'url_forward'=>$href)),$type);
} else {//登录失败记录日志
//写入日志
$password = preg_replace("/^(.{".round(strlen($_GET['password']) / 4)."})(.+?)(.{".round(strlen($_GET['password']) / 6)."})$/s", "\\1***\\3", $_GET['password']);
$errorlog = ($result['ucresult']['email'] ? $result['ucresult']['email'] : $_GET['email'])."尝试登录失败,尝试密码:".$password;
writelog('loginlog', $errorlog);
loginfailed($_GET['email']);//更新登录失败记录
if($_G['member_loginperm'] > 1) {
showTips(array('error'=>lang('login_invalid', array('loginperm' => $_G['member_loginperm'] - 1))),$type);
} elseif($_G['member_loginperm'] == -1) {
showTips(array('error'=>lang('login_password_invalid')),$type);
} else {
showTips(array('error'=>lang('login_strike')),$type);
} else {
$error=0;
$ldap=1;//1:启用ldap登录0关闭ldap登录
if($ldap){
if (!extension_loaded('ldap')) {
showTips(array('error'=>lang('尚未安装php-ldap扩展请联系管理员处理')),$type);
}else {
$ip="127.0.0.1";//域服务器IP 例127.0.0.1
$port="389";//域服务器端口默认389
$ldapbasedn="dc=maxcrc,dc=com";//ldap base dn 例如:dc=maxcrc,dc=com
$ldapbinddn="cn=Manager,dc=maxcrc,dc=com";//ldap bind dn 例如:cn=Manager,dc=maxcrc,dc=com
$ldapbindpassword="secret";//ldap bind password 例如:123456
$ldapversion="3";//ldap version 例2或3
$ldapuserfiled="cn";//ldap user filed 例如: cn或者sAMAccountName
$searchfilter="(cn=*)";//search filter 例如: (cn=*)
$emailh = "@dzz.com";//邮箱后缀,如果登录用户没有ldap邮箱就会以此为邮箱后缀生成邮箱。例如:@dzz.com
$ldap_conn = ldap_connect($ip,$port); //建立与 LDAP 服务器的连接
if (!$ldap_conn) {
showTips(array('error'=>lang('无法连接到LDAP服务器')),$type);
}
ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, $ldapversion);
$rs = ldap_bind($ldap_conn, $ldapbinddn,$ldapbindpassword); //与服务器绑定 用户登录验证 成功返回1
if (!$rs) {
showTips(array('error'=>lang('无法联系LDAP服务器')),$type);
}
$result = ldap_search($ldap_conn, $ldapbasedn, $searchfilter);
$data = ldap_get_entries($ldap_conn, $result);
for ($i = 0; $i < $data["count"]; $i++) {
$ldap_user = $data[$i][$ldapuserfiled][0];
$dn = $data[$i]["dn"];
if ($ldap_user == $_GET['email']) {
//如果该用户不存在,则帮助其注册
$userInfo=C::t('user')->fetch_by_username($_GET['email']);
if (!$userInfo) {
$rs2 = ldap_bind($ldap_conn, $dn, $_GET['password']);
if ($rs2) {
@session_unset();
$addorg=1;
$emailq = random(20);
$email = $emailq.$emailh;
$result = uc_user_register(addslashes($_GET['email']), $_GET['password'], $email, '', 0, '', $_G['clientip'], $addorg);
if (is_array($result)) {
$uid = $result['uid'];
$password = $result['password'];
} else {
$uid = $result;
}
if ($uid <= 0) {
if ($uid == -1) {
showTips(array('error'=>lang('profile_nickname_illega')),$type);
} elseif ($uid == -2) {
showTips(array('error'=>lang('profile_nickname_illega')),$type);
} elseif ($uid == -3) {
showTips(array('error'=>lang('profile_nickname_duplicate')),$type);
} elseif ($uid == -4) {
showTips(array('error'=>lang('profile_email_illegal')),$type);
} elseif ($uid == -5) {
showTips(array('error'=>lang('profile_email_domain_illegal')),$type);
} elseif ($uid == -6) {
showTips(array('error'=>lang('profile_email_duplicate')),$type);
} elseif ($uid == -7) {
showTips(array('error'=>lang('profile_username_illegal')),$type);
} else {
showTips(array('error'=>lang('undefined_action')),$type);
}
} else {
//设置登录
setloginstatus($result, $_GET['cookietime'] ? 2592000 : 0);
if ($_G['member']['lastip'] && $_G['member']['lastvisit']) {
dsetcookie('lip', $_G['member']['lastip'] . ',' . $_G['member']['lastvisit']);
}
//记录登录
C::t('user_status')->update($_G['uid'], array('lastip' => $_G['clientip'], 'lastvisit' =>TIMESTAMP, 'lastactivity' => TIMESTAMP));
writelog('loginlog', 'XH通用登录成功');
showTips(array('success'=>array('message'=>lang('congratulations'),'url_forward'=>$_G["siteurl"])),$type);
}
}else {
$error=0;
}
}else {
$error=0;
}
}else {
$error=0;
}
}
}
}else {
$error=0;
}
if(!$error){
//登录失败记录日志
//写入日志
$password = preg_replace("/^(.{".round(strlen($_GET['password']) / 4)."})(.+?)(.{".round(strlen($_GET['password']) / 6)."})$/s", "\\1***\\3", $_GET['password']);
$errorlog = ($result['ucresult']['email'] ? $result['ucresult']['email'] : $_GET['email'])."尝试登录失败,尝试密码:".$password;
writelog('loginlog', $errorlog);
loginfailed($_GET['email']);//更新登录失败记录
if($_G['member_loginperm'] > 1) {
showTips(array('error'=>lang('login_invalid', array('loginperm' => $_G['member_loginperm'] - 1))),$type);
} elseif($_G['member_loginperm'] == -1) {
showTips(array('error'=>lang('login_password_invalid')),$type);
} else {
showTips(array('error'=>lang('login_strike')),$type);
}
}
}

View File

@@ -36,6 +36,7 @@
}
.login-right {
max-width: 50%;
text-align: center;
}
<!--{if $_G[setting][loginset][kbcolor]}-->
.card{

View File

@@ -37,6 +37,7 @@
}
.login-right {
max-width: 50%;
text-align: center;
}
<!--{if $_G[setting][loginset][kbcolor]}-->
.card{

View File

@@ -36,6 +36,7 @@
}
.login-right {
max-width: 50%;
text-align: center;
}
<!--{if $_G[setting][loginset][kbcolor]}-->
.card{