Manual:Img auth.php

Description
Script that serves images only to logged in users.

To configure the wiki to use that script, see Manual:Image Authorisation.

Example
http://www.mediawiki.org/w/img_auth.php