geekitude / dokuwiki-plugin-userhomepage

Dokuwiki plugin to automatically create user's homepage and/or namespace
https://www.dokuwiki.org/plugin:userhomepage
5 stars 9 forks source link

Endless Redirect on first login (or session expire) #21

Closed vogtadi closed 8 years ago

vogtadi commented 8 years ago

With the redirect option on (Default), the redirect is applied repeatedly. The only protection of not redirecting forever is the hardcoded limit of 2 seconds (based on the uhptimestamp). As I am using a local server, the redirect happens very quick and I reach the maximum redirect count (of apache) and hence an error message.

This kind of renders the entire plugin useless, as users are presented with an error message instead their private user page.

I tried to fix it by adding a flag in that checks for first login. But frankly I didnt understood all the things going on and its probably better the author takes care of the issue.

References

geekitude commented 8 years ago

Hi I'll try to work on that flag idea ASAP.

vogtadi commented 8 years ago

cool. thanks for the quick reaction.

geekitude commented 8 years ago

I double checked a local Dokuwiki (with micro Apache from Dokuwiki's download page) and can't reproduce that bug. Can you tell me a bit more about your environment? Do you use any other plugin that has some kind of redirection ? Is it a problem that started to occur after upgrading plugin to that version from 2016-02-05 or it's the first version of the plugin you use?

vogtadi commented 8 years ago

yes, one that redirects to the one and only link in the page (Mredirect). But I disabled it for the tests i performed.

The effect is, that I see the following combination in the apache logs. (Not exact strings, but you get the idea)

  1. access to /start
  2. access to /user:username:start
  3. access to /user:username:start ... n. access to /user:username:start

(If i have the plugin mentioned above enabled, the redirects alter between start and the user homepage, which makes sense as this is the functionality of the other plugin).

If I tune the 2 second timeout in line 158 I get it to work sometimes. But of course not reliably, as the guessed time are dependent on various aspects.

Appart from above plugin, I tried to disable all others one at a time. Apart from potential errors on my side, I currently exclude a plugin incompatibility.

geekitude commented 8 years ago

So far I haven't been very successfull with a flag (the problem is when is the good time to reset the flag?) and since I can't reproduce the bug, I'm a bit confused...

I think I found a simple workaround though...

Please update the plugin and keep me informed

vogtadi commented 8 years ago

Yes, the flag set and reset point also hit me in my attempts to get it sorted out :-)

I installed the version from 2016-02-09 and the workaround indeed looks simple. In my installation it behaves like the following:

a) for users, that have a private page and no further redirection (by another plugin or the redirection plugin is disabled), the behaviour is as expected an I get a single redirect to the users private page and then it will be displayed (without further redirection). So I would call that: Issue solved (even if not reproducible by you).

b) for users, which have a private page, what indicates a further redirect (by the MRedirect plugin) should be performed, the problem persists an I get alternating URL for /start and /user:username:start. But I would not call that a bug in your plugin, simply an known incompatibility with MRedirect.

So thanks for improving your plugin. I guess I will have to find another way to structure the wiki for that one case, where I currently need the MRedirect.

Sidenote: I wonder why you could not reproduce it. I probably means, that I have some setting in my Apache Server or php.ini, that will result in session variables to get reset from time to time or not initialised the way your plugin needs it. But I have not found time to investigate on that theory yet.

geekitude commented 8 years ago

Thanks for your feedback.

I'll have a look at MRedirect... It's probably not too hard to simply ignore redirection if private or public page contains a single link and MRedirect is enabled.

geekitude commented 8 years ago

Well... I installed MRedirect plugin, added a new user, changed his Private Namespace start page into a single link to Wiki's start page and everything works perfectly: on login, that user is redirected to Wiki's start page by MRedirect and not to his private page by User Homepage (also tried a redirection to another page with same result) so It doesn't seem to be any conflict between User Homepage and MRedirect and I don't see how to go further :(

vogtadi commented 8 years ago

Yes, thats why i marked the issue closed. I need to further investigate on my side, what else is influencing it (including some server settings).