Hello,
the
plugin showpageafterlogin seems not working at all. The issue was also posted
in GitHub.
After some source code examination, that's what I found.
- The plugin registers itself to receive the event 'ACTION_SHOW_REDIRECT' and advise 'BEFORE'.
- When called, the
handle_redirect method looks for this condition to be true
if ($INPUT->server->has('REMOTE_USER') && $event->data['preact'] == 'login')
but I found with some debug that when the method is called, the following holds:
$event->data['preact'] == 'redirect'
Now the event 'ACTION_SHOW_REDIRECT' is triggered only from the class Redirect, where
$event->data['preact'][/m] is populated with the global [m]$ACT - that I suspect being always equal to 'redirect' in this scenario.
So in my local installation, I modified the code into:
if ($INPUT->server->has('REMOTE_USER') && $event->data['preact'] == 'redirect')
and the plugin now works.
As I have too few experience with Dokuwiki code and PHP, I don't know if the plugin action could be triggered also in other (undesired) situations. Maybe is the other condition
$INPUT->server->has('REMOTE_USER')
that is true only after login execution?
Further, taking a look at the two open issues in GitHub: the one opened on 15 Feb says that the plugin "works as expected", while the one opened on 15 May says that the plugin "does not seem to be doing anything". Is anything changed with Dokuwiki Greebo version that could have possibly broken the plugin code?
Thanks in advance,
Umberto