Log off plugin

das329717

Member
May 25, 2018
928
0
16
I heard this was a feature people were looking for and I thought it would be nice to have this myself too so I decided to make it.

Latest version 1.3

Thanks to AceP1983 for pointing out that the icon wouldn't appear when rTorrent wasn't running and that it didn't work in IE and giving a fix for it.

Main features

  • Switch user
  • Log off

Screenshots

The toolbar (the first, red, icon):
toolbar.png

The switch/log off prompt:
switch.png

The log off prompt:
logoff.png


More information
This plugin has it's own googlecode page: http://code.google.com/p/rutorrent-logoff/.
As you can read in the note, if you switch user and you do not get logged in (or if you just use the log off button) you will get the login prompt, though you cannot/should not use this. If you use this it will keep prompting for user/pass (not sure why though). So to avoid this you should cancel the prompt and reload the page and then log in. For this reason I also added the switch user option rather than only giving a log out option.


Want to use it right away?
Just move to your ruTorrent plugins dir, wget the tarball, unpack it and chown the files to your webuser:

Code:
cd /var/www/rutorrent/plugins/
wget http://rutorrent-logoff.googlecode.com/files/logoff-1.1.tar.gz
tar -zxf logoff-1.1.tar.gz
chown -R www-user:www-user logoff/

Of course feedback is appreciated, let me know if (or why) you (don't) like it and if you think it can use some improvements/bugfixes.

Enjoy wink.gif
 

shwetha17

Member
May 24, 2018
785
0
16
Sound very good ! I tryed and work great.

I translated it in french :
Code:
theUILang.logoff = "Déconnecter";
theUILang.logoffUsername = "Login";
theUILang.logoffPassword = "Mdp";
theUILang.logoffChange = "Changer";
theUILang.logoffPrompt = "Voulez-vous changer d'utilisateur, vous déconnecter ou annuler ?";
theUILang.logoffEmpty = "<-- ne peut pas être vide";
theUILang.logoffNote = "<strong>Note:</strong> Si le changement rate (ex. : indiquer un mauvais login/mdp) vous devez annuler lors de la demande de login et rafraichir la page avant de vous connecter à nouveau.";

thePlugins.get("logoff").langLoaded();Button of logoff is to small for french translation, maybe you can change it. And popup windows when we choose logoff still in english and have no title.

A idea : be able to store username and/or password and promp as windows do with user saved when we want switch. What do you think ?

It was one of my bounty (http://forums.rutorrent.org/index.php?topic=450.0) so send me your paypal adress. I pick you something more for work on chat ^^
 

jith45

Member
May 25, 2018
960
0
16
how does this work? Does it negate the need for authentication in the browser or does it work WITH basic auth?
 

das329717

Member
May 25, 2018
928
0
16
how does this work? Does it negate the need for authentication in the browser or does it work WITH basic auth?
It still uses the basic auth, it just redirects you to http(s)://logoff@... if you choose log off or to http(s)://user:pass@... if you enter switch user. As mentioned in the first post i tried to just make it logoff@... but for some reason it keeps poping up the basic auth login if you try to login then and the only way to fix that is by cancelling the prompt and reload the page and then entering user/pass to log in.
 

shwetha17

Member
May 24, 2018
785
0
16
weird, it doesn't seem to work on the box i just tried it on.

it shows up as "loaded' on the plugin page but i don't see the button to use it.


EDIT:

I downloaded it via svn, the issue is that it needs to be named logoff, not rutorrent-logoff/


This is a most excellent little plugin. Thanks so much.
 

somus1735

Member
May 25, 2018
833
0
16
I downloaded it via svn, the issue is that it needs to be named logoff, not rutorrent-logoff/
Yeh, in the install wiki (http://code.google.com/p/rutorrent-logoff/wiki/Install) I mentioned you should check it out as url logoff. I will make an update for this plugin soon since AceP1983 pointed out it doesn't work on IE and he has a fix for it (although not working completely yet for me). I also changed the username input field to a dropdown with all users and the log off button in the toolbar has a (username) behind it onhover incase you want to know with what user you are logged in.
I'll update the first post when i updated the SVN/tarball to v1.1.
 

jith45

Member
May 25, 2018
960
0
16
yah, i didn't read enough, i just jumped right in. I did figure out the issue rather quickly when i saw the "file not found" error in my logs.
 

das329717

Member
May 25, 2018
928
0
16
I modified the fix for IE a bit and now it seems to be working good at least in Chrome, FF and IE (havn't tried other browsers but I think it should work there too). I updated the SVN/tarball to version 1.1. If there is only 1 user on the setup then it won't show the switch user part and if the user is using IE it doesn't show the note about having to cancel the auth prompt since I noticed that in IE you don't get the problem with the auth login that keeps popping up.
 

shwetha17

Member
May 24, 2018
785
0
16
For me this does not seem to be working.

Using chrome as browser.

When I logoff I get the pop-up for my pw.
So I try to login, but it keeps hanging/loading.

My apache log gives me this error : user logoff not found
 

jith45

Member
May 25, 2018
960
0
16
For me this does not seem to be working.

Using chrome as browser.

When I logoff I get the pop-up for my pw.
So I try to login, but it keeps hanging/loading.

My apache log gives me this error : user logoff not found
If you want to log off you should be closing your browser/tab afterwards and not trying to login again, if you want to log in as another user use switch. As previously said if you either log off or switch user with a wrong password you should cancel the auth popup you get and then load the page again with (CTRL) F5 or entering the URL in the address bar again. If you try to enter your user/pass right after you log off it will hang in some kind of loop anyway.
 

das329717

Member
May 25, 2018
928
0
16
If you want to log off you should be closing your browser/tab afterwards and not trying to login again
I do that , but before I can it is already asking me for username & pw
And basically I did not expect it to do that
 

shwetha17

Member
May 24, 2018
785
0
16
It's because after logging off it will send you back to the path of your rutorrent, which is password protected.
 

somus1735

Member
May 25, 2018
833
0
16
so what we need then is to set it to log off then send to a differnet path perhaps?

maybe we should set up a non password protected area on our servers which doesn't actually have anything then we could solve this issue, right?
 

das329717

Member
May 25, 2018
928
0
16
I would personally rather have it be something we set via a conf.php in the plugin.

either a relative location or a full url.
 

shwetha17

Member
May 24, 2018
785
0
16
Yes good idea. And maybe add a bolean to say if we can switch user because, on some sever, it's standalone user wich they shouldn't switch but only logoff.
 

somus1735

Member
May 25, 2018
833
0
16
I would personally rather have it be something we set via a conf.php in the plugin.

either a relative location or a full url.
This shouldn't be that hard to do, I'll add this in the next update.
Yes good idea. And maybe add a bolean to say if we can switch user because, on some sever, it's standalone user wich they shouldn't switch but only logoff.
I already made a check for this and if there are no other users it doesn't show the switch user part.


AceP1983 has a change which logs off properly (using ajax) so you can use the auth login prompt again so I will remove the message about failed switch or log off. I will update the script with these changes soon, however I was wondering if people would like to have an option to disable the switch (either completely or have an allow list or a disallow list as array in conf.php)?
 

jith45

Member
May 25, 2018
960
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