2004-06-07 06:57:53 +00:00
|
|
|
<?php
|
2005-01-27 04:30:18 +00:00
|
|
|
/**
|
2020-02-04 21:44:38 +00:00
|
|
|
* The web entry point for serving non-public images to logged-in users.
|
2007-08-06 06:15:21 +00:00
|
|
|
*
|
2023-07-03 00:28:41 +00:00
|
|
|
* To use this, see https://www.mediawiki.org/wiki/Manual:Image_authorization
|
2007-08-06 06:15:21 +00:00
|
|
|
*
|
2009-03-21 16:48:09 +00:00
|
|
|
* - Set $wgUploadDirectory to a non-public directory (not web accessible)
|
|
|
|
|
* - Set $wgUploadPath to point to this file
|
2006-01-07 13:09:30 +00:00
|
|
|
*
|
2009-09-10 21:12:55 +00:00
|
|
|
* Optional Parameters
|
|
|
|
|
*
|
2011-11-20 08:50:13 +00:00
|
|
|
* - Set $wgImgAuthDetails = true if you want the reason the access was denied messages to
|
|
|
|
|
* be displayed instead of just the 403 error (doesn't work on IE anyway),
|
|
|
|
|
* otherwise it will only appear in error logs
|
2009-09-10 21:12:55 +00:00
|
|
|
*
|
2011-11-20 08:50:13 +00:00
|
|
|
* For security reasons, you usually don't want your user to know *why* access was denied,
|
|
|
|
|
* just that it was. If you want to change this, you can set $wgImgAuthDetails to 'true'
|
|
|
|
|
* in localsettings.php and it will give the user the reason why access was denied.
|
2009-09-10 21:12:55 +00:00
|
|
|
*
|
2018-07-26 05:36:19 +00:00
|
|
|
* Your server needs to support REQUEST_URI or PATH_INFO; CGI-based
|
|
|
|
|
* configurations sometimes don't.
|
2009-03-21 16:48:09 +00:00
|
|
|
*
|
2023-11-29 13:15:44 +00:00
|
|
|
* @see MediaWiki\FileRepo\AuthenticatedFileEntryPoint The implementation.
|
|
|
|
|
*
|
2012-05-23 11:41:30 +00:00
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
2009-09-10 21:12:55 +00:00
|
|
|
*
|
2012-05-23 11:41:30 +00:00
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
* http://www.gnu.org/copyleft/gpl.html
|
|
|
|
|
*
|
|
|
|
|
* @file
|
2020-02-04 21:44:38 +00:00
|
|
|
* @ingroup entrypoint
|
2012-05-23 11:41:30 +00:00
|
|
|
*/
|
2009-09-10 21:12:55 +00:00
|
|
|
|
2024-02-08 14:56:54 +00:00
|
|
|
use MediaWiki\Context\RequestContext;
|
2023-11-29 13:15:44 +00:00
|
|
|
use MediaWiki\EntryPointEnvironment;
|
|
|
|
|
use MediaWiki\FileRepo\AuthenticatedFileEntryPoint;
|
|
|
|
|
use MediaWiki\MediaWikiServices;
|
2023-02-16 19:27:21 +00:00
|
|
|
|
2007-02-19 23:03:37 +00:00
|
|
|
define( 'MW_NO_OUTPUT_COMPRESSION', 1 );
|
2019-09-02 23:55:00 +00:00
|
|
|
define( 'MW_ENTRY_POINT', 'img_auth' );
|
2013-05-17 00:16:59 +00:00
|
|
|
require __DIR__ . '/includes/WebStart.php';
|
2004-06-07 06:57:53 +00:00
|
|
|
|
2023-11-29 13:15:44 +00:00
|
|
|
( new AuthenticatedFileEntryPoint(
|
|
|
|
|
RequestContext::getMain(),
|
|
|
|
|
new EntryPointEnvironment(),
|
|
|
|
|
MediaWikiServices::getInstance()
|
|
|
|
|
) )->run();
|