Subsonic registration engine

A little external engine to register users in Subsonic

Moderator: moderators

Re: Subsonic registration engine

Postby SparkyRih » Tue Sep 25, 2012 3:23 pm

But your users still have to register an account?

The whole point of an FB login is instant access with only your FB account...
VMWare ESXi 5.5 > Ubuntu 16.04 > Subsonic 6.0 (Modded with PHP based registration feature)

Image
User avatar
SparkyRih
 
Posts: 216
Joined: Wed May 11, 2011 1:52 pm
Location: The Netherlands

Re: Subsonic registration engine

Postby willieb » Tue Sep 25, 2012 4:02 pm

SparkyRih wrote:But your users still have to register an account?

The whole point of an FB login is instant access with only your FB account...


That's the way I see it. The FB login keeps you from having to register at all. New users simply click login with facebook and they're done! (Considering most people stay logged in to FB 24/7). Would be pretty cool.

If registration is still needed, which I assume it would be to be able to set permissions, access options, etc, then registration should be taken care of behind the scenes from the returned FB data. For example if a FB user of "John Doe" clicked login with FB for the first time, he would be automatically registered into subsonic with the username "John_Doe". Then we can change permissions, if needed, based on user John_Doe. Future logins would simply authenticate using returned FB data.

I'm not a programmer, but that's the logic in my mind.
willieb
 
Posts: 54
Joined: Fri Jul 27, 2012 3:03 pm

Re: Subsonic registration engine

Postby SparkyRih » Tue Sep 25, 2012 4:27 pm

You don't have to explain all that to me, I just don't understand your code snippet... but that's probably becasue Í usea different approach...
VMWare ESXi 5.5 > Ubuntu 16.04 > Subsonic 6.0 (Modded with PHP based registration feature)

Image
User avatar
SparkyRih
 
Posts: 216
Joined: Wed May 11, 2011 1:52 pm
Location: The Netherlands

Re: Subsonic registration engine

Postby gurutech » Tue Sep 25, 2012 10:09 pm

I think I am having a similar approach to what you guys are talking about. I am able to create a database entry in my SQL database, based on the returned data from Facebook, and the registration is being added to the SS database, but I can't get the FB Login button to work. If I manually try to login with the FB username and password I chose during the registration process, it still tells me the password is incorrect.

I have even tried resetting the password on the SS account to what I should have been, but that is not working either. Any ideas?
Image
gurutech
 
Posts: 492
Joined: Sun Jan 15, 2012 9:56 pm

Re: Subsonic registration engine

Postby dsync89 » Mon Oct 22, 2012 2:12 pm

Can anyone post some tutorial on how to use this with subsonic? I can't seemed to figure how to set them up.
musicScrape @ Music Cabinet Mod
http://musicscrape.zapto.org:8080
dsync89
 
Posts: 72
Joined: Fri Oct 19, 2012 8:51 am

Re: Subsonic registration engine

Postby gurutech » Tue Oct 23, 2012 12:08 am

There's a tutorial on Marc's site, but the basics of it is:

Overwrite the "login.jsp" file from your Subsonic installation, then the other files go on your main website, and you configure it from there.

For example, your website is: www.mymusiciscool.com, and you have port 4040 set up to listen for Subsonic requests, so the login.jsp file from the install package would go in the /var/subsonic/jetty/xxxx/webapp/WEB-INF/jsp folder, while the rest of the files would go under the /var/www/html folder for your website.
Image
gurutech
 
Posts: 492
Joined: Sun Jan 15, 2012 9:56 pm

Re: Subsonic registration engine

Postby dsync89 » Tue Oct 23, 2012 1:13 am

I had installed mySQL and created all the necessary table. The problem now lies with integrating PHP with Tomcat 6. I tried to use the JavaBridge.war template by following http://php-java-bridge.sourceforge.net/doc/tomcat6.php but I got the following error when I tried to run the template. I suppose that Tomcat 6 haven't been aware of PHP yet.

Running on Mac OS X Mountain Lion.

Code: Select all
HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: php.java.bridge.http.FCGIConnectException: Could not connect to server
   php.java.servlet.fastcgi.FastCGIServlet.init(FastCGIServlet.java:133)
   org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
   org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
   org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
   org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
   java.lang.Thread.run(Thread.java:722)

root cause

php.java.bridge.http.FCGIConnectException: Could not connect to server
   php.java.bridge.http.SocketChannelFactory.test(SocketChannelFactory.java:58)
   php.java.servlet.fastcgi.FastCGIServlet.init(FastCGIServlet.java:131)
   org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
   org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
   org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
   org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
   java.lang.Thread.run(Thread.java:722)

root cause

java.io.IOException: java.net.ConnectException: Connection refused
   php.java.bridge.http.FCGIConnectException.<init>(FCGIConnectException.java:37)
   php.java.bridge.http.SocketChannelFactory.test(SocketChannelFactory.java:58)
   php.java.servlet.fastcgi.FastCGIServlet.init(FastCGIServlet.java:131)
   org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
   org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
   org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
   org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
   java.lang.Thread.run(Thread.java:722)

root cause

java.io.IOException: PHP not found. Please install php-cgi. PHP test command was: [php-cgi, -v]
   php.java.bridge.Util$Process.start(Util.java:1145)
   php.java.servlet.fastcgi.FCGIProcess.start(FCGIProcess.java:68)
   php.java.bridge.http.SocketChannelFactory.doBind(SocketChannelFactory.java:125)
   php.java.bridge.http.FCGIConnectionFactory.runFcgi(FCGIConnectionFactory.java:88)
   php.java.bridge.http.FCGIConnectionFactory$1.run(FCGIConnectionFactory.java:109)

musicScrape @ Music Cabinet Mod
http://musicscrape.zapto.org:8080
dsync89
 
Posts: 72
Joined: Fri Oct 19, 2012 8:51 am

Re: Subsonic registration engine

Postby gurutech » Wed Oct 24, 2012 12:18 am

The last lines suggest to install php-cgi.

I would install that, and also check to ensure MySQL is running, as well as PHP. You may also require cURL to be installed and running as well.
Image
gurutech
 
Posts: 492
Joined: Sun Jan 15, 2012 9:56 pm

Re: Subsonic registration engine

Postby asian flavor » Wed Oct 24, 2012 1:16 am

This is a cool mod and thanks for your hard work. Got this to work internally but cannot get the captcha to show on the login screen externally. Also have to figure out the SMTP portion, but I think I know what that issue is. Just need help with the captcha code not showing up outside of my network. I have this mod running on a Server 2k3 VM with WAMP 2.0. Just cannot figure out what is blocking the captcha code. Thanks again!
asian flavor
 
Posts: 6
Joined: Tue Oct 23, 2012 11:53 pm

Re: Subsonic registration engine

Postby dsync89 » Wed Oct 24, 2012 1:33 pm

gurutech wrote:The last lines suggest to install php-cgi.

I would install that, and also check to ensure MySQL is running, as well as PHP. You may also require cURL to be installed and running as well.


Thanks for pointing that out. I managed to get it properly setup now.
musicScrape @ Music Cabinet Mod
http://musicscrape.zapto.org:8080
dsync89
 
Posts: 72
Joined: Fri Oct 19, 2012 8:51 am

Re: Subsonic registration engine

Postby gurutech » Thu Oct 25, 2012 12:18 am

asian flavor wrote:This is a cool mod and thanks for your hard work. Got this to work internally but cannot get the captcha to show on the login screen externally. Also have to figure out the SMTP portion, but I think I know what that issue is. Just need help with the captcha code not showing up outside of my network. I have this mod running on a Server 2k3 VM with WAMP 2.0. Just cannot figure out what is blocking the captcha code. Thanks again!


If you are using it on a standard ISP connection, they may be blocking port 80. Try running the "web" part on a different port, and modify the config file to add :(port#) to the location of the Captcha file.
Image
gurutech
 
Posts: 492
Joined: Sun Jan 15, 2012 9:56 pm

Re: Subsonic registration engine

Postby asian flavor » Thu Oct 25, 2012 2:04 am

Thanks for your reply, gurutech. I did figure out the captcha issue and also the email portion. Few more issues came up that I can't figure out. One is this message when I test out the Forgot Password link. When I click on the button to send out the email, I get this error:

Code: Select all
Notice: Undefined variable: username in C:\wamp\www\lib\mailconf.php on line 18

Notice: Undefined variable: spassword in C:\wamp\www\lib\mailconf.php on line 18

Notice: Undefined variable: username in C:\wamp\www\lib\mailconf.php on line 23

Notice: Undefined variable: spassword in C:\wamp\www\lib\mailconf.php on line 23

Notice: Undefined variable: username in C:\wamp\www\lib\mailconf.php on line 32


The email does send out but when I click on the link to reset the password, it goes back to the login screen for Subsonic.

When I register an account, everything works except I get this error:

Code: Select all
Notice: Undefined variable: hash in C:\wamp\www\lib\mailconf.php on line 23


What's strange is that line 23 is under the Pass Reset Mail section, not the Auto Register.
asian flavor
 
Posts: 6
Joined: Tue Oct 23, 2012 11:53 pm

Re: Subsonic registration engine

Postby gurutech » Sat Oct 27, 2012 3:35 am

Post your mailconf.php file here, taking out any passwords or other private information.

I'm suspecting there's a line or two missing - would like to compare it with mine.
Image
gurutech
 
Posts: 492
Joined: Sun Jan 15, 2012 9:56 pm

Re: Subsonic registration engine

Postby asian flavor » Sat Oct 27, 2012 6:53 am

Sorry for the late reply, gurutech. Been playing WWE 13. I removed my email for safety. Thanks for the help!

Code: Select all
<?php
$cwd = getcwd();
$cwd = scandir($cwd);
$checkdir = array_search('lib', $cwd);
if($checkdir=='') {
$mailtemplates = "../lib/mail";
}else{
$mailtemplates = "lib/mail";
}

$fromname = "Asian Flavor";
$sender = "asianflavor@";
$nohash = 'None';

//Auto register mail
$subject = "Registration on Subsonic";
$open1 = file_get_contents($mailtemplates.'/regmail.txt', false);
$message = adddata($open1,$username,$spassword,$email,$nohash);

//Pass reset mail
$subject2 = "Password reset request on Subsonic";
$open2 = file_get_contents($mailtemplates.'/passresetmail.txt', false);
$message2 = adddata($open2,$username,$email,$password,$hash);

//adminmail
$adminemail = "asianflavor@";
$adminsubject = "Registration on Subsonic";
if($woa==true) {
$rquri = folder($_SERVER['REQUEST_URI']);
$adminmessage = $username." is registered on the server.\n Approve: http://".$_SERVER['HTTP_HOST']."".$rquri."?user=".$username;
}else{
$adminmessage = $username." is registered on the server.";
}


Any help is appreciated. :D
asian flavor
 
Posts: 6
Joined: Tue Oct 23, 2012 11:53 pm

Re: Subsonic registration engine

Postby gurutech » Sat Oct 27, 2012 3:32 pm

Add line:
Code: Select all
include("functions.php");


before the first "$cwd = getcwd();" line.

HTH
Image
gurutech
 
Posts: 492
Joined: Sun Jan 15, 2012 9:56 pm

PreviousNext

Return to Subsonic Registration Engine

Who is online

Users browsing this forum: No registered users and 5 guests