本文整理汇总了PHP中isProfileActive函数的典型用法代码示例。如果您正苦于以下问题:PHP isProfileActive函数的具体用法?PHP isProfileActive怎么用?PHP isProfileActive使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了isProfileActive函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAvailableLevelsBlock
function getAvailableLevelsBlock()
{
if (!$this->isLogged()) {
return array(MsgBox(_t('_membership_err_required_login')));
}
if (!isProfileActive()) {
return array(MsgBox(_t('_membership_err_not_active')));
}
$aMembership = $this->_oDb->getMembershipsBy(array('type' => 'price_all'));
if (empty($aMembership)) {
return array(MsgBox(_t('_membership_txt_empty')));
}
return $this->_oTemplate->displayAvailableLevels($aMembership);
}
示例2: processMembershipChecksForMediaUploads
function processMembershipChecksForMediaUploads(&$aInputs)
{
$isAdmin = $GLOBALS['logged']['admin'] && isProfileActive($this->_iProfileId);
defineMembershipActions(array('photos add', 'sounds add', 'videos add', 'files add'));
if (defined('BX_PHOTOS_ADD')) {
$aCheck = checkAction(getLoggedId(), BX_PHOTOS_ADD);
}
if (!defined('BX_PHOTOS_ADD') || $aCheck[CHECK_ACTION_RESULT] != CHECK_ACTION_RESULT_ALLOWED && !$isAdmin) {
unset($aInputs['thumb']);
}
$a = array('images' => 'PHOTOS', 'videos' => 'VIDEOS', 'sounds' => 'SOUNDS', 'files' => 'FILES');
foreach ($a as $k => $v) {
if (defined("BX_{$v}_ADD")) {
$aCheck = checkAction(getLoggedId(), constant("BX_{$v}_ADD"));
}
if ((!defined("BX_{$v}_ADD") || $aCheck[CHECK_ACTION_RESULT] != CHECK_ACTION_RESULT_ALLOWED) && !$isAdmin) {
unset($this->_aMedia[$k]);
unset($aInputs['header_' . $k]);
unset($aInputs[$k . '_choice']);
unset($aInputs[$k . '_upload']);
}
}
}
示例3: isAllowedReadForum
function isAllowedReadForum(&$aDataEntry, $iProfileId = -1)
{
if (-1 == $iProfileId) {
$iProfileId = $this->_iProfileId;
}
return $this->isAdmin() || $GLOBALS['logged']['member'] && $aDataEntry['author_id'] == $this->_iProfileId && isProfileActive($this->_iProfileId) || $this->_oPrivacyProduct->check('view_forum', $aDataEntry['id'], $iProfileId);
}
示例4: isEntryAdmin
function isEntryAdmin($aDataEntry, $iProfileId = 0)
{
if (!$iProfileId) {
$iProfileId = $this->_iProfileId;
}
if (($GLOBALS['logged']['member'] || $GLOBALS['logged']['admin']) && $aDataEntry['author_id'] == $iProfileId && isProfileActive($iProfileId)) {
return true;
}
return $this->_oDb->isGroupAdmin($aDataEntry['id'], $iProfileId) && isProfileActive($iProfileId);
}
示例5: isAllowedDelete
function isAllowedDelete(&$aSite, $isPerformAction = false)
{
if ($this->isAdmin() || $GLOBALS['logged']['member'] && $aSite['ownerid'] == $this->iOwnerId && isProfileActive($this->iOwnerId)) {
return true;
}
$this->_defineActions();
$aCheck = checkAction($this->iOwnerId, BX_SITES_DELETE_ANY_SITE, $isPerformAction);
return $aCheck[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED;
}
示例6: isLoggedActive
function isLoggedActive()
{
return isProfileActive();
}
示例7: isAdmin
function isAdmin()
{
return $GLOBALS['logged']['admin'] && isProfileActive($this->_iProfileId);
}
示例8: check
/**
* Check whether the viewer can make requested action.
*
* @param string $sAction action name from 'sys_priacy_actions' table.
* @param integer $iObjectId object ID the action to be performed with.
* @param integer $iViewerId viewer ID.
* @return boolean result of operation.
*/
function check($sAction, $iObjectId, $iViewerId = 0)
{
if (empty($iViewerId)) {
$iViewerId = getLoggedId();
}
if (isLogged() && !isProfileActive($iViewerId)) {
return false;
}
$aObject = $this->_oDb->getObjectInfo($this->getFieldAction($sAction), $iObjectId);
if (empty($aObject) || !is_array($aObject)) {
return false;
}
if ($iViewerId == $aObject['owner_id']) {
return true;
}
if ($this->_oDb->isGroupMember($aObject['group_id'], $aObject['owner_id'], $iViewerId)) {
return true;
}
return $this->isDynamicGroupMember($aObject['group_id'], $aObject['owner_id'], $iViewerId, $iObjectId);
}