X-Git-Url: http://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=img_auth.php;h=f23de4f4703f71f63580735954eca7a728116b5b;hp=914014d85f8d44996567f3eceee4f9915d1bbfeb;hb=326d52f9613c5227d75f97361be6ec6ef78b214e;hpb=bd5a37aacf600bdd5f3a6e7998f92bd1d9326a8a diff --git a/img_auth.php b/img_auth.php index 914014d85f..f23de4f470 100644 --- a/img_auth.php +++ b/img_auth.php @@ -39,6 +39,7 @@ */ define( 'MW_NO_OUTPUT_COMPRESSION', 1 ); +define( 'MW_ENTRY_POINT', 'img_auth' ); require __DIR__ . '/includes/WebStart.php'; # Set action base paths so that WebRequest::getPathInfo() @@ -53,9 +54,10 @@ $mediawiki->doPostOutputShutdown( 'fast' ); function wfImageAuthMain() { global $wgImgAuthUrlPathMap; + $permissionManager = \MediaWiki\MediaWikiServices::getInstance()->getPermissionManager(); $request = RequestContext::getMain()->getRequest(); - $publicWiki = in_array( 'read', User::getGroupPermissions( [ '*' ] ), true ); + $publicWiki = in_array( 'read', $permissionManager->getGroupPermissions( [ '*' ] ), true ); // Get the requested file path (source file or thumbnail) $matches = WebRequest::getPathInfo(); @@ -160,7 +162,6 @@ function wfImageAuthMain() { // Check user authorization for this title // Checks Whitelist too - $permissionManager = \MediaWiki\MediaWikiServices::getInstance()->getPermissionManager(); if ( !$permissionManager->userCan( 'read', $user, $title ) ) { wfForbidden( 'img-auth-accessdenied', 'img-auth-noread', $name );