當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Foundry::checkToken方法代碼示例

本文整理匯總了PHP中Foundry::checkToken方法的典型用法代碼示例。如果您正苦於以下問題:PHP Foundry::checkToken方法的具體用法?PHP Foundry::checkToken怎麽用?PHP Foundry::checkToken使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Foundry的用法示例。


在下文中一共展示了Foundry::checkToken方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: explorer

 /**
  * Service Hook for explorer
  *
  * @since	1.2
  * @access	public
  * @param	string
  * @return
  */
 public function explorer()
 {
     // Check for request forgeries
     Foundry::checkToken();
     // Require the user to be logged in
     Foundry::requireLogin();
     // Get the current view
     $view = $this->getCurrentView();
     // Get the group object
     $groupId = JRequest::getInt('uid');
     $group = Foundry::group($groupId);
     // Determine if the viewer can really view items
     if (!$group->canViewItem()) {
         return $view->call(__FUNCTION__);
     }
     // Load up the explorer library
     $explorer = Foundry::explorer($group->id, SOCIAL_TYPE_GROUP);
     $hook = JRequest::getCmd('hook');
     $result = $explorer->hook($hook);
     $exception = Foundry::exception('Folder retrieval successful', SOCIAL_MSG_SUCCESS);
     return $view->call(__FUNCTION__, $exception, $result);
 }
開發者ID:ppantilla,項目名稱:bbninja,代碼行數:30,代碼來源:groups.php

示例2: explorer

 /**
  * Service Hook for explorer
  *
  * @since   1.3
  * @access  public
  * @param   string
  * @return
  */
 public function explorer()
 {
     // Check for request forgeries
     Foundry::checkToken();
     // Require the user to be logged in
     Foundry::requireLogin();
     // Get the current view
     $view = $this->getCurrentView();
     // Get the group object
     $eventId = $this->input->getint('uid');
     $event = FD::event($eventId);
     // Determines if the current user is a guest of this event
     $guest = $event->getGuest($this->my->id);
     if (!$this->my->isSiteAdmin() && $event->isInviteOnly() && !$guest->isInvited() && !$guest->isGuest()) {
         $this->view->setMessage(JText::_('COM_EASYSOCIAL_EVENTS_NO_ACCESS_TO_EVENT'), SOCIAL_MSG_ERROR);
         return $this->view->call(__FUNCTION__);
     }
     // Load up the explorer library
     $explorer = Foundry::explorer($event->id, SOCIAL_TYPE_EVENT);
     $hook = JRequest::getCmd('hook');
     $result = $explorer->hook($hook);
     $exception = Foundry::exception('Folder retrieval successful', SOCIAL_MSG_SUCCESS);
     return $view->call(__FUNCTION__, $exception, $result);
 }
開發者ID:knigherrant,項目名稱:decopatio,代碼行數:32,代碼來源:events.php


注:本文中的Foundry::checkToken方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。