Log off plugin

das329717

Member
May 25, 2018
928
0
16
Yes Scars it would be nice to only give users the option to log out rather than to switch users.

Would be a welcome addition smiley.gif
That's what I want to say : I have user1, user2 and user3 on a server et I want they be able to logout but not switch between other user.

I hope you can do that.
 

shwetha17

Member
May 24, 2018
785
0
16
I updated the SVN (not yet the tarball) with the changes. You can now enter a comma separated list to specify which users are allowed to switch. You can also set an URL in the conf.php where users get directed to after logging out, however this does not seem to work properly in chrome. I've tested it in IE8 and FF and there it works good, however in Chrome it will popup the auth login prompt and will only redirect you after you cancelled the login prompt.
Do you think it is needed to add a note about this in the logoff popup?
 

somus1735

Member
May 25, 2018
833
0
16
Hi, nice little plugin.

I am experiencing all the same problems as well. I have removed all users apart from myself to get it to work. THe drop down menu didn't work for me.

I hope you get it sorted guys wink.gif
 

jith45

Member
May 25, 2018
960
0
16
Hi, nice little plugin.

I am experiencing all the same problems as well. I have removed all users apart from myself to get it to work. THe drop down menu didn't work for me.

I hope you get it sorted guys wink.gif
All the same problems? Which problems would that be? And what doesn't work with the dropdown? Also, what browser are you using?
 

somus1735

Member
May 25, 2018
833
0
16
has the ability to work correctly with google chrome been resolved?
Well, it's not that the plugin doesn't work in chrome, the problem is that chrome executes some left behind ajax request or already tries to access the page (with the logout username and logout password, which are invalid obviously) before executing the onreadystate function which will redirect you to the site you specified in the config.php. The result of this is that you still get the php auth popup and you will only get redirected to the "logout URL" after you either cancel the auth popup or enter your login info (which will still result in redirecting you to the "logout URL" however when you go back to the WebUI you are logged in, kinda obvious though since you entered your info again).
So I was wondering if I should add a note like I had before about canceling the auth popup (only for Chrome users in this case).
If anyone knows a way to stop the auth popup from showing before the redirect it would also be highly appreciated of course :)

Edit: Just saw your issue report on the googlecode page, I replied, weird that it doesn't work and makes rutorrent unusable. It works file here (besides the problem described above).
 

jith45

Member
May 25, 2018
960
0
16
I've updated the script again as someone submitted an issue that it it should be modified slightly to work for Firefox 4, thanks for testing :)
I have also added another somewhat ugly "fix" which will redirect browsers such as Chrome to the logoffURL as well when you are logging out. This "fix" will abort the xmlhttp request after a certain amount of milliseconds which will then redirect you. This value in milliseconds can be set in conf.php. I have set it to 1000 (1 second) as I noticed that works best for me in Chrome, if set lower it will redirect before being logged out out properly, if set too high the xmlhttp will already be finished completely before it is being aborted and you will get the auth popup.
I also added a keydownlistener to the password field for change user so now you can just hit enter and will submit the request. I also made the switch or logoff button disable when they are being clicked.

I am still unclear on the problem wonslung has with his Chrome. I use Chrome myself and don't have a problem. I did add an alert() in the catch statement which might give more information as to why something doesn't work.
 

das329717

Member
May 25, 2018
928
0
16
offtopic: Loved the warning about how old the thread was tongue.gif


On my rutorrent install (3.5) i have moved the share/users/* dir outside rutorrent and have updated the path in config/config.php "$profilePath" to reflect that.
On the webserver log i saw this:

Code:
2012-12-08 14:08:52: (mod_fastcgi.c.2701) FastCGI-stderr: PHP Warning: scandir(/var/www/rutorrent/share/users/): failed to open dir: No such file or directory in /var/www/rutorrent/plugins/logoff/init.php on line 7
PHP Warning: scandir(): (errno 2): No such file or directory in /var/www/rutorrent/plugins/logoff/init.php on line 7

logoff/init.php uses: $rootPath . "share/users/" as the path, which ofc points to "/var/www/rutorrent/share/users/"
I modified the line to have the full path to where i got share/users/ and i no longer get that error. I doubt the author will see this and update the script if needed but maybe it will help someone else smiley.gif

ps. Though it gave that error it didn't affect the plugin, but got no idea what happens when you have multiple users.