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


PHP FabrikWorker::getACL方法代码示例

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


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

示例1: canSelectRows

 /**
  * determine if the table plugin is a button and can be activated only when rows are selected
  *
  * @return bol
  */
 function canSelectRows()
 {
     $params =& $this->getParams();
     $access = $params->get('updatecol_access');
     $name = $this->_getButtonName();
     $canuse = FabrikWorker::getACL($access, $name);
     return $canuse;
 }
开发者ID:nikshade,项目名称:fabrik21,代码行数:13,代码来源:update_col.php

示例2: getButton

 protected function getButton()
 {
     $params = $this->getParams();
     $access = $params->get('emailtable_access');
     $canuse = FabrikWorker::getACL($access, $name);
     $name = $this->_getButtonName();
     if ($canuse) {
         return "<a href=\"#\" class=\"listplugin {$name}\"/>" . $params->get('email_button_label', JText::_('PLG_LIST_EMAIL_EMAIL')) . "</a>";
     }
     return '';
 }
开发者ID:juliano-hallac,项目名称:fabrik,代码行数:11,代码来源:email.php

示例3: canUse

 function canUse(&$model = null, $location = null, $event = null)
 {
     $aclParam = $this->getAclParam();
     if ($aclParam == '') {
         return true;
     }
     $params =& $this->getParams();
     $access = $params->get($aclParam);
     $name = $this->_getButtonName();
     return FabrikWorker::getACL($access, $name);
 }
开发者ID:nikshade,项目名称:fabrik21,代码行数:11,代码来源:plugin-table.php

示例4: mustApplyWhere

 /**
  * check to see if prefilter should be applied
  * Kind of an inverse access lookup
  * @param int group id to check against
  * @param string ref for filter
  * @return bol must apply filter - true, ignore filter (user has enough access rights) false;
  */
 function mustApplyWhere($gid, $ref)
 {
     // $$$ hugh - adding 'where when' so can control whether to apply WHERE either on
     // new, edit or both (1, 2 or 3)
     $params = $this->getParams();
     $wherewhen = $params->get('database_join_where_when', '3');
     $isnew = JRequest::getInt('rowid', 0) === 0;
     if ($isnew && $wherewhen == '2') {
         return false;
     } else {
         if (!$isnew && $wherewhen == '1') {
             return false;
         }
     }
     // prefilters with JACL are applied to a single group only
     // not a group and groups beneath them (think author, registered)
     // so if JACL on then prefilters work in the inverse in that they are only applied
     // to the group selected
     if (defined('_JACL')) {
         return FabrikWorker::getACL($gid, 'dbjoinwhere' . $ref);
     } else {
         return FabrikWorker::getACL($gid, 'dbjoinwhere' . $ref, '<=');
     }
 }
开发者ID:nine007,项目名称:fabrik,代码行数:31,代码来源:databasejoin.php

示例5: onAjax_download

 /**
  * not really an AJAX call, we just use the pluginAjax method so we can run this
  * method for handling scripted downloads.
  */
 function onAjax_download()
 {
     $app = JFactory::getApplication();
     $url = JRequest::getVar('HTTP_REFERER', '', 'server');
     $lang =& JFactory::getLanguage();
     $lang->load('com_fabrik.plg.element.fabrikfileupload', JPATH_ADMINISTRATOR);
     if (!$this->canView()) {
         $app->enqueueMessage(JText::_('PLG_ELEMENT_FILEUPLOAD_DOWNLOAD_NO_PERMISSION'));
         $app->redirect($url);
         exit;
     }
     $rowid = JRequest::getInt('rowid', 0);
     if (empty($rowid)) {
         $app->enqueueMessage(JText::_('PLG_ELEMENT_FILEUPLOAD_DOWNLOAD_NO_SUCH_FILE'));
         $app->redirect($url);
         exit;
     }
     $repeatcount = JRequest::getInt('repeatcount', 0);
     $listModel = $this->getListModel();
     $row = $listModel->getRow($rowid, false);
     if (empty($row)) {
         $app->enqueueMessage(JText::_('PLG_ELEMENT_FILEUPLOAD_DOWNLOAD_NO_SUCH_FILE'));
         $app->redirect($url);
         exit;
     }
     $aclEl = str_replace('.', '___', $params->get('fu_download_acl', ''));
     if (!empty($aclEl)) {
         $canDownload = FabrikWorker::getACL($row->{$aclEl}, 'filedownload');
         if (!$canDownload) {
             $app->enqueueMessage(JText::_('DOWNLOAD NO PERMISSION'));
             $app->redirect($url);
         }
     }
     //$element = $this->getElement();
     $storage = $this->getStorage();
     $elName = $this->getFullName(false, true, false);
     //$elName .= '_raw';
     $filepath = $row->{$elName};
     //$filepath = explode(GROUPSPLITTER,$filepath);
     $filepath = FabrikWorker::JSONtoData($filepath, true);
     $filepath = JArrayHelper::getValue($filepath, $repeatcount);
     $filepath = $storage->getFullPath($filepath);
     $filecontent = $storage->read($filepath);
     if ($filecontent !== false) {
         /*
          // $$$ hugh - turn of E_DEPRECATED to avoid warnings about eregi() in getid3
         $current_level = error_reporting();
         error_reporting($current_level & ~E_DEPRECATED);
         
         require_once(COM_FABRIK_FRONTEND.DS.'libs'.DS.'getid3'.DS.'getid3'.DS.'getid3.php');
         require_once(COM_FABRIK_FRONTEND.DS.'libs'.DS.'getid3'.DS.'getid3'.DS.'getid3.lib.php');
         
         getid3_lib::IncludeDependency(COM_FABRIK_FRONTEND.DS.'libs'.DS.'getid3'.DS.'getid3'.DS.'extension.cache.mysql.php', __FILE__, true);
         $config =& JFactory::getConfig();
         $host =  $config->getValue('host');
         $database = $config->getValue('db');
         $username = $config->getValue('user');
         $password = $config->getValue('password');
         $getID3 = new getID3_cached_mysql($host, $database, $username, $password);
         // Analyze file and store returned data in $ThisFileInfo
         $thisFileInfo = $getID3->analyze($filepath);
         */
         $thisFileInfo = $storage->getFileInfo($filepath);
         if ($thisFileInfo === false) {
             $app->enqueueMessage(JText::_('DOWNLOAD NO SUCH FILE'));
             $app->redirect($url);
             exit;
         }
         header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
         // Some time in the past
         header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
         header("Cache-Control: no-store, no-cache, must-revalidate");
         header("Cache-Control: post-check=0, pre-check=0", false);
         header("Pragma: no-cache");
         header('Accept-Ranges: bytes');
         header('Content-Length: ' . $thisFileInfo['filesize']);
         header('Content-Type: ' . $thisFileInfo['mime_type']);
         header('Content-Disposition: attachment; filename="' . $thisFileInfo['filename'] . '"');
         // ... serve up the image ...
         echo $filecontent;
         $this->downloadEmail($row, $filepath);
         $this->downloadHit($rowid, $repeatcount);
         $this->downloadLog($row, $filepath);
         // ... and we're done.
         exit;
     } else {
         $app->enqueueMessage(JText::_('PLG_ELEMENT_FILEUPLOAD_DOWNLOAD_NO_SUCH_FILE'));
         $app->redirect($url);
         exit;
     }
 }
开发者ID:romuland,项目名称:khparts,代码行数:95,代码来源:fileupload.php

示例6: checkAccess

 /**
 	 * $$$ rob if the filter should not be applied due to its acl level then set its condition so that it
 	 will always return true. Do this rather than unsetting the filter - as this removes the selected option
 	 from the filter forms field. Can be used in conjunction with a list filter plugin to override a normal fiters option with the
 plugins option, e.g. load all univertisties courses OR [plugin option] load remote courses run by selected university
 e.g http://www.epics-ve.eu/index.php?option=com_fabrik&view=list&listid=5
 */
 public function checkAccess(&$filters)
 {
     $access = JArrayHelper::getValue($filters, 'access', array());
     foreach ($access as $key => $selAccess) {
         $i = $filters['key'][$key];
         if (!FabrikWorker::getACL($selAccess, $i)) {
             $filters['sqlCond'][$key] = '1=1';
         }
     }
     FabrikHelperHTML::debug($filters, 'filter array: after access taken into account');
 }
开发者ID:juliano-hallac,项目名称:fabrik,代码行数:18,代码来源:listfilter.php

示例7: canUseFilter

 /**
  * Defines if the user can use the filter related to the element
  *
  * @return bol true if you can use
  */
 function canUseFilter()
 {
     $params =& $this->getParams();
     $element =& $this->getElement();
     if (!is_object($this->_access) || !array_key_exists('filter', $this->_access)) {
         $this->_access->filter = FabrikWorker::getACL($params->get('filter_access'), 'filterElement' . $element->name);
     }
     return $this->_access->filter;
 }
开发者ID:nikshade,项目名称:fabrik21,代码行数:14,代码来源:element.php

示例8: downloadLink

	protected function downloadLink($value)
	{
		$params = $this->getParams();
		$storage = $this->getStorage();
		$formModel = $this->getFormModel();
		if (empty($value) || !$storage->exists(COM_FABRIK_BASE.$value)) {
			return "";
		}
		$aclEl = str_replace('.', '___', $params->get('fu_download_acl', ''));
		if (!empty($aclEl)) {
			$canDownload = FabrikWorker::getACL($data[$aclEl], 'filedownload');
			if (!$canDownload) {
				$img = $params->get('fu_download_noaccess_image');
				return $img == '' ? '' : "<img src=\"images/stories/$img\" alt=\"".JText::_('DOWNLOAD NO PERMISSION')."\" />";
			}
		}

		$rowid = JRequest::getVar('rowid', '0');
		$elementid = $this->_id;
		$title = basename($value);
		if ($params->get('fu_title_element') == '') {
			$title_name = $this->getFullName(true, true, false ) . '__title';
		} else {
			$title_name = str_replace('.', '___', $params->get('fu_title_element'));
		}
		$title_name .= '_raw';
		if (is_array($formModel->_data)) {
			if (array_key_exists($title_name, $formModel->_data)) {
				if (!empty($formModel->_data[$title_name])) {
					$title = $formModel->_data[$title_name];
					$titles = FabrikWorker::JSONtoData($title, true);
					$title = JArrayHelper::getValue($titles, $repeatCounter, $title);
				}
			}
		}
		if ($params->get('fu_download_access_image') !== '') {
			$title = "<img src=\"images/stories/".$params->get('fu_download_access_image')."\" alt=\"$title\" />";
		}
		$link = COM_FABRIK_LIVESITE . "index.php?option=com_fabrik&task=plugin.pluginAjax&plugin=fileupload&method=ajax_download&element_id=$elementid&formid=$formid&rowid=$rowid&repeatcount=$repeatCounter";
		$url = "<a href=\"$link\">$title</a>";
		return $url;
	}
开发者ID:Jobar87,项目名称:fabrik,代码行数:42,代码来源:fileupload.php

示例9: mustApplyFilter

 /**
  * check to see if prefilter should be applied
  * Kind of an inverse access lookup
  * @param int group id to check against
  * @param string ref for filter
  * @return bol must apply filter - true, ignore filter (user has enough access rights) false;
  */
 function mustApplyFilter($gid, $ref)
 {
     // prefilters with JACL are applied to a single group only
     // not a group and groups beneath them (think author, registered)
     // so if JACL on then prefilters work in the inverse in that they are only applied
     // to the group selected
     if (defined('_JACL')) {
         return FabrikWorker::getACL($gid, 'prefilter' . $ref);
     } else {
         return FabrikWorker::getACL($gid, 'prefilter' . $ref, '<=');
     }
 }
开发者ID:nikshade,项目名称:fabrik21,代码行数:19,代码来源:table.php


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