- md5
- bdc46bab8ae149e3354c42e356a61608
- sha1
- 120be615f65c7153b3b5a631222fac62d671e99a
- sha256
- 4e89deb6a8eb75d79d017da96a8c72a5d2af468255bb11d3382065c510fabd7c
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
<?php
/**
* @version $Id: media.php 20196 2011-01-09 02:40:25Z ian $
* @package Joomla.Site
* @subpackage Massmail
* @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;
$params = JComponentHelper::getParams('com_media');
// Make sure the user is authorized to view this page
$user = JFactory::getUser();
$asset = JRequest::getCmd('asset');
$author = JRequest::getCmd('author');
if (!$asset or
!$user->authorise('core.edit', $asset)
&& !$user->authorise('core.create', $asset)
&& !($user->id==$author && $user->authorise('core.edit.own', $asset)))
{
return JError::raiseWarning(403, JText::_('JERROR_ALERTNOAUTHOR'));
}
// Set the path definitions
define('COM_MEDIA_BASE', JPATH_ROOT.'/'.$params->get('image_path', 'images'));
define('COM_MEDIA_BASEURL', JURI::root().'/'.$params->get('image_path', 'images'));
$lang = JFactory::getLanguage();
$lang->load($option, JPATH_ADMINISTRATOR, null, false, false)
|| $lang->load($option, JPATH_COMPONENT_ADMINISTRATOR, null, false, false)
|| $lang->load($option, JPATH_ADMINISTRATOR, $lang->getDefault(), false, false)
|| $lang->load($option, JPATH_COMPONENT_ADMINISTRATOR, $lang->getDefault(), false, false);
// Load the admin HTML view
require_once JPATH_COMPONENT_ADMINISTRATOR.DS.'helpers'.DS.'media.php';
// Require the base controller
require_once JPATH_COMPONENT.'/controller.php';
// Make sure the user is authorized to view this page
$user = JFactory::getUser();
$app = JFactory::getApplication();
$cmd = JRequest::getCmd('task', null);
if (strpos($cmd, '.') != false) {
// We have a defined controller/task pair -- lets split them out
list($controllerName, $task) = explode('.', $cmd);
// Define the controller name and path
$controllerName = strtolower($controllerName);
$controllerPath = JPATH_COMPONENT_ADMINISTRATOR.'/controllers/'.$controllerName.'.php';
// If the controller file path exists, include it ... else lets die with a 500 error
if (file_exists($controllerPath)) {
require_once $controllerPath;
}
else {
JError::raiseError(500, 'JERROR_INVALID_CONTROLLER');
}
}
else {
// Base controller, just set the task :)
$controllerName = null;
$task = $cmd;
}
// Set the name for the controller and instantiate it
$controllerClass = 'MediaController'.ucfirst($controllerName);
if (class_exists($controllerClass)) {
$controller = new $controllerClass();
}
else {
JError::raiseError(500, 'JERROR_INVALID_CONTROLLER_CLASS');
}
// Set the model and view paths to the administrator folders
$controller->addViewPath(JPATH_COMPONENT_ADMINISTRATOR.'/views');
$controller->addModelPath(JPATH_COMPONENT_ADMINISTRATOR.'/models');
// Perform the Request task
$controller->execute($task);
// Redirect if set by the controller
$controller->redirect();
No other release has this exact content. See every version of this file.