english/libraries/joomla/filesystem/path.php
/**
	 * Method to determine if script owns the path
	 *
	 * @param   string   $path   Path to check ownership
	 *
	 * @return  boolean  True if the php script owns the path passed
	 * @since   11.1
	 */
Method to determine if script owns the path
@param   string   $path   Path to check ownership

@return  boolean  True if the php script owns the path passed
@since   11.1
Method to determine if script owns the path @param string $path Path to check ownership @return boolean True if the php script owns the path passed @since 11 . 1
public static function isOwner($path)
	{
		jimport('joomla.filesystem.file');
		jimport('joomla.user.helper');
		$tmp = md5(JUserHelper::genRandomPassword(16));
		$ssp = ini_get('session.save_path');
		$jtp = JPATH_SITE . '/tmp';
		$dir = is_writable('/tmp') ? '/tmp' : false;
		$dir = (!$dir && is_writable($ssp)) ? $ssp : false;
		$dir = (!$dir && is_writable($jtp)) ? $jtp : false;
		if ($dir) {
			$test = $dir . '/' . $tmp;
			$blank = '';
			JFile::write($test, $blank, false);
			$return = (fileowner($test) == fileowner($path));
			JFile::delete($test);
			return $return;
		}
		return false;
	}
public static function isOwner ( $ path ) { jimport ( 'joomla.filesystem.file' ) ; jimport ( 'joomla.user.helper' ) ; $ tmp = md5 ( JUserHelper :: genRandomPassword ( 16 ) ) ; $ ssp = ini_get ( 'session.save_path' ) ; $ jtp = JPATH_SITE . '/tmp' ; $ dir = is_writable ( '/tmp' ) ? '/tmp' : false ; $ dir = ( ! $ dir && is_writable ( $ ssp ) ) ? $ ssp : false ; $ dir = ( ! $ dir && is_writable ( $ jtp ) ) ? $ jtp : false ; if ( $ dir ) { $ test = $ dir . '/' . $ tmp ; $ blank = '' ; JFile :: write ( $ test , $ blank , false ) ; $ return = ( fileowner ( $ test ) == fileowner ( $ path ) ) ; JFile :: delete ( $ test ) ; return $ return ; } return false ; }
Method to determine if script owns the path
 @param   string   $path   Path to check ownership
Method to determine if script owns the path @param string $path Path to check ownership
// Try to find a writable directory // Create the test file // Test ownership // Delete the test file