I was looking for a way to let users login when asking for a media file. Because some people share documents from the wiki and don't want to use the remember feature, and they get an "Unauthorized" message with no options.
I searched plugins or fixes but I couldn't find anything, so I tried to develop it myself. I came up with a solution adding at lib/exe/fetch.php after the Unauthorized message the line:
if (($ACT == 'denied') && (! $_SERVER['REMOTE_USER'])) {
html_login(ml($MEDIA));
}
And modifying the header of html_login function at inc/html.php this way:
function html_login($action = false)
And then on the form constructor call:
$form = new Doku_Form('dw__login', $action);
My problems are now solved, but it's quite rough and the page is empty with no style. So I wanted to share my progess and see if anyone contributes with a better implementation. Later I would like to turn it into a plugin when everything works fine.