当前位置: 首页>>代码示例>>PHP>>正文


PHP IEM::GetCurrentUser方法代码示例

本文整理汇总了PHP中IEM::GetCurrentUser方法的典型用法代码示例。如果您正苦于以下问题:PHP IEM::GetCurrentUser方法的具体用法?PHP IEM::GetCurrentUser怎么用?PHP IEM::GetCurrentUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IEM的用法示例。


在下文中一共展示了IEM::GetCurrentUser方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Process

	/**
	 * Process
	 * Process does the basic work to figure out:
	 * - which addon you're trying to access (and whether it exists & is active/enabled)
	 * - whether you have access to perform that action
	 * - whether to print a header/footer or not
	 *
	 * Then hands control over to the addon itself to do the rest.
	 *
	 * @uses HasAccess
	 * @uses Interspire_Addons
	 * @uses Interspire_Addons::GetAvailableAddons
	 * @uses Interspire_Addons::Process
	 *
	 * @return Void Doesn't return anything.
	 */
	function Process()
	{
		// if we're not viewing an addon, then show an "access denied" message
		// there's no way to view a list of addons to run
		// they all have to appear in a menu somewhere.
		if (!isset($_GET['Addon'])) {
			$this->DenyAccess();
			return;
		}

		/**
		 * print_header tells us whether to print the header/footer at all.
		 */
		$print_header = true;

		/**
		 * popup_header tells us whether it's a popup window or not.
		 * If it's a full window, that includes the nav menus etc.
		 * If it's a popup window, then none of that is shown.
		 */
		$popup_header = false;

		$get_keywords = array_map('strtolower', array_keys($_GET));

		/**
		 * See if the 'ajax' keyword is used in the get string anywhere as a key.
		 * If it is, don't show the header/footer.
		 */
		if (in_array('ajax', $get_keywords)) {
			$print_header = false;
		}

		/**
		 * See if the 'popup' keyword is used in the get string anywhere as a key.
		 * If it is, show the popup header/footer.
		 */
		if (in_array('popup', $get_keywords)) {
			$popup_header = true;
		}

		if ($print_header) {
			$this->PrintHeader($popup_header);
		}

		$addon = strtolower($_GET['Addon']);

		require_once(SENDSTUDIO_BASE_DIRECTORY . DIRECTORY_SEPARATOR . 'addons' . DIRECTORY_SEPARATOR . 'interspire_addons.php');
		$addon_system = new Interspire_Addons();
		$addons = $addon_system->GetAvailableAddons();

		if (!isset($addons[$addon])) {  
			$this->DenyAccess();
			if ($print_header) {
				$this->PrintFooter($popup_header);
			}
			return;
		}

		$action = 'Default';
		if (isset($_GET['Action']) && $_GET['Action'] !== '') {
			$action = $_GET['Action'];
		}

		/**
		* Check the user has access to this addon and what you are trying to do.
		* The first argument is always the addon id (eg 'surveys').
		*
		* The second argument is the action you are trying to perform.
		* eg 'create', 'edit', 'delete', 'stats'
		* This must match up to the methods in the addon itself
		* eg if you're trying to get the addon to create something, the permission is 'create' and the addon method must be 'Admin_Create_Action'
		*
		*/
		$user = IEM::GetCurrentUser();
		$admin_action = $action;
		if ($admin_action == 'Default') {
			$admin_action = null;
		}
		
		if(!is_null($admin_action)){$admin_action = strtolower($admin_action);}
		// Survey permission addon... added in the group now
		foreach ($user->group->permissions as $perm_key => &$perm ) {
			if ($perm_key == 'surveys') {
				$perm[] = "submit";
//.........这里部分代码省略.........
开发者ID:hungnv0789,项目名称:vhtm,代码行数:101,代码来源:addons.php


注:本文中的IEM::GetCurrentUser方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。