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


PHP JUri::isInternal方法代码示例

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


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

示例1: loadFormData

 /**
  * Method to get the data that should be injected in the form.
  *
  * @return  array  The default data is an empty array.
  * @since   1.6
  */
 protected function loadFormData()
 {
     // Check the session for previously entered login form data.
     $app = JFactory::getApplication();
     $data = $app->getUserState('users.login.form.data', array());
     $input = $app->input;
     $method = $input->getMethod();
     // Check for return URL from the request first
     if ($return = $input->{$method}->get('return', '', 'BASE64')) {
         $data['return'] = base64_decode($return);
         if (!JUri::isInternal($data['return'])) {
             $data['return'] = '';
         }
     }
     // Set the return URL if empty.
     if (!isset($data['return']) || empty($data['return'])) {
         $data['return'] = 'index.php?option=com_users&view=profile';
     }
     $app->setUserState('users.login.form.data', $data);
     $this->preprocessData('com_users.login', $data);
     //$user = JFactory::getUser();
     // print_r($user->groups);
     // exit;
     //$data['return'] = JURI::base().'index.php/tracking-time'; // by anwar
     return $data;
 }
开发者ID:sankam-nikolya,项目名称:lptt,代码行数:32,代码来源:login.php

示例2: install

 /**
  * Install an extension.
  *
  * @return  void
  *
  * @since   1.5
  */
 public function install()
 {
     // Check for request forgeries.
     JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
     $model = $this->getModel('install');
     if ($model->install()) {
         $cache = JFactory::getCache('mod_menu');
         $cache->clean();
         // TODO: Reset the users acl here as well to kill off any missing bits.
     }
     $app = JFactory::getApplication();
     $redirect_url = $app->getUserState('com_installer.redirect_url');
     // Don't redirect to an external URL.
     if (!JUri::isInternal($redirect_url)) {
         $redirect_url = '';
     }
     if (empty($redirect_url)) {
         $redirect_url = JRoute::_('index.php?option=com_installer&view=install', false);
     } else {
         // Wipe out the user state when we're going to redirect.
         $app->setUserState('com_installer.redirect_url', '');
         $app->setUserState('com_installer.message', '');
         $app->setUserState('com_installer.extension_message', '');
     }
     $this->setRedirect($redirect_url);
 }
开发者ID:deenison,项目名称:joomla-cms,代码行数:33,代码来源:install.php

示例3: update

 /**
  * Update a set of extensions.
  *
  * @return  void
  *
  * @since   1.6
  */
 public function update()
 {
     // Check for request forgeries.
     JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
     /** @var InstallerModelUpdate $model */
     $model = $this->getModel('update');
     $uid = $this->input->get('cid', array(), 'array');
     JArrayHelper::toInteger($uid, array());
     // Get the minimum stability.
     $component = JComponentHelper::getComponent('com_installer');
     $params = $component->params;
     $minimum_stability = $params->get('minimum_stability', JUpdater::STABILITY_STABLE, 'int');
     $model->update($uid, $minimum_stability);
     if ($model->getState('result', false)) {
         $cache = JFactory::getCache('mod_menu');
         $cache->clean();
     }
     $app = JFactory::getApplication();
     $redirect_url = $app->getUserState('com_installer.redirect_url');
     // Don't redirect to an external URL.
     if (!JUri::isInternal($redirect_url)) {
         $redirect_url = '';
     }
     if (empty($redirect_url)) {
         $redirect_url = JRoute::_('index.php?option=com_installer&view=update', false);
     } else {
         // Wipe out the user state when we're going to redirect.
         $app->setUserState('com_installer.redirect_url', '');
         $app->setUserState('com_installer.message', '');
         $app->setUserState('com_installer.extension_message', '');
     }
     $this->setRedirect($redirect_url);
 }
开发者ID:SysBind,项目名称:joomla-cms,代码行数:40,代码来源:update.php

示例4: getReturn

 private function getReturn($key, $type)
 {
     $return = base64_decode($this->app->input->post->get($key, '', $type));
     if (!JUri::isInternal($return)) {
         $return = '';
     }
     return $return;
 }
开发者ID:leveltensolutions,项目名称:auth0-joomla,代码行数:8,代码来源:controller.php

示例5: getReturnPage

 /**
  * Get the return URL.
  * If a "return" variable has been passed in the request
  *
  * @return    string    The return URL.
  */
 protected function getReturnPage()
 {
     $return = JRequest::getVar('return', null, 'default', 'base64');
     if (empty($return) || !JUri::isInternal(base64_decode($return))) {
         return JURI::base();
     }
     return base64_decode($return);
 }
开发者ID:johngrange,项目名称:wookeyholeweb,代码行数:14,代码来源:dashboard.php

示例6: getReturnPage

 /**
  * Get the return URL
  *
  * If a "return" variable has been passed in the request
  *
  * @return  string  The return URL
  */
 protected function getReturnPage()
 {
     $return = JFactory::getApplication()->input->get('return', '', 'base64');
     if (empty($return) || !JUri::isInternal(base64_decode($return))) {
         return JURI::base();
     } else {
         return base64_decode($return);
     }
 }
开发者ID:Bakual,项目名称:Sichtweiten,代码行数:16,代码来源:sichtweitenmeldung.php

示例7: getReturnPage

 protected function getReturnPage()
 {
     $return = $this->input->get('return', null, 'base64');
     if (empty($return) || !JUri::isInternal(base64_decode($return))) {
         return JUri::base();
     } else {
         return base64_decode($return);
     }
 }
开发者ID:solderzzc,项目名称:com_tracker,代码行数:9,代码来源:userpanel.php

示例8: prepareValueForDisplay

 public function prepareValueForDisplay($value, $field)
 {
     if (!$value) {
         return $value;
     }
     $attributes = '';
     if (!JUri::isInternal($value)) {
         $attributes = 'rel="nofollow" target="_blank"';
     }
     return '<a href="' . $value . '" ' . $attributes . '>' . $value . '</a>';
 }
开发者ID:beingsane,项目名称:DPFields,代码行数:11,代码来源:url.php

示例9: getInput

	public function getInput($fieldValue = null)
	{
		if (!$this->isPublished())
		{
			return "";
		}

		
		$file_detect = 0;

		
		$value = !is_null($fieldValue) ? $fieldValue : $this->value;
		if ($value)
		{
			if (JUri::isInternal($value))
			{
				$file_detect = 1;

				if (stripos($value, JUri::root()) === 0)
				{
					$path = JPATH_ROOT . "/" . str_replace(JUri::root(), "", $value);
				}
				else
				{
					$path = JPATH_ROOT . "/" . $value;
				}

				if (!JFile::exists($path))
				{
					$file_detect = 2;
				}
			}
		}

		$this->setAttribute("type", "text", "input");
		$this->addAttribute("class", $this->getInputClass(), "input");

		if ((int) $this->params->get("size", 32))
		{
			$this->setAttribute("size", (int) $this->params->get("size", 32), "input");
		}

		if ($this->params->get("placeholder", ""))
		{
			$placeholder = htmlspecialchars($this->params->get("placeholder", ""), ENT_COMPAT, 'UTF-8');
			$this->setAttribute("placeholder", $placeholder, "input");
		}

		$this->setVariable('file_detect', $file_detect);
		$this->setVariable('value', $value);

		return $this->fetch('input.php', __CLASS__);
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:53,代码来源:core_external_link.php

示例10: populateState

 protected function populateState()
 {
     $app = JFactory::getApplication();
     // Load the parameters.
     $params = $app->getParams();
     $this->setState('params', $params);
     $this->mailNewIssueAdmins = $params->get('mailnewissueadmins');
     $this->mailNewIssueUser = $params->get('mailnewissueuser');
     $return = JRequest::getVar('return', null, 'default', 'base64');
     if (!JUri::isInternal(base64_decode($return))) {
         $return = null;
     }
     $this->setState('return_page', base64_decode($return));
 }
开发者ID:Ayner,项目名称:Improve-my-city,代码行数:14,代码来源:addissue.php

示例11: populateState

 /**
  * Method to auto-populate the model state.
  *
  * Note. Calling getState in this method will result in recursion.
  *
  * @param   string $ordering  Ordering column
  * @param   string $direction 'ASC' or 'DESC'
  *
  * @return  void
  */
 protected function populateState($ordering = null, $direction = null)
 {
     $app = JFactory::getApplication();
     $jinput = $app->input;
     $return = $jinput->get('return', '', 'base64');
     if (!JUri::isInternal(base64_decode($return))) {
         $return = null;
     }
     $this->setState('return_page', base64_decode($return));
     // Load the parameters.
     $params = $app->getParams();
     $this->setState('params', $params);
     $this->setState('layout', $jinput->get('layout'));
 }
开发者ID:Bakual,项目名称:Sichtweiten,代码行数:24,代码来源:sichtweitenmeldung.php

示例12: getReturnURL

 static function getReturnURL($params, $type)
 {
     global $cbSpecialReturnAfterLogin, $cbSpecialReturnAfterLogout;
     static $returnUrl = null;
     if (!isset($returnUrl)) {
         $returnUrl = Application::Input()->get('get/return', '', GetterInterface::BASE64);
         if ($returnUrl) {
             $returnUrl = base64_decode($returnUrl);
             if (!JUri::isInternal($returnUrl)) {
                 // The URL isn't internal to the site; reset it to index to be safe:
                 $returnUrl = 'index.php';
             }
         } else {
             $isHttps = isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off';
             $returnUrl = 'http' . ($isHttps ? 's' : '') . '://' . $_SERVER['HTTP_HOST'];
             if (!empty($_SERVER['PHP_SELF']) && !empty($_SERVER['REQUEST_URI'])) {
                 $returnUrl .= $_SERVER['REQUEST_URI'];
             } else {
                 $returnUrl .= $_SERVER['SCRIPT_NAME'];
                 if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) {
                     $returnUrl .= '?' . $_SERVER['QUERY_STRING'];
                 }
             }
         }
         $returnUrl = cbUnHtmlspecialchars(preg_replace('/[\\\\"\\\'][\\s]*javascript:(.*)[\\\\"\\\']/', '""', preg_replace('/eval\\((.*)\\)/', '', htmlspecialchars(urldecode($returnUrl)))));
         if (preg_match('/index.php\\?option=com_comprofiler&task=confirm&confirmCode=|index.php\\?option=com_comprofiler&view=confirm&confirmCode=|index.php\\?option=com_comprofiler&task=login|index.php\\?option=com_comprofiler&view=login/', $returnUrl)) {
             $returnUrl = 'index.php';
         }
     }
     $secureForm = (int) $params->get('https_post', 0);
     if ($type == 'login') {
         $loginReturnUrl = $params->get('login', $returnUrl);
         if (isset($cbSpecialReturnAfterLogin)) {
             $loginReturnUrl = $cbSpecialReturnAfterLogin;
         }
         $url = cbSef($loginReturnUrl, true, 'html', $secureForm);
     } elseif ($type == 'logout') {
         $logoutReturnUrl = $params->get('logout', 'index.php');
         if ($logoutReturnUrl == '#') {
             $logoutReturnUrl = $returnUrl;
         }
         if (isset($cbSpecialReturnAfterLogout)) {
             $logoutReturnUrl = $cbSpecialReturnAfterLogout;
         }
         $url = cbSef($logoutReturnUrl, true, 'html', $secureForm);
     } else {
         $url = $returnUrl;
     }
     return base64_encode($url);
 }
开发者ID:bobozhangshao,项目名称:HeartCare,代码行数:50,代码来源:helper.php

示例13: logout

 /**
  * Method to log out a user.
  *
  * @return  void
  */
 public function logout()
 {
     JSession::checkToken('request') or jexit(JText::_('JInvalid_Token'));
     $app = JFactory::getApplication();
     $userid = $this->input->getInt('uid', null);
     $options = array('clientid' => $userid ? 0 : 1);
     $result = $app->logout($userid, $options);
     if (!$result instanceof Exception) {
         $model = $this->getModel('login');
         $return = $model->getState('return');
         // Only redirect to an internal URL.
         if (JUri::isInternal($return)) {
             $app->redirect($return);
         }
     }
     parent::display();
 }
开发者ID:deenison,项目名称:joomla-cms,代码行数:22,代码来源:controller.php

示例14: populateState

 /**
  * Method to auto-populate the model state.
  *
  * Note. Calling getState in this method will result in recursion.
  *
  * @since   1.6
  */
 protected function populateState()
 {
     $credentials = array('username' => JRequest::getVar('username', '', 'method', 'username'), 'password' => JRequest::getVar('passwd', '', 'post', 'string', JREQUEST_ALLOWRAW), 'secretkey' => JRequest::getVar('secretkey', '', 'post', 'string', JREQUEST_ALLOWRAW));
     $this->setState('credentials', $credentials);
     // check for return URL from the request first
     if ($return = JRequest::getVar('return', '', 'method', 'base64')) {
         $return = base64_decode($return);
         if (!JUri::isInternal($return)) {
             $return = '';
         }
     }
     // Set the return URL if empty.
     if (empty($return)) {
         $return = 'index.php';
     }
     $this->setState('return', $return);
 }
开发者ID:shoffmann52,项目名称:install-from-web-server,代码行数:24,代码来源:login.php

示例15: populateState

 /**
  * Method to auto-populate the model state.
  *
  * Note. Calling getState in this method will result in recursion.
  *
  * @since	1.6
  */
 protected function populateState()
 {
     $app = JFactory::getApplication();
     // Load state from the request.
     $pk = JRequest::getInt('sub_id');
     $this->setState('htraininglogs.sub_id', $pk);
     // Add compatibility variable for default naming conventions.
     $this->setState('session.id', $pk);
     $return = JRequest::getVar('return', null, 'default', 'base64');
     if (!JUri::isInternal(base64_decode($return))) {
         $return = null;
     }
     $this->setState('return_page', base64_decode($return));
     // Load the parameters.
     $params = $app->getParams();
     $this->setState('params', $params);
     $this->setState('layout', JRequest::getCmd('layout'));
 }
开发者ID:hogeh,项目名称:htraininglogs,代码行数:25,代码来源:cfgsetting.php


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