Play music in webbrowser without logon

Third-party modifications and add-ons, Apps and Clients

Moderator: moderators

Play music in webbrowser without logon

Postby alfenkillz » Sun Dec 04, 2011 9:31 pm

Hi,

is there any way to get rid of the Logon screen, so people can play music directly in their web browser without having to logon.

but only play music, not change any settings?

Any help would be appreciated.
alfenkillz
 
Posts: 2
Joined: Sun Dec 04, 2011 9:28 pm

Re: Play music in webbrowser without logon

Postby ytechie » Tue Jan 03, 2012 12:09 am

There is a way. It requires you to change the login.jsp file.

First, you'll want to create a user that isn't able to edit settings or password.
Make sure all of your settings are as you want them because they will be hard to change once you enable the auto-login.

Locate the login.jsp file, and add this function:

Code: Select all
function init() {
      document.getElementById('j_username').value = "guestUserHere";
      document.getElementById('j_password').value = "guestPasswordHere";
      document.getElementById('submit').click();
   }


Next you have to add "id="j_password"" to the password field, and "id="submit"" to the submit button.

The final step is to change the onload= in the body tag to "onload="init()" and save the file.

Every user will automatically be logged in as the user you specified, and to make changes at a later time, you will want to simply comment the last line of the function we added, make your changes, and uncomment the line.

Hope this helps!
User avatar
ytechie
 
Posts: 547
Joined: Sun Dec 12, 2010 5:05 am
Location: Manhattan, New York

Re: Play music in webbrowser without logon

Postby alfenkillz » Tue Jan 10, 2012 10:22 am

Hi,

Thanks alot, it was very effective!

=)
alfenkillz
 
Posts: 2
Joined: Sun Dec 04, 2011 9:28 pm

Re: Play music in webbrowser without logon

Postby bluetooth » Tue Jan 10, 2012 4:58 pm

Perhaps an easier method is to just put the username and password in the url shortcut
http://yourhost/subsonic/login.view?use ... word=guest
Just replace whatever username / password you like, make sure the guest has the privileges you want and there you go.
paid Subsonic user
bluetooth
 
Posts: 198
Joined: Mon Aug 04, 2008 6:57 pm

Re: Play music in webbrowser without logon

Postby ytechie » Tue Jan 10, 2012 8:45 pm

bluetooth wrote:Perhaps an easier method is to just put the username and password in the url shortcut
http://yourhost/subsonic/login.view?use ... word=guest
Just replace whatever username / password you like, make sure the guest has the privileges you want and there you go.


But that means you have to set the url to include all the information.

With the method I provided, the root url logs in without any user interaction, and the url does not need to be modified.
:mrgreen:
User avatar
ytechie
 
Posts: 547
Joined: Sun Dec 12, 2010 5:05 am
Location: Manhattan, New York

Re: Play music in webbrowser without logon

Postby bluetooth » Tue Jan 10, 2012 8:48 pm

Always good to have a choice.
paid Subsonic user
bluetooth
 
Posts: 198
Joined: Mon Aug 04, 2008 6:57 pm

Re: Play music in webbrowser without logon

Postby ytechie » Tue Jan 10, 2012 8:52 pm

bluetooth wrote:Always good to have a choice.


Absolutely! Thanks for showing us the other way to do an auto login.

With the more complicated way, you can hand out the url (http://[subsonic]) and the user is logged in!
No need to set up a bookmark containing the login info. :D
User avatar
ytechie
 
Posts: 547
Joined: Sun Dec 12, 2010 5:05 am
Location: Manhattan, New York

Re: Play music in webbrowser without logon

Postby chugmonkey » Tue Jan 17, 2012 10:47 am

ytechie wrote:With the method I provided, the root url logs in without any user interaction, and the url does not need to be modified.


Interesting method ytechie. I would suggest that modifying Sindre's code for stuff like this is actually not the best way to go about making life easier for public login. In this case, I think you would be better off rewriting the URL using the application configuration for whichever J2EE server you're using, perhaps by using J2EE UrlRewriteFilter. This would enable you to have a URL for sharing like http://subsonic/free_pass which wouldn't need amending in the next SS release.

If you would like step by step guidance on implementing this, please let me know.

Cheers
chugmonkey
 
Posts: 20
Joined: Wed Jun 25, 2008 10:11 am

Re: Play music in webbrowser without logon

Postby ytechie » Tue Jan 17, 2012 4:11 pm

I don't think that would be easier at all. Not for what the OP wanted. Either way, can you post your method so I can check it out for future use?
User avatar
ytechie
 
Posts: 547
Joined: Sun Dec 12, 2010 5:05 am
Location: Manhattan, New York

Re: Play music in webbrowser without logon

Postby chugmonkey » Wed Jan 18, 2012 1:49 pm

ytechie wrote:can you post your method so I can check it out for future use?


Absolutely - I'll draw it up this weekend. It can also be done in Apache, arguably much more easily. Is there anywhere we can see some stats on what server setup people have got?
chugmonkey
 
Posts: 20
Joined: Wed Jun 25, 2008 10:11 am

Re: Play music in webbrowser without logon

Postby ytechie » Wed Jan 18, 2012 1:51 pm

Yea. Take a look: viewtopic.php?f=5&t=7147.

Thanks for the info! (In the future.) I would love to know how to make separate urls for different things. I'm guessing it's the same concept as what the /share/[random] does?
User avatar
ytechie
 
Posts: 547
Joined: Sun Dec 12, 2010 5:05 am
Location: Manhattan, New York


Return to Mods, Apps and Clients

Who is online

Users browsing this forum: No registered users and 4 guests