CoreFiles by mySites.guru
media.php46 lines, 1,404 bytes, from Joomla_2.5.21-Stable-Full_Package.zip
Raw History Compare with 2.5.20
md5
36ce3fdd7a9dbbdc61e9c11afb60825a
sha1
86df74589867350217975eed17242d0e7a3c5166
sha256
350caf9f518dd8633373bcacf4f9f8a8f993c3eb7b32bd0a65cc9e2f0284cc32
<?php
/**
 * @package		Joomla.Administrator
 * @subpackage	com_media
 * @copyright	Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

// Access check.

$user = JFactory::getUser();
$asset = JRequest::getCmd('asset');
$author = JRequest::getCmd('author');

if (	!$user->authorise('core.manage', 'com_media')
	&&	(!$asset or (
			!$user->authorise('core.edit', $asset)
		&&	!$user->authorise('core.create', $asset)
		&& 	count($user->getAuthorisedCategories($asset, 'core.create')) == 0)
		&&	!($user->id==$author && $user->authorise('core.edit.own', $asset))))
{
	return JError::raiseWarning(403, JText::_('JERROR_ALERTNOAUTHOR'));
}

$params = JComponentHelper::getParams('com_media');

// Load the admin HTML view
require_once JPATH_COMPONENT.'/helpers/media.php';

// Set the path definitions
$popup_upload = JRequest::getCmd('pop_up', null);
$path = "file_path";

$view = JRequest::getCmd('view');
if (substr(strtolower($view), 0, 6) == "images" || $popup_upload == 1) {
	$path = "image_path";
}

define('COM_MEDIA_BASE',	JPATH_ROOT.'/'.$params->get($path, 'images'));
define('COM_MEDIA_BASEURL', JURI::root().$params->get($path, 'images'));

$controller	= JControllerLegacy::getInstance('Media');
$controller->execute(JRequest::getCmd('task'));
$controller->redirect();

The same content is in 11 releases, Joomla 2.5.18 to 2.5.28. See them all, or every version of this file.