当前位置: 首页>>代码示例>>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;未经允许,请勿转载。