From 5c4fc78cf2b1e7dc266380493258431522bc55eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E5=91=A8=E9=83=A8=E8=90=BD?= Date: Thu, 24 Dec 2020 16:16:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E9=83=A8=E5=88=86?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9C=AA=E8=80=83=E8=99=91=20adminid=20?= =?UTF-8?q?=E4=B8=BA=20-1=20=E8=80=8C=E5=AF=BC=E8=87=B4=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- upload/source/admincp/admincp_members.php | 2 +- upload/source/class/class_task.php | 6 +++--- upload/source/include/modcp/modcp_member.php | 2 +- upload/source/module/forum/forum_forumdisplay.php | 2 +- upload/source/module/forum/forum_post.php | 2 +- upload/source/module/forum/forum_viewthread.php | 2 +- upload/source/module/misc/misc_stat.php | 2 +- upload/source/module/search/search_forum.php | 2 +- upload/source/plugin/mobile/api/1/forumnav.php | 2 +- upload/source/plugin/mobile/api/3/forumnav.php | 2 +- upload/source/plugin/wechat/response.class.php | 4 ++-- upload/template/default/common/header.htm | 2 +- upload/template/default/home/space_header.htm | 2 +- upload/template/default/home/space_privacy.htm | 2 +- upload/template/default/home/space_profile_body.htm | 2 +- upload/template/default/home/space_thread_nav.htm | 2 +- upload/template/default/home/spacecp_credit_header.htm | 2 +- upload/template/default/home/spacecp_footer.htm | 2 +- upload/template/default/home/spacecp_profile.htm | 2 +- upload/template/default/home/spacecp_profile_nav.htm | 2 +- upload/template/default/mobile/home/space_profile.htm | 2 +- upload/template/default/portal/portalcp_nav.htm | 2 +- upload/template/default/search/header.htm | 2 +- upload/template/default/wml/home/space_profile.htm | 2 +- 24 files changed, 27 insertions(+), 27 deletions(-) diff --git a/upload/source/admincp/admincp_members.php b/upload/source/admincp/admincp_members.php index 822c9adb8..405b42adb 100644 --- a/upload/source/admincp/admincp_members.php +++ b/upload/source/admincp/admincp_members.php @@ -1533,7 +1533,7 @@ EOF; if($postcomment_cache_pid) { C::t('forum_postcache')->delete($postcomment_cache_pid); } - if(!$member['adminid']) { + if(in_array($member['adminid'], array(0, -1))) { $member_status = C::t('common_member_status')->fetch($member['uid']); } } elseif($member['groupid'] == 4 || $member['groupid'] == 5) { diff --git a/upload/source/class/class_task.php b/upload/source/class/class_task.php index c69e70f74..f976edc18 100644 --- a/upload/source/class/class_task.php +++ b/upload/source/class/class_task.php @@ -46,7 +46,7 @@ class task { if($task['allowapply'] < 0) { continue; } - $task['noperm'] = $task['applyperm'] && $task['applyperm'] != 'all' && !(($task['applyperm'] == 'member'&& $_G['adminid'] == '0') || ($task['applyperm'] == 'admin' && $_G['adminid'] > '0') || forumperm($task['applyperm'])); + $task['noperm'] = $task['applyperm'] && $task['applyperm'] != 'all' && !(($task['applyperm'] == 'member' && in_array($_G['adminid'], array(0, -1))) || ($task['applyperm'] == 'admin' && $_G['adminid'] > '0') || forumperm($task['applyperm'])); $task['appliesfull'] = $task['tasklimits'] && $task['achievers'] >= $task['tasklimits']; if($item == 'canapply' && ($task['noperm'] || $task['appliesfull'])) { continue; @@ -254,7 +254,7 @@ class task { } if($allowapply > 0) { - if($this->task['applyperm'] && $this->task['applyperm'] != 'all' && !(($this->task['applyperm'] == 'member' && $_G['adminid'] == '0') || ($this->task['applyperm'] == 'admin' && $_G['adminid'] > '0') || preg_match("/(^|\t)(".$_G['groupid'].")(\t|$)/", $this->task['applyperm']))) { + if($this->task['applyperm'] && $this->task['applyperm'] != 'all' && !(($this->task['applyperm'] == 'member' && in_array($_G['adminid'], array(0, -1))) || ($this->task['applyperm'] == 'admin' && $_G['adminid'] > '0') || preg_match("/(^|\t)(".$_G['groupid'].")(\t|$)/", $this->task['applyperm']))) { $allowapply = -2; } elseif($this->task['tasklimits'] && $this->task['achievers'] >= $this->task['tasklimits']) { $allowapply = -3; @@ -325,7 +325,7 @@ class task { if($this->task['relatedtaskid'] && !C::t('common_mytask')->count($_G['uid'], $this->task['relatedtaskid'], 1)) { return -1; - } elseif($this->task['applyperm'] && $this->task['applyperm'] != 'all' && !(($this->task['applyperm'] == 'member' && $_G['adminid'] == '0') || ($this->task['applyperm'] == 'admin' && $_G['adminid'] > '0') || preg_match("/(^|\t)(".$_G['groupid'].")(\t|$)/", $this->task['applyperm']))) { + } elseif($this->task['applyperm'] && $this->task['applyperm'] != 'all' && !(($this->task['applyperm'] == 'member' && in_array($_G['adminid'], array(0, -1))) || ($this->task['applyperm'] == 'admin' && $_G['adminid'] > '0') || preg_match("/(^|\t)(".$_G['groupid'].")(\t|$)/", $this->task['applyperm']))) { return -2; } elseif(!$this->task['period'] && C::t('common_mytask')->count($_G['uid'], $id)) { return -3; diff --git a/upload/source/include/modcp/modcp_member.php b/upload/source/include/modcp/modcp_member.php index 7a186db97..91c41366a 100644 --- a/upload/source/include/modcp/modcp_member.php +++ b/upload/source/include/modcp/modcp_member.php @@ -97,7 +97,7 @@ if($op == 'edit') { } else { $setarr['groupexpiry'] = 0; } - if(!$member['adminid']) { + if(in_array($member['adminid'], array(0, -1))) { $member_status = C::t('common_member_status')->fetch($member['uid']); } $adminidnew = -1; diff --git a/upload/source/module/forum/forum_forumdisplay.php b/upload/source/module/forum/forum_forumdisplay.php index a49888f53..a6f20b85e 100644 --- a/upload/source/module/forum/forum_forumdisplay.php +++ b/upload/source/module/forum/forum_forumdisplay.php @@ -918,7 +918,7 @@ $_G['forum']['allowpostattach'] = isset($_G['forum']['allowpostattach']) ? $_G[' $allowpostattach = $fastpost && ($_G['forum']['allowpostattach'] != -1 && ($_G['forum']['allowpostattach'] == 1 || (!$_G['forum']['postattachperm'] && $_G['group']['allowpostattach']) || ($_G['forum']['postattachperm'] && forumperm($_G['forum']['postattachperm'])))); if($fastpost || $livethread) { - if(!$_G['adminid'] && (!cknewuser(1) || $_G['setting']['newbiespan'] && (!getuserprofile('lastpost') || TIMESTAMP - getuserprofile('lastpost') < $_G['setting']['newbiespan'] * 60) && TIMESTAMP - $_G['member']['regdate'] < $_G['setting']['newbiespan'] * 60)) { + if(in_array($_G['adminid'], array(0, -1)) && (!cknewuser(1) || $_G['setting']['newbiespan'] && (!getuserprofile('lastpost') || TIMESTAMP - getuserprofile('lastpost') < $_G['setting']['newbiespan'] * 60) && TIMESTAMP - $_G['member']['regdate'] < $_G['setting']['newbiespan'] * 60)) { $allowfastpost = false; } $usesigcheck = $_G['uid'] && $_G['group']['maxsigsize']; diff --git a/upload/source/module/forum/forum_post.php b/upload/source/module/forum/forum_post.php index e43ec2f21..eed446ca3 100644 --- a/upload/source/module/forum/forum_post.php +++ b/upload/source/module/forum/forum_post.php @@ -160,7 +160,7 @@ if(empty($_G['forum']['allowview'])) { formulaperm($_G['forum']['formulaperm']); -if(!$_G['adminid'] && $_G['setting']['newbiespan'] && (!getuserprofile('lastpost') || TIMESTAMP - getuserprofile('lastpost') < $_G['setting']['newbiespan'] * 60) && TIMESTAMP - $_G['member']['regdate'] < $_G['setting']['newbiespan'] * 60) { +if(in_array($_G['adminid'], array(0, -1)) && $_G['setting']['newbiespan'] && (!getuserprofile('lastpost') || TIMESTAMP - getuserprofile('lastpost') < $_G['setting']['newbiespan'] * 60) && TIMESTAMP - $_G['member']['regdate'] < $_G['setting']['newbiespan'] * 60) { showmessage('post_newbie_span', '', array('newbiespan' => $_G['setting']['newbiespan'])); } diff --git a/upload/source/module/forum/forum_viewthread.php b/upload/source/module/forum/forum_viewthread.php index 489f1cc5a..da0e10cf2 100644 --- a/upload/source/module/forum/forum_viewthread.php +++ b/upload/source/module/forum/forum_viewthread.php @@ -320,7 +320,7 @@ $_G['forum']['allowpost'] = isset($_G['forum']['allowpost']) ? $_G['forum']['all $allowpostreply = ($_G['forum']['allowreply'] != -1) && (($_G['forum_thread']['isgroup'] || (!$_G['forum_thread']['closed'] && !checkautoclose($_G['forum_thread']))) || $_G['forum']['ismoderator']) && ((!$_G['forum']['replyperm'] && $_G['group']['allowreply']) || ($_G['forum']['replyperm'] && forumperm($_G['forum']['replyperm'])) || $_G['forum']['allowreply']); $fastpost = $_G['setting']['fastpost'] && !$_G['forum_thread']['archiveid'] && ($_G['forum']['status'] != 3 || $_G['isgroupuser']); $allowfastpost = $_G['setting']['fastpost'] && $allowpostreply; -if(!$_G['uid'] && ($_G['setting']['need_avatar'] || $_G['setting']['need_email'] || $_G['setting']['need_friendnum']) || !$_G['adminid'] && (!cknewuser(1) || $_G['setting']['newbiespan'] && (!getuserprofile('lastpost') || TIMESTAMP - getuserprofile('lastpost') < $_G['setting']['newbiespan'] * 60) && TIMESTAMP - $_G['member']['regdate'] < $_G['setting']['newbiespan'] * 60)) { +if(!$_G['uid'] && ($_G['setting']['need_avatar'] || $_G['setting']['need_email'] || $_G['setting']['need_friendnum']) || in_array($_G['adminid'], array(0, -1)) && (!cknewuser(1) || $_G['setting']['newbiespan'] && (!getuserprofile('lastpost') || TIMESTAMP - getuserprofile('lastpost') < $_G['setting']['newbiespan'] * 60) && TIMESTAMP - $_G['member']['regdate'] < $_G['setting']['newbiespan'] * 60)) { $allowfastpost = false; } $_G['group']['allowpost'] = $_G['forum']['allowpost'] != -1 && ((!$_G['forum']['postperm'] && $_G['group']['allowpost']) || ($_G['forum']['postperm'] && forumperm($_G['forum']['postperm'])) || $_G['forum']['allowpost']); diff --git a/upload/source/module/misc/misc_stat.php b/upload/source/module/misc/misc_stat.php index 2786e0d5c..096ba326f 100644 --- a/upload/source/module/misc/misc_stat.php +++ b/upload/source/module/misc/misc_stat.php @@ -343,7 +343,7 @@ function getstatvars_modworks() { $uid = $_GET['uid']; $member = getuserbyuid($uid, 1); - if(!$member || $member['adminid'] == 0) { + if(empty($member) || !is_array($member) || in_array($_G['adminid'], array(0, -1))) { showmessage('member_not_found'); } diff --git a/upload/source/module/search/search_forum.php b/upload/source/module/search/search_forum.php index 52ee36863..c6e73c859 100644 --- a/upload/source/module/search/search_forum.php +++ b/upload/source/module/search/search_forum.php @@ -16,7 +16,7 @@ if(!$_G['setting']['search']['forum']['status']) { showmessage('search_forum_closed'); } -if(!$_G['adminid'] && !($_G['group']['allowsearch'] & 2)) { +if(in_array($_G['adminid'], array(0, -1)) && !($_G['group']['allowsearch'] & 2)) { showmessage('group_nopermission', NULL, array('grouptitle' => $_G['group']['grouptitle']), array('login' => 1)); } diff --git a/upload/source/plugin/mobile/api/1/forumnav.php b/upload/source/plugin/mobile/api/1/forumnav.php index c0c380703..f40ceb8fe 100644 --- a/upload/source/plugin/mobile/api/1/forumnav.php +++ b/upload/source/plugin/mobile/api/1/forumnav.php @@ -44,7 +44,7 @@ class mobile_api { if($_G['adminid'] == 3 && strpos($forum['moderators'], $_G['username']) === false) { $unsetthreadtype = true; } - if($_G['adminid'] == 0) { + if(in_array($_G['adminid'], array(0, -1))) { $unsetthreadtype = true; } if($unsetthreadtype) { diff --git a/upload/source/plugin/mobile/api/3/forumnav.php b/upload/source/plugin/mobile/api/3/forumnav.php index 5e2b2ae1b..33011f824 100644 --- a/upload/source/plugin/mobile/api/3/forumnav.php +++ b/upload/source/plugin/mobile/api/3/forumnav.php @@ -49,7 +49,7 @@ class mobile_api { if($_G['adminid'] == 3 && strpos($forum['moderators'], $_G['username']) === false) { $unsetthreadtype = true; } - if($_G['adminid'] == 0) { + if(in_array($_G['adminid'], array(0, -1))) { $unsetthreadtype = true; } if($unsetthreadtype) { diff --git a/upload/source/plugin/wechat/response.class.php b/upload/source/plugin/wechat/response.class.php index e8045ddd2..1187c8eb9 100644 --- a/upload/source/plugin/wechat/response.class.php +++ b/upload/source/plugin/wechat/response.class.php @@ -89,7 +89,7 @@ class WSQResponse { } else { if($authcode['uid']) { $member = getuserbyuid($authcode['uid'], 1); - if($member['adminid'] == 0 && !$_G['wechat']['setting']['wechat_confirmtype']) { + if(in_array($_G['adminid'], array(0, -1)) && !$_G['wechat']['setting']['wechat_confirmtype']) { C::t('#wechat#mobile_wechat_authcode')->update($authcode['sid'], array('uid' => $member['uid'], 'status' => 1)); $authcode['sid'] = ''; } @@ -97,7 +97,7 @@ class WSQResponse { $wechatuser = C::t('#wechat#common_member_wechat')->fetch_by_openid($data['from']); if($wechatuser) { $member = getuserbyuid($wechatuser['uid'], 1); - if($member['adminid'] == 0 && !$_G['wechat']['setting']['wechat_confirmtype']) { + if(in_array($_G['adminid'], array(0, -1)) && !$_G['wechat']['setting']['wechat_confirmtype']) { C::t('#wechat#mobile_wechat_authcode')->update($authcode['sid'], array('uid' => $member['uid'], 'status' => 1)); $authcode['sid'] = ''; } diff --git a/upload/template/default/common/header.htm b/upload/template/default/common/header.htm index c44925bc1..f34b347c2 100644 --- a/upload/template/default/common/header.htm +++ b/upload/template/default/common/header.htm @@ -138,7 +138,7 @@ \ No newline at end of file diff --git a/upload/template/default/mobile/home/space_profile.htm b/upload/template/default/mobile/home/space_profile.htm index 79b7bcb30..dd013b252 100644 --- a/upload/template/default/mobile/home/space_profile.htm +++ b/upload/template/default/mobile/home/space_profile.htm @@ -40,7 +40,7 @@ {lang active_profile}   - + {lang management_team}: {$space[admingroup][grouptitle]} {$space[admingroup][icon]} diff --git a/upload/template/default/portal/portalcp_nav.htm b/upload/template/default/portal/portalcp_nav.htm index 08efcd6c3..d17e5ba04 100644 --- a/upload/template/default/portal/portalcp_nav.htm +++ b/upload/template/default/portal/portalcp_nav.htm @@ -10,7 +10,7 @@ - $module[name] + $module[name] diff --git a/upload/template/default/search/header.htm b/upload/template/default/search/header.htm index 81b3396eb..06fbc1b7e 100644 --- a/upload/template/default/search/header.htm +++ b/upload/template/default/search/header.htm @@ -29,7 +29,7 @@