diff --git a/upload/source/admincp/admincp_members.php b/upload/source/admincp/admincp_members.php index 822c9adb8568b5bdcd076b64a0d45137c2a59d55..405b42adbc48c67cf7407c571e94d7050501e4e2 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 c69e70f74eb38b6c3e4abf387d1e97801161cea7..f976edc18dba809fcf9bb9ec33e76dc53933593f 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 7a186db973b25c5b9633620288dfb7f271f706c1..91c41366a5ab47c931470c952e97e13b8bf226cf 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 a49888f53a807123e8ba0f4a706561e019444613..a6f20b85ed73c28cb2ae39fd05ff7dc4ecc997db 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 e43ec2f219225d2a1115b56d74460ef3e14f8231..eed446ca3cec5d32a6d2ad7345a3e99186f5d429 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 489f1cc5adbeba3922510e844488b678929789b5..da0e10cf2df94a723ca5d20cfd77211f79390fcc 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 2786e0d5cbd4fdfe88796df4a83c21c87ba9889e..096ba326feb782ee2f6c49ba2eb765b1725034a9 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 52ee36863738c0bea6bc87fcad60e22aa9be04e3..c6e73c85906c21e85e5c9ea59e5276cfdc0f9ba2 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 c0c380703dce15c235e6e4b9e85af8fa187919f1..f40ceb8fea41377a28dff0637e1bae4151540978 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 5e2b2ae1b72e0746842e694512ff6decc633382e..33011f82486ca02e7bc4d3f0532d79fedc9ee42b 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 e8045ddd2dab65eea499000eb92ab09b49c0643e..1187c8eb9193a51dc334171347869433de1fba3b 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 c44925bc124c9aa2529fe59e82baa61ca24c444f..f34b347c2630973c9857e4704fe9dfc0838eb7c6 100644 --- a/upload/template/default/common/header.htm +++ b/upload/template/default/common/header.htm @@ -138,7 +138,7 @@