本文整理汇总了PHP中Legacy_Utils::getUid方法的典型用法代码示例。如果您正苦于以下问题:PHP Legacy_Utils::getUid方法的具体用法?PHP Legacy_Utils::getUid怎么用?PHP Legacy_Utils::getUid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Legacy_Utils
的用法示例。
在下文中一共展示了Legacy_Utils::getUid方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: hasPermission
/**
* hasPermission
*
* @param void
*
* @return bool
**/
public function hasPermission()
{
if ($this->mObject->isMember(Legacy_Utils::getUid(), Lenum_GroupRank::OWNER)) {
return true;
}
return false;
}
示例2: hasPermission
/**
* hasPermission
*
* @param void
*
* @return bool
**/
public function hasPermission()
{
$catId = $this->_getCatId();
if ($catId > 0) {
//is Manager ?
$check = $this->mAccessController['main']->check($catId, Xupdatemaster_AbstractAccessController::MANAGE, 'item');
if ($check == true) {
return true;
}
//is new post and has post permission ?
$check = $this->mAccessController['main']->check($catId, Xupdatemaster_AbstractAccessController::POST, 'item');
if ($check == true && $this->mObject->isNew()) {
return true;
}
//is old post and your post ?
if ($check == true && !$this->mObject->isNew() && $this->mObject->get('uid') == Legacy_Utils::getUid() && $this->mObject->get('uid') > 0) {
return true;
}
} else {
$idList = array();
$idList = $this->mAccessController['main']->getPermittedIdList(Xupdatemaster_AbstractAccessController::POST, $this->_getCatId());
if (count($idList) > 0 || $this->mAccessController['main']->getAccessControllerType() == 'none') {
return true;
}
}
return false;
}
示例3: executeViewSuccess
/**
* executeViewSuccess
*
* @param XCube_RenderTarget &$render
*
* @return void
**/
public function executeViewSuccess(&$render)
{
$render->setTemplateName($this->mAsset->mDirname . '_group_view.html');
$render->setAttribute('object', $this->mObject);
$render->setAttribute('image', $this->mObject->getImage());
$render->setAttribute('dirname', $this->mAsset->mDirname);
$clientList = array();
$dataList = array('template_name' => array(), 'title' => array(), 'data' => array(), 'dirname' => array(), 'dataname' => array());
if ($this->_checkPublicity()) {
$clientList = Legroup_Utils::getClientList($this->mAsset->mDirname);
foreach ($clientList as $client) {
$dataList = $this->mObject->getClientData($dataList, $client);
}
foreach (array_keys($dataList['data']) as $key) {
$check = false;
XCube_DelegateUtils::call('Legacy_Group.' . $this->mAsset->mDirname . '.HasPermission', new XCube_Ref($check), $this->mAsset->mDirname, $this->mObject->get('group_id'), $dataList['dirname'][$key], $dataList['dataname'][$key], 'edit');
$dataList['isEditor'][$key] = $check;
unset($check);
}
}
$render->setAttribute('clientList', $clientList);
$render->setAttribute('clients', $dataList);
$render->setAttribute('isEditor', $this->mObject->isMember(Legacy_Utils::getUid(), Lenum_GroupRank::OWNER));
//breadcrumb
$breadcrumbs = array();
XCube_DelegateUtils::call('Module.' . $this->mAsset->mDirname . '.Global.Event.GetBreadcrumbs', new XCube_Ref($breadcrumbs), $this->mAsset->mDirname, $this->mObject);
$render->setAttribute('xoops_breadcrumbs', $breadcrumbs);
}
示例4: hasPermission
/**
* hasPermission
*
* @param void
*
* @return bool
**/
public function hasPermission()
{
if ($this->mObjectHandler->isMember($this->mObject->get('group_id'), Legacy_Utils::getUid(), Lenum_GroupRank::STAFF)) {
return true;
}
return false;
}
示例5: prepare
/**
* prepare
*
* @param XCube_PageNavigator &$navi
* @param XoopsObjectGenericHandler &$handler
*
* @return void
**/
public function prepare(/*** XCube_PageNavigator ***/ &$navi,/*** XoopsObjectGenericHandler ***/ &$handler)
{
$this->mFields = xoops_getmodulehandler('definitions', 'profile')->getFields4DataShow(Legacy_Utils::getUid());
$this->_addSortKeys();
parent::prepare($navi,$handler);
}
示例6: hasPermission
/**
* hasPermission
*
* @param void
*
* @return bool
**/
public function hasPermission()
{
if ($this->mObject->mLink->get('uid') != Legacy_Utils::getUid()) {
return false;
}
return $this->mRoot->mContext->mUser->isInRole('Site.RegisteredUser') ? true : false;
}
示例7: getFields4DataShow
/**
* @public
*/
public function getFields4DataShow($uid = 0)
{
$uid = $uid > 0 ? $uid : Legacy_Utils::getUid();
$lHandler =& xoops_getmodulehandler('groups_users_link', 'user');
$criteria = new CriteriaCompo();
$criteria->setSort('weight');
$fieldArr = $this->getObjects($criteria);
foreach (array_keys($fieldArr) as $keyF) {
$flag = false;
$accessArr = explode(',', $fieldArr[$keyF]->get('access'));
if ($uid === 0) {
//guest
if (in_array(XOOPS_GROUP_ANONYMOUS, $accessArr)) {
$flag = true;
}
} else {
foreach (array_keys($accessArr) as $keyA) {
if ($lHandler->isUserOfGroup($uid, $accessArr[$keyA])) {
$flag = true;
}
}
}
if (!$flag) {
unset($fieldArr[$keyF]);
}
}
return $fieldArr;
}
示例8: executeViewIndex
/**
* @public
*/
function executeViewIndex(&$render)
{
$render->setTemplateName("profile_data_list.html");
$render->setAttribute('objects', $this->mObjects);
$render->setAttribute('pageNavi', $this->mFilter->mNavi);
$handler = Legacy_Utils::getModuleHandler('definitions', 'profile');
$render->setAttribute('definitions', $handler->getFields4DataShow(Legacy_Utils::getUid()));
}
示例9: hasPermission
/**
* hasPermission
*
* @param void
*
* @return bool
**/
public function hasPermission()
{
if (!$this->mRoot->mContext->mUser->isInRole('Site.RegisteredUser')) {
return false;
}
if (!$this->mObject->isNew()) {
return $this->mObject->isMember(Legacy_Utils::getUid(), Lenum_GroupRank::OWNER) ? true : false;
} else {
return true;
}
}
示例10: hasPermission
/**
* hasPermission
*
* @param void
*
* @return bool
**/
public function hasPermission()
{
if ($this->mObject->get('uid') == Legacy_Utils::getUid()) {
return true;
}
if ($this->mObject->get('status') == Lenum_Status::PUBLISHED && $this->mObject->isOpen() === true) {
$check = $this->mCategoryManager->check($this->_getCatId(), 'view', 'page');
} else {
$check = $this->mCategoryManager->check($this->_getCatId(), 'review', 'page');
}
return $check;
}
示例11: hasPermission
/**
* hasPermission
*
* @param void
*
* @return bool
**/
public function hasPermission()
{
if (!$this->mRoot->mContext->mUser->isInRole('Site.RegisteredUser')) {
return false;
}
if ($this->mObject->mGroup->isMember(Legacy_Utils::getUid(), Lenum_GroupRank::STAFF)) {
return true;
}
if ($this->mObject->get('uid') == Legacy_Utils::getUid()) {
return true;
}
return false;
}
示例12: getMyRating
/**
* getMyRating
*
* @param void
*
* @return int
*/
public function getMyRating()
{
$uid = Legacy_Utils::getUid();
if ($uid == 0) {
return 0;
}
$handler = Legacy_Utils::getModuleHandler('favrpg', PLAYERMAP_DIRNAME);
$cri = new CriteriaCompo();
$cri->add(new Criteria('rpg_id', $this->get('rpg_id')));
$cri->add(new Criteria('uid', $uid));
$objs = $handler->getObjects($cri);
return count($objs) > 0 ? array_shift($objs)->getShow('rating') : 0;
}
示例13: _getId
/**
* _getId
*
* @param void
*
* @return int
**/
protected function _getId()
{
$req = $this->mRoot->mContext->mRequest;
$dataId = $req->getRequest(_REQUESTED_DATA_ID);
$id = isset($dataId) ? intval($dataId) : intval($req->getRequest($this->_getHandler()->mPrimary));
if (!isset($id)) {
$objs = $this->_getHandler()->getObjects(new Criteria('uid', Legacy_Utils::getUid()));
if (count($objs) > 0) {
return $objs[0]->get('link_id');
}
}
return $id;
}
示例14: prepare
/**
* prepare
*
* @param void
*
* @return bool
**/
public function prepare()
{
$this->mObjectHandler =& $this->_getHandler();
//in this action, _getId means get rpg_id
$uid = Legacy_Utils::getUid();
$cri = new CriteriaCompo();
$cri->add(new Criteria('conne_uid', $this->_getTargetId()));
$cri->add(new Criteria('uid', $uid));
$objs = $this->mObjectHandler->getObjects($cri);
$this->mObject = count($objs) > 0 ? array_shift($objs) : $this->mObjectHandler->create();
if ($this->mObject->isNew()) {
$this->mObject->set('uid', $uid);
$this->mObject->set('conne_uid', $this->_getTargetId());
}
return true;
}
示例15: getPermittedIdList
/**
* getPermittedIdList
*
* @param string $dirname
* @param string $action
* @param int $categeoryId
*
* @return XoopsObjectHandler
**/
public static function getPermittedIdList($dirname, $action = null, $categoryId = 0)
{
$action = isset($action) ? $action : Af_dmm_AuthType::VIEW;
$accessController = self::getAccessControllerModule($dirname);
if (!is_object($accessController)) {
return;
}
$role = $accessController->get('role');
$idList = array();
if ($role == 'cat') {
$delegateName = 'Legacy_Category.' . $accessController->dirname() . '.GetPermittedIdList';
XCube_DelegateUtils::call($delegateName, new XCube_Ref($idList), $accessController->dirname(), self::getActor($dirname, Af_dmm_AuthType::VIEW), Legacy_Utils::getUid(), $categoryId);
} elseif ($role == 'group') {
$delegateName = 'Legacy_Group.' . $accessController->dirname() . '.GetGroupIdListByAction';
XCube_DelegateUtils::call($delegateName, new XCube_Ref($idList), $accessController->dirname(), $dirname, 'page', Af_dmm_AuthType::VIEW);
} else {
//has user group permission ?
///TODO
}
return $idList;
}