Page 16 of 18

Re: Subsonic registration engine

PostPosted: Tue Sep 25, 2012 3:23 pm
by SparkyRih
But your users still have to register an account?

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

Re: Subsonic registration engine

PostPosted: Tue Sep 25, 2012 4:02 pm
by willieb
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.

Re: Subsonic registration engine

PostPosted: Tue Sep 25, 2012 4:27 pm
by SparkyRih
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...

Re: Subsonic registration engine

PostPosted: Tue Sep 25, 2012 10:09 pm
by gurutech
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?

Re: Subsonic registration engine

PostPosted: Mon Oct 22, 2012 2:12 pm
by dsync89
Can anyone post some tutorial on how to use this with subsonic? I can't seemed to figure how to set them up.

Re: Subsonic registration engine

PostPosted: Tue Oct 23, 2012 12:08 am
by gurutech
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.

Re: Subsonic registration engine

PostPosted: Tue Oct 23, 2012 1:13 am
by dsync89
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)


Re: Subsonic registration engine

PostPosted: Wed Oct 24, 2012 12:18 am
by gurutech
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.

Re: Subsonic registration engine

PostPosted: Wed Oct 24, 2012 1:16 am
by asian flavor
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!

Re: Subsonic registration engine

PostPosted: Wed Oct 24, 2012 1:33 pm
by dsync89
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.

Re: Subsonic registration engine

PostPosted: Thu Oct 25, 2012 12:18 am
by gurutech
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.

Re: Subsonic registration engine

PostPosted: Thu Oct 25, 2012 2:04 am
by asian flavor
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.

Re: Subsonic registration engine

PostPosted: Sat Oct 27, 2012 3:35 am
by gurutech
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.

Re: Subsonic registration engine

PostPosted: Sat Oct 27, 2012 6:53 am
by asian flavor
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

Re: Subsonic registration engine

PostPosted: Sat Oct 27, 2012 3:32 pm
by gurutech
Add line:
Code: Select all
include("functions.php");


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

HTH