本文整理汇总了PHP中pwRights函数的典型用法代码示例。如果您正苦于以下问题:PHP pwRights函数的具体用法?PHP pwRights怎么用?PHP pwRights使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pwRights函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getReadRight
function getReadRight($user)
{
global $isGM, $isBM, $admincheck, $pwPostHide, $pwSellHide, $pwEncodeHide, $manager, $groupid, $windid;
$pwSystem = array();
if ($user->groupid != 'guest') {
$isGM = S::inArray($windid, $manager);
if (!$isGM) {
$pwSystem = pwRights();
$pwPostHide = $pwSystem['posthide'];
$pwSellHide = $pwSystem['sellhide'];
$pwEncodeHide = $pwSystem['encodehide'];
} else {
$pwPostHide = $pwSellHide = $pwEncodeHide = 1;
}
}
}
示例2: check
function check()
{
global $db_allowupload, $winddb, $groupid, $_G, $windid, $winduid, $manager;
if (empty($this->attach)) {
return 'job_attach_error';
}
if (!$db_allowupload) {
return 'upload_close';
} elseif (!$this->forum->allowupload($winddb, $groupid)) {
return 'upload_forum_right';
} elseif (!$this->forum->foruminfo['allowupload'] && $_G['allowupload'] == 0) {
return 'upload_group_right';
}
if (!($winduid == $this->attach['uid'] || S::inArray($windid, $manager) || pwRights($this->forum->isBM($windid), 'deltpcs', $this->forum->fid))) {
return 'modify_noper';
}
return true;
}
示例3: wap_check
function wap_check($fid, $action)
{
global $db, $groupid, $_G, $_time, $db_titlemax, $db_postmin, $db_postmax, $subject, $content;
$subject = trim($subject);
$content = trim($content);
if ($action == 'new' && (!$subject || strlen($subject) > $db_titlemax)) {
wap_msg('subject_limit');
}
if (strlen($content) >= $db_postmax || strlen($content) < $db_postmin) {
wap_msg('content_limit');
}
$fm = $db->get_one("SELECT f.forumadmin,f.fupadmin,f.password,f.allowvisit,f.f_type,f.f_check,f.allowpost,f.allowrp,fe.forumset FROM pw_forums f LEFT JOIN pw_forumsextra fe USING(fid) WHERE f.fid=" . pwEscape($fid));
$forumset = unserialize($fm['forumset']);
if (!$fm || $fm['password'] != '' || $fm['f_type'] == 'hidden' || $fm['allowvisit'] && @strpos($fm['allowvisit'], ",{$groupid},") === false) {
wap_msg('post_right');
}
if ($action == 'new') {
$isGM = CkInArray($GLOBALS['windid'], $GLOBALS['manager']);
$isBM = admincheck($fm['forumadmin'], $fm['fupadmin'], $GLOBALS['windid']);
if ($fm['f_check'] == '1' || $fm['f_check'] == '3') {
wap_msg('post_right');
}
if ($fm['allowpost'] && strpos($fm['allowpost'], ",{$groupid},") === false) {
wap_msg('post_right');
}
if (!$fm['allowpost'] && $_G['allowpost'] == 0) {
wap_msg('post_group');
}
if ($forumset['allowtime'] && !$isGM && !allowcheck($forumset['allowtime'], "{$_time['hours']}", '') && !pwRights($isBM, 'allowtime')) {
wap_msg('post_right');
}
} elseif ($action == 'reply') {
if ($fm['f_check'] == '2' || $fm['f_check'] == '3') {
wap_msg('reply_right');
}
if ($fm['allowrp'] && strpos($fm['allowrp'], ",{$groupid},") === false) {
wap_msg('reply_right');
}
if (!$fm['allowrp'] && $_G['allowrp'] == 0) {
wap_msg('reply_group');
}
}
}
示例4: extract
extract(L::style());
$leaveword = $atcdb['leaveword'] ? leaveword($atcdb['leaveword']) : '';
$content = convert($atc_content . $leaveword, $db_windpost);
if (strpos($content, '[p:') !== false || strpos($content, '[s:') !== false) {
$content = showface($content);
}
if ($atcdb['ifsign'] < 2) {
$content = str_replace("\n", '<br />', $content);
}
if ($postdata->data['ifwordsfb'] == 0) {
$wordsfb = L::loadClass('FilterUtil', 'filter');
$content = addslashes($wordsfb->convert(stripslashes($content)));
}
$creditnames = pwCreditNames();
if ($atcdb['attachs']) {
$attachShow = new attachShow($pwpost->isGM || pwRights($pwpost->isBM, 'delattach'), $pwforum->forumset['uploadset']);
$attachShow->setData($atcdb['attachs']);
$attachShow->parseAttachs($pid, $content, $winduid == $atcdb['authorid']);
}
$alterinfo && ($content .= "<div id=\"alert_{$pid}\" style=\"color:gray;margin-top:30px\">[ {$alterinfo} ]</div>");
$atcdb['icon'] = $atcdb['icon'] ? "<img src=\"{$imgpath}/post/emotion/{$atcdb['icon']}.gif\" align=\"left\" border=\"0\" />" : '';
echo "success\t" . stripslashes($atc_title) . "\t" . str_replace(array("\r", "\t"), array("", ""), stripslashes($content));
ajax_footer();
}
} elseif ($a == 'join') {
define('F_M', true);
$groupid == 'guest' && Showmsg('not_login');
if (($return = $newColony->checkJoinStatus($winduid)) !== true) {
Showmsg($return);
}
S::gp(array('frombbs'));
示例5: pwEscape
$S_sql = $J_sql = '';
}
$tpcarray = $db->get_one("SELECT t.tid,t.fid,t.locked,t.ifcheck,t.author,t.authorid,t.postdate,t.lastpost,t.ifmail,t.special,t.subject,t.type,t.ifshield,t.anonymous,t.ptable,t.replies,t.tpcstatus {$S_sql} FROM pw_threads t {$J_sql} WHERE t.tid=" . pwEscape($tid));
$pw_posts = GetPtable($tpcarray['ptable']);
$tpcarray['openIndex'] = getstatus($tpcarray['tpcstatus'], 2);
if ($tpcarray['fid'] != $fid) {
wap_msg('illegal_tid', $rurl);
}
if ($pwforum->forumset['lock'] && !$pwpost->isGM && $timestamp - $tpcarray['postdate'] > $pwforum->forumset['lock'] * 86400 && !pwRights($pwpost->isBM, 'replylock')) {
$forumset['lock'] = $pwforum->forumset['lock'];
wap_msg('forum_locked', $rurl);
}
if (!$pwpost->isGM && !$tpcarray['ifcheck'] && !pwRights($pwpost->isBM, 'viewcheck')) {
wap_msg('reply_ifcheck', $rurl);
}
if (!$pwpost->isGM && $tpcarray['locked'] % 3 != 0 && !pwRights($pwpost->isBM, 'replylock')) {
wap_msg('reply_lockatc', $rurl);
}
InitGP(array('subject', 'content'), 'P', 0);
checkWapPost(0);
require_once R_P . 'lib/forum/replypost.class.php';
$replypost = new replyPost($pwpost);
$replypost->setTpc($tpcarray);
$replypost->check();
!empty($pwpost->errMsg) && wap_msg($pwpost->errMsg);
require_once R_P . 'require/bbscode.php';
$replypost->setTpc($tpcarray);
$content = $content . "\r\n\r\n[size=2][color=#a5a5a5]内容来自[/color][color=#4f81bd][url=" . $db_bbsurl . "/m/index.php][手机版][/url][/color] [/size]";
$postdata = new replyPostData($pwpost);
$postdata->setTitle(wap_cv($subject, false));
$postdata->setContent(wap_cv($content, false));
示例6: exit
<?php
!defined('P_W') && exit('Forbidden');
InitGP(array('id'), null, 2);
InitGP(array('record'));
$rt = $db->get_one("SELECT tid,fid FROM pw_pinglog WHERE ifhide=0 AND id=" . S::sqlEscape($id));
if (empty($rt) || !$rt['fid']) {
Showmsg('data_error');
}
L::loadClass('forum', 'forum', false);
$pwforum = new PwForum($rt['fid']);
$isGM = CkInArray($windid, $manager);
if (!$isGM && !pwRights($pwforum->isBM($windid), 'pingcp', $rt['fid'])) {
Showmsg('mawhole_right');
}
//$db->update("UPDATE pw_pinglog SET record=" . S::sqlEscape($record) . " WHERE id=" . S::sqlEscape($id));
pwQuery::update('pw_pinglog', 'id=:id', array($id), array('record' => $record));
echo "success";
# memcache reflesh
if ($db_memcache) {
//* $threads = L::loadClass('Threads', 'forum');
//* $threads->delThreads($rt['tid']);
Perf::gatherInfo('changeThreadWithThreadIds', array('tid' => $rt['tid']));
}
ajax_footer();
示例7: array
$showfield[] = $key;
}
}
!empty($showfield) && ($fieldinfo .= ',mi.customdata');
$fieldinfo && ($tableinfo = 'LEFT JOIN pw_memberinfo mi ON mi.uid=m.uid');
/**************************************/
//帖子浏览及管理权限
$isGM = $isBM = $admincheck = $managecheck = $pwPostHide = $pwSellHide = $pwEncodeHide = 0;
$pwSystem = array();
if ($groupid != 'guest') {
$isGM = S::inArray($windid, $manager);
$isBM = admincheck($foruminfo['forumadmin'], $foruminfo['fupadmin'], $windid);
$admincheck = $isGM || $isBM ? 1 : 0;
if (!$isGM) {
#非创始人权限获取
$pwSystem = pwRights($isBM);
if ($pwSystem && ($pwSystem['tpccheck'] || $pwSystem['digestadmin'] || $pwSystem['lockadmin'] || $pwSystem['pushadmin'] || $pwSystem['coloradmin'] || $pwSystem['downadmin'] || $pwSystem['delatc'] || $pwSystem['moveatc'] || $pwSystem['copyatc'] || $pwSystem['topped'] || $pwSystem['unite'] || $pwSystem['pingcp'] || $pwSystem['areapush'])) {
$managecheck = 1;
}
$pwPostHide = $pwSystem['posthide'];
$pwSellHide = $pwSystem['sellhide'];
$pwEncodeHide = $pwSystem['encodehide'];
} else {
$managecheck = $pwPostHide = $pwSellHide = $pwEncodeHide = 1;
}
}
//版块查看权限
if ($foruminfo['allowread'] && !$admincheck && !allowcheck($foruminfo['allowread'], $groupid, $winddb['groups'])) {
Showmsg('forum_read_right');
}
if (!$admincheck) {
示例8: array
$credit->addLog("topic_{$creditOpKey}", $creditset[$creditOpKey], array('uid' => $tpcData['authorid'], 'username' => $tpcData['author'], 'ip' => $onlineip, 'fname' => strip_tags($foruminfo['name']), 'operator' => $windid));
$credit->sets($tpcData['authorid'], $creditset[$creditOpKey], false);
}
$credit->runsql();
require_once R_P . 'require/msg.php';
foreach ($msgdb as $key => $val) {
pwSendMsg($val);
}
$delarticle->delTopic($readdb);
# memcache refresh
$threadList = L::loadClass("threadlist");
$threadList->refreshThreadIdsByForumId($fid);
refreshto("forumcp.php?action=edit&type={$type}&fid={$fid}", 'operate_success');
}
} elseif ($type == 'pcheck') {
if (!$isGM && !pwRights($isBM, 'viewcheck')) {
Showmsg('not_forumadmin');
}
if (empty($_POST['step'])) {
InitGP(array('starttime', 'endtime', 'username', 'ptable'));
InitGP(array('page'), 'GP', 2);
$page < 1 && ($page = 1);
$limit = pwLimit(($page - 1) * $db_perpage, $db_perpage);
$sql = $url_a = '';
$_POST['starttime'] && ($starttime = PwStrtoTime($starttime));
$_POST['endtime'] && ($endtime = PwStrtoTime($endtime));
if ($username) {
$sql .= ' AND author=' . pwEscape($username);
$url_a .= "username=" . rawurlencode($username) . "&";
}
if ($starttime) {
示例9: array
//$db->update("UPDATE pw_threads SET locked='$s' WHERE tid=".S::sqlEscape($rt['tid']));
pwQuery::update('pw_threads', "tid=:tid", array($rt['tid']), array("locked" => $s));
if ($ifmsg) {
$msgdb[] = array('toUser' => $rt['author'], 'title' => getLangInfo('writemsg', 'unlock_title'), 'content' => getLangInfo('writemsg', 'unlock_content', array('manager' => $windid, 'fid' => $fid, 'tid' => $rt['tid'], 'subject' => $rt['subject'], 'postdate' => get_date($rt['postdate']), 'forum' => strip_tags($forum[$fid]['name']), 'admindate' => get_date($timestamp), 'reason' => stripslashes($atc_content))));
}
$logdb[] = array('type' => 'locked', 'username1' => $rt['author'], 'username2' => $windid, 'field1' => $fid, 'field2' => $rt['tid'], 'field3' => '', 'descrip' => 'unlock_descrip', 'timestamp' => $timestamp, 'ip' => $onlineip, 'tid' => $rt['tid'], 'subject' => substrs($rt['subject'], 28), 'forum' => $forum[$fid]['name'], 'reason' => stripslashes($atc_content));
}
}
sendMawholeMessages($msgdb);
foreach ($logdb as $key => $val) {
writelog($val);
}
refreshto("apps.php?q=group&a=thread&cyid={$cyid}", 'lock_success');
}
} elseif ($action == 'pushtopic') {
$pushtime_top = (int) pwRights(false, 'pushtime');
if (empty($_POST['step'])) {
require_once PrintEot('m_topicadmin');
footer();
} else {
PostCheck();
S::gp(array('ifmsg', 'nextto', 'pushtime'));
if (!is_numeric($pushtime)) {
Showmsg('mawhole_erropushtime');
}
if ($pushtime_top && $pushtime > $pushtime_top) {
Showmsg('mawhole_beyondpushtime');
}
$msgdb = $logdb = array();
$query = $db->query("SELECT tid,fid,postdate,author,authorid,subject FROM pw_threads WHERE tid IN(" . S::sqlImplode($selids) . ")");
while ($rt = $db->fetch_array($query)) {
示例10: editlog
function editlog()
{
if ($this->post->uid != $this->atcdb['authorid'] && ($this->post->isGM || pwRights($this->post->isBM, 'deltpcs'))) {
/**
* 管理员编辑帖子的安全日记
*/
global $timestamp, $onlineip;
require_once R_P . 'require/writelog.php';
$log = array('type' => 'edit', 'username1' => $this->atcdb['author'], 'username2' => $this->post->username, 'field1' => $this->forum->fid, 'field2' => '', 'field3' => '', 'descrip' => 'edit_descrip', 'timestamp' => $timestamp, 'ip' => $onlineip, 'tid' => $this->tid, 'forum' => $this->forum->name, 'subject' => substrs($this->data['title'], 28), 'reason' => 'edit article');
writelog($log);
}
}
示例11: Showmsg
if ($bandb['type'] == 3) {
Showmsg('ban_info3');
} else {
Cookie('force', '', 0);
}
}
$userlastptime = $groupid != 'guest' ? $winddb['lastpost'] : GetCookie('userlastptime');
/**
* 灌水预防
*/
$tdtime >= $winddb['lastpost'] && ($winddb['todaypost'] = 0);
$montime >= $winddb['lastpost'] && ($winddb['monthpost'] = 0);
if ($_G['postlimit'] && $winddb['todaypost'] >= $_G['postlimit']) {
Showmsg('post_gp_limit');
}
if (!empty($_POST['step']) && !$pwpost->isGM && $_G['postpertime'] && $timestamp >= $userlastptime && $timestamp - $userlastptime <= $_G['postpertime'] && !pwRights($pwpost->isBM, 'postpers')) {
Showmsg('post_limit');
}
list($postq, $showq) = explode("\t", $db_qcheck);
$_G['uploadtype'] && ($db_uploadfiletype = $_G['uploadtype']);
$db_uploadfiletype = !empty($db_uploadfiletype) ? is_array($db_uploadfiletype) ? $db_uploadfiletype : unserialize($db_uploadfiletype) : array();
empty($db_sellset['type']) && ($db_sellset['type'] = array('money'));
empty($db_enhideset['type']) && ($db_enhideset['type'] = array('rvrc'));
if (empty($_POST['step'])) {
require_once R_P . 'require/credit.php';
$editor = getstatus($winddb['userstatus'], PW_USERSTATUS_EDITOR) ? 'wysiwyg' : 'textmode';
!is_numeric($db_attachnum) && ($db_attachnum = 1);
$htmlsell = $pwforum->foruminfo['allowsell'] && $_G['allowsell'] ? '' : 'disabled';
$htmlhide = $pwforum->forumset['allowencode'] && $_G['allowencode'] ? '' : 'disabled';
$htmlpost = $attachHide = $pwforum->foruminfo['allowhide'] && $_G['allowhidden'] ? '' : 'disabled';
$ifanonymous = $pwpost->isGM || $pwforum->forumset['anonymous'] && $_G['anonymous'] ? '' : 'disabled';
示例12: array
$lastpost = $rt['subject'] . "\t" . $rt['author'] . "\t" . $rt['postdate'] . "\t" . "read.php?tid={$rt['tid']}&ds=1&page=e#a";
//* $db->update("UPDATE pw_forumdata SET topic=topic+'1',article=article+'1',tpost=tpost+'1',lastpost=".S::sqlEscape($lastpost,false)." WHERE fid='$fid'");
$db->update(pwQuery::buildClause("UPDATE :pw_table SET topic=topic+'1',article=article+'1',tpost=tpost+'1',lastpost=:lastpost WHERE fid=:fid", array('pw_forumdata', $lastpost, $fid)));
//更新审核日志
$db->update(pwQuery::buildClause("UPDATE :pw_table SET state=1,assessor=:assessor WHERE tid=:tid", array('pw_filter', $windid, $rt[tid])));
}
Showmsg('operate_success');
} elseif ($action == 'inspect') {
$forumset = $foruminfo['forumset'];
if (empty($forumset['inspect'])) {
Showmsg('undefined_action');
}
S::gp(array('pid', 'page', 'p', 'nextto'));
$pid = (int) $pid;
$page = (int) $page;
if (!empty($foruminfo['t_type']) && ($isGM || pwRights($isBM, 'tpctype'))) {
$iftypeavailable = 1;
}
$rt = $db->get_one('SELECT inspect FROM pw_threads WHERE tid=' . S::sqlEscape($tid) . " AND fid=" . S::sqlEscape($fid));
empty($rt) && Showmsg('undefined_action');
list($lou) = explode("\t", $rt['inspect']);
$pid >= intval($lou) && ($lou = $pid);
$inspect = $lou . "\t" . addslashes($windid);
//$db->update('UPDATE pw_threads SET inspect='.S::sqlEscape($inspect).' WHERE tid='.S::sqlEscape($tid));
pwQuery::update('pw_threads', 'tid=:tid', array($tid), array('inspect' => $inspect));
delfcache($fid, $db_fcachenum);
if (!empty($nextto)) {
if (!defined('AJAX')) {
refreshto("mawhole.php?action={$nextto}&fid={$fid}&seltid={$tid}", 'operate_success');
} else {
$selids = $tid;
示例13: list
//title
list($guidename, $forumtitle) = $pwforum->getTitle();
if (!$replytitle) {
$atc_title = "Re:{$read['subject']}";
//$forumtitle = "$atc_title|$forumtitle";
} else {
$atc_title = "Re:{$replytitle}";
//$forumtitle = "$atc_title|$tpcarray[subject]|$forumtitle";
}
//time
list($postTime) = getLastDate($atcarray['postdate']);
$atc_title = substrs(str_replace(' ', ' ', $atc_title), $db_titlemax - 3);
//quote
if ((!$tpc_locked || $SYSTEM['replylock']) && ($admincheck || $pwforum->allowreply($winddb, $groupid))) {
if (!$admincheck && !$foruminfo['allowrp'] && !$_G['allowrp']) {
quickPostMessage('reply_group_right');
}
require_once PrintEot('quickpost');
ajax_footer();
}
if (!$isGM && $tpc_locked && !pwRights($isBM, 'replylock')) {
//locked
quickPostMessage('reply_lockatc');
}
quickPostMessage('reply_group_right');
function quickPostMessage($message)
{
$message = getLangInfo('msg', $message);
echo $message;
ajax_footer();
}
示例14: getAdminRight
/**
* 返回报名列表管理/浏览权限
* @param int $authorid 发起人id
* @return bool
* @access private
*/
function getAdminRight($authorid)
{
global $groupid, $manager, $foruminfo, $windid;
$isGM = S::inArray($windid, $manager);
//是否是创始人
$isBM = admincheck($foruminfo['forumadmin'], $foruminfo['fupadmin'], $windid);
//是否有管理权限
if (!$isGM) {
#非创始人权限获取
$pwSystem = pwRights($isBM);
if ($pwSystem && $pwSystem['activitylist']) {
$isBM = 1;
} else {
$isBM = 0;
}
}
if ($groupid == 3 || $isGM || $isBM || $authorid == $this->winduid) {
return true;
}
return false;
}
示例15: substrs
if (!$replytitle) {
$atc_title = "Re:{$tpcarray['subject']}";
$forumtitle = "{$atc_title}|{$forumtitle}";
} else {
$atc_title = "Re:{$replytitle}";
$forumtitle = "{$atc_title}|{$tpcarray['subject']}|{$forumtitle}";
}
$atc_title = substrs(str_replace(' ', ' ', $atc_title), $db_titlemax - 3);
$db_metakeyword = str_replace(array('|', ' - '), ',', $forumtitle) . 'phpwind';
require_once R_P . 'require/header.php';
$msg_guide = $pwforum->headguide($guidename);
$post_reply = '';
$review_reply = '';
if ($db_showreplynum > 0) {
$wordsfb = L::loadClass('FilterUtil', 'filter');
$pwAnonyHide = $pwpost->isGM || pwRights($pwpost->isBM, 'anonyhide');
$query = $db->query("SELECT p.pid,p.author,p.authorid,p.subject,p.postdate,p.content,p.anonymous,p.ifconvert,p.ifwordsfb,p.ifshield,m.uid,m.groupid,m.userstatus FROM {$pw_posts} p LEFT JOIN pw_members m ON p.authorid=m.uid WHERE tid=" . S::sqlEscape($tid) . "AND ifcheck='1' ORDER BY postdate DESC LIMIT 0,{$db_showreplynum}");
while ($rt = $db->fetch_array($query)) {
$tpc_author = $rt['anonymous'] && !$pwAnonyHide && $windid != $rt['author'] ? $db_anonymousname : $rt['author'];
$tpc_pid = $rt['pid'];
if ($rt['ifshield']) {
$groupid != '3' && ($rt['content'] = shield($rt['ifshield'] == '1' ? 'shield_article' : 'shield_del_article'));
} elseif ($groupid != 3 && $db_shield && $pwforum->forumBan($rt)) {
$rt['content'] = shield('ban_article');
} else {
if (!$wordsfb->equal($rt['ifwordsfb'])) {
$rt['content'] = $wordsfb->convert($rt['content']);
}
$rt['ifconvert'] == 2 && ($rt['content'] = convert($rt['content'], $db_windpost));
if (strpos($rt['content'], '[p:') !== false || strpos($rt['content'], '[s:') !== false) {
$rt['content'] = showface($rt['content']);