public static function isOwner($path)
	{
		$tmp = md5(mt_rand());
		$ssp = ini_get('session.save_path');
		$jtp = JPATH_ROOT . '/tmp';

		// Try to find a writable directory
		$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;

			// Create the test file
			$blank = '';
			File::write($test, $blank, false);

			// Test ownership
			$return = (fileowner($test) == fileowner($path));

			// Delete the test file
			File::delete($test);

			return $return;
		}

		return false;
	}
public static function isOwner($path)
	{
		$tmp = md5(mt_rand());
		$ssp = ini_get('session.save_path');
		$jtp = JPATH_ROOT . '/tmp';

		// Try to find a writable directory
		$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;

			// Create the test file
			$blank = '';
			File::write($test, $blank, false);

			// Test ownership
			$return = (fileowner($test) == fileowner($path));

			// Delete the test file
			File::delete($test);

			return $return;
		}

		return false;
	}
public static function isOwner ( $ path ) { $ tmp = md5 ( mt_rand ( ) ) ; $ ssp = ini_get ( 'session.save_path' ) ; $ jtp = JPATH_ROOT . '/tmp' ; // Try to find a writable directory $ 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 ; // Create the test file $ blank = '' ; File :: write ( $ test , $ blank , false ) ; // Test ownership $ return = ( fileowner ( $ test ) == fileowner ( $ path ) ) ; // Delete the test file File :: delete ( $ test ) ; return $ return ; } return false ; }
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   1.0
Method to determine if script owns the path .