CoreFiles by mySites.guru
media.php51 lines, 1,562 bytes, from Joomla_1.7.2-Stable-Full_Package.zip
Raw History Compare with 1.7.1
md5
3526c1719f8548fa8695b958d167785e
sha1
6c23e57731f358cbf92c40e191b1c072217e80e7
sha256
5edc444f3d06f13d2bd446598d3cda41ae9028b2bed38441bf327aadb8926fe7
<?php
/**
 * @version		$Id: media.php 21320 2011-05-11 01:01:37Z dextercowley $
 * @package		Joomla.Administrator
 * @subpackage	com_media
 * @copyright	Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// no direct access
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'));

// Include dependancies
jimport('joomla.application.component.controller');

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

The same content is in 6 releases, Joomla 1.7.0 to 1.7.5. See them all, or every version of this file.