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


PHP Zend_Controller_Request_Abstract::getUserParam方法代碼示例

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


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

示例1: isAuthorizationRequired

	/**
	 * Check if running authorization checks is required.
	 *
	 * @param Zend_Controller_Request_Abstract $request
	 * @return bool
	 */
	private function isAuthorizationRequired(Zend_Controller_Request_Abstract $request) {
		$controller = $request->getControllerName();
		$action = $request->getActionName();

		// Any error controller call does not require any authorization
		if ($controller === 'error') return false;

		// An index/index action call does not require any authorization
		if ($controller === 'index' && $action === 'index') return false;

		// We require authentication for all actions, unless otherwise stated.
		if ($request->getUserParam('skip-auth') !== null && $request->getUserParam('skip-auth') == true) {
			return false;
		}

		return true;
	}
開發者ID:niieani,項目名稱:nandu,代碼行數:23,代碼來源:Auth.php

示例2: toLog

 /**
  * Write data to log
  *
  * @param  Zend_Controller_Request_Abstract $request
  * @return void
  */
 static function toLog($request)
 {
     //return;
     $params = $request->getParams();
     $serializer = Zend_Serializer::factory('PhpSerialize');
     $db = Zend_Registry::get('db');
     $logStat = Zend_Registry::get('Zend_LogStat');
     $auth = Zend_Auth::getInstance();
     $user_url = $_SERVER['REMOTE_ADDR'];
     //------------------
     // Получим адрес в виде: module/controller/action
     $module = $request->getModuleName();
     $controller = $request->getControllerName();
     $action = $request->getActionName();
     $url_action = "{$module}/{$controller}/{$action}";
     $arrLogURL = array('default/user/view', 'default/user/videos');
     // Определим данные для сохранения в лог
     foreach ($arrLogURL as $urlLog) {
         switch ($urlLog) {
             case 'default/user/view':
                 // Открыть сообщение
                 if ($url_action == $urlLog) {
                     $urlPost = trim($request->getUserParam('url'));
                     $username = trim($request->getUserParam('username'));
                     $arrStat = array('author' => $username, 'post_url' => $urlPost, 'user_url' => $user_url);
                     if ($auth->hasIdentity()) {
                         $identity = $auth->getIdentity();
                         $arrStat['user'] = $identity->username;
                     }
                     $serialized = $serializer->serialize($arrStat);
                     $logStat->post_open($serialized);
                 }
                 break;
             case 'default/user/videos':
                 // Открыть сообщение
                 if ($url_action == $urlLog && $params['type_action'] == 'play') {
                     $clip_id = $params['clip_id'];
                     $arrStat = array('clip_id' => $clip_id, 'user_url' => $user_url);
                     if ($auth->hasIdentity()) {
                         $identity = $auth->getIdentity();
                         $arrStat['user'] = $identity->username;
                     }
                     $serialized = $serializer->serialize($arrStat);
                     $logStat->video_play($serialized);
                 }
                 break;
             default:
                 break;
         }
     }
 }
開發者ID:bsa-git,項目名稱:zf-myblog,代碼行數:57,代碼來源:Log.php


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