本文整理汇总了PHP中Chat::getBanInformation方法的典型用法代码示例。如果您正苦于以下问题:PHP Chat::getBanInformation方法的具体用法?PHP Chat::getBanInformation怎么用?PHP Chat::getBanInformation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Chat
的用法示例。
在下文中一共展示了Chat::getBanInformation方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onLogLine
public static function onLogLine($logType, $logaction, $title, $paramArray, &$comment, &$revert, $logTimestamp)
{
global $wgUser, $wgCityId;
if (strpos($logaction, 'chatban') === 0) {
$user = User::newFromId($paramArray[1]);
if (!empty($user) && Chat::getBanInformation($wgCityId, $user) !== false && $wgUser->isAllowed('chatmoderator')) {
$revert = "(" . "<a class='chat-change-ban' data-user-id='{$paramArray[1]}' href='#'>" . wfMsg('chat-ban-log-change-ban-link') . "</a>" . ")";
}
} elseif ($logaction === 'chatconnect' && !empty($paramArray)) {
$ipLinks = array();
if ($wgUser->isAllowed('multilookup')) {
$mlTitle = GlobalTitle::newFromText('MultiLookup', NS_SPECIAL, 177);
// Need to make the link manually for this as Linker's normaliseSpecialPage
// makes the link local if the special page exists locally, rather than
// keeping the global title
$ipLinks[] = Xml::tags('a', array('href' => $mlTitle->getFullURL('target=' . urlencode($paramArray[0]))), wfMessage('multilookup')->escaped());
$ipLinks[] = Linker::makeKnownLinkObj(GlobalTitle::newFromText('Phalanx', NS_SPECIAL, 177), wfMessage('phalanx')->escaped(), wfArrayToCGI(array('type' => '8', 'target' => $paramArray[0], 'wpPhalanxCheckBlocker' => $paramArray[0])));
$ipLinks[] = Linker::blockLink(0, $paramArray[0]);
$revert = '(' . implode(wfMessage('pipe-separator')->plain(), $ipLinks) . ')';
}
}
return true;
}
示例2: BanModal
function BanModal()
{
ChatHelper::info(__METHOD__ . ': Method called');
global $wgRequest, $wgCityId, $wgLang;
wfProfileIn(__METHOD__);
$tmpl = new EasyTemplate(dirname(__FILE__) . '/templates/');
$userId = $wgRequest->getVal('userId', 0);
$isChangeBan = false;
$isoTime = "";
$fmtTime = "";
if (!empty($userId) && ($user = User::newFromID($userId))) {
$ban = Chat::getBanInformation($wgCityId, $user);
if ($ban !== false) {
$isChangeBan = true;
$isoTime = wfTimestamp(TS_ISO_8601, $ban->end_date);
$fmtTime = $wgLang->timeanddate(wfTimestamp(TS_MW, $ban->end_date), true);
}
}
$tmpl->set_vars(array('options' => Chat::GetBanOptions(), 'isChangeBan' => $isChangeBan, 'isoTime' => $isoTime, 'fmtTime' => $fmtTime));
$retVal = array();
$retVal['template'] = $tmpl->render("banModal");
$retVal['isChangeBan'] = $isChangeBan;
wfProfileOut(__METHOD__);
return $retVal;
}
示例3: canChat
/**
* Since the permission essentially has to be implemented as an anti-permission, this function removes the
* need for confusing double-negatives in the code.
*
* @param userObject - an object of class User (such as wgUser).
*/
public static function canChat($userObject)
{
global $wgCityId;
if ($userObject->isBlocked()) {
return false;
}
if (Chat::getBanInformation($wgCityId, $userObject) !== false) {
return false;
}
return $userObject->isLoggedin() && $userObject->isAllowed('chat');
}
示例4: getTagFromGroups
/**
* @return string
*/
protected function getTagFromGroups()
{
$this->app->wf->ProfileIn(__METHOD__);
$result = '';
$group = $this->getUsersHighestGroup($this->user);
if ($group) {
$result = $this->app->wf->Msg('user-identity-box-group-' . $group);
}
/* See if user is banned from chat */
if (!empty($this->app->wg->EnableChat) && Chat::getBanInformation($this->app->wg->CityId, $this->user) !== false) {
$result = wfMsg('user-identity-box-banned-from-chat');
}
$this->app->wf->ProfileOut(__METHOD__);
return $result;
}
示例5: canChat
/**
* Since the permission essentially has to be implemented as an anti-permission, this function removes the
* need for confusing double-negatives in the code.
*
* @param User $userObject - an object of class User (such as wgUser).
*
* @return bool
*/
public static function canChat(User $userObject)
{
if ($userObject->isAnon()) {
return false;
}
if ($userObject->isBlocked()) {
return false;
}
if (Chat::getBanInformation(F::app()->wg->CityId, $userObject) !== false) {
return false;
}
return $userObject->isAllowed('chat');
}