Subsonic registration engine

A little external engine to register users in Subsonic

Moderator: moderators

Re: Subsonic registration engine

Postby gurutech » Sun Feb 19, 2012 4:30 pm

SparkyRih wrote:No... my system registers a user in the MySQL DB but ALSO a user in the DB of Subsonic...
Are you sure that your $subsonicdomain is correcy (subdomain.domain.ext:portifnot80) without http:// or any other /'s?

Edit: Are you using Sbusonic in httpS mode? I haven't thought of that in my code, that could be an issue....


Not running in https mode; I did check to make sure I had the port # in there, and added it, created a new user, but still not working. It's adding the user to the database, but not to Subsonic.

Did a little digging, found the line of code that creates the user in Subsonic, so I typed that line manually in my browser. Line is:

Code: Select all
http://{myip/port}/rest/createUser.view?u={adminuser}&p={adminpassword}&v=1.1.0&c=remoteregister&username=test3&password=asdf&email=test@yahoo.com


Got an error message:

Code: Select all
This XML file does not appear to have any style information associated with it. The document tree is shown below.
      <subsonic-response status="ok" version="1.7.0">
</subsonic-response>


Is it just a matter of changing the 1.1.0 above to 1.7.0 ?
Image
gurutech
 
Posts: 492
Joined: Sun Jan 15, 2012 9:56 pm

Re: Subsonic registration engine

Postby SparkyRih » Sun Feb 19, 2012 5:48 pm

Something is just wrong with your subsonic I guess...That XML output is not correct...
Which version are you running, of 4.6, try to donwload the latest 2.00-4.6 release (I've changed some code yesterday)... It only adds the shareRole option to be set via the config file, but I guess it's worth a try...
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 » Sun Feb 19, 2012 7:00 pm

SparkyRih wrote:Something is just wrong with your subsonic I guess...That XML output is not correct...
Which version are you running, of 4.6, try to donwload the latest 2.00-4.6 release (I've changed some code yesterday)... It only adds the shareRole option to be set via the config file, but I guess it's worth a try...


Should that last line in your code read "&shareRole = true;" or "%shareRole = true;"? I tried it both ways, but still got the same error. Going to try the 1.7.0 bit now, will let you know how that works...

Edit: OK, seems to work, whether it's 1.1.0 or 1.7.0, so I don't think that was the issue. By "work", I mean it does add the user to the database if I manually enter it via the browser window, but still shows the error I showed above.

It also will not work if done through the registration script. Going to hard-code the IP address into the php files. This should work for a while, but if my IP changes, I'd have to re-code...

Edit 2: hard-coding the IP worked. Doesn't seem to be anything wrong with your coding, just with how my IP redirector is doing the dynamic DNS.... Will have to work with them on getting this fixed... lol
Image
gurutech
 
Posts: 492
Joined: Sun Jan 15, 2012 9:56 pm

Re: Subsonic registration engine

Postby SparkyRih » Sun Feb 19, 2012 8:12 pm

So it does work if you hardcode it??
That's strange, becasue your server setup is fine... if you edit the config files in the right way, thay should just work fine...

And I've corrected the stupid syntax error XD
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 beehlerj » Sun Feb 26, 2012 8:49 am

Ok I think this is a stupid question but does this register the users on both my account and your server? :oops:
beehlerj
 
Posts: 7
Joined: Mon Feb 20, 2012 10:02 pm

Re: Subsonic registration engine

Postby SparkyRih » Sun Feb 26, 2012 4:08 pm

beehlerj wrote:Ok I think this is a stupid question but does this register the users on both my account and your server? :oops:


It doesn't register a user on my server... you can read the full code ;)
It only registers the user in your own MySQL DB and your own Subsonic DB (and optionaly in your own Multihost MySQL DB)...
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 Excessive » Tue May 15, 2012 5:49 am

Ok, I've been working on this project for the last 2 weeks and while at first thinking that it would be too hard to get it going, I still persisted to try. So I got as far as setting up the mailserver and now I'm kind of stuck with this error message:

Warning: mail() [function.mail]: SMTP server response: 550 Invalid recipient: "useremailhere" in C:\wamp\www\subsonicusers\forgotpass.php on line 39

Fatal error: Maximum execution time of 30 seconds exceeded in C:\wamp\www\subsonicusers\forgotpass.php on line 40

The email is right!
It took me 3 days to work out how to get the captcha going until I read and re-read this forum and finally added the subfolder of the subregengine as "subsonicusers" in the "subsonic domain"
I don't think it registers users yet because it can't send users emails.

Running windows 7 home premium with subsonic 4.6 and wamp server. Signed up for no-ip.com dynamic dns.
Someone pls help! :)

My site url is http://cooltunes.no-ip.org:100
........................................................................................................................................................................

Update

I'm using a different mailserver now and this is the error message

Warning: mail() [function.mail]: SMTP server response: 553 Invalid mail address in C:\wamp\www\subsonicusers\forgotpass.php on line 39

Note that there is no error in "maximum execution time of 30 seconds exceeded"
Last edited by Excessive on Tue May 15, 2012 11:22 am, edited 3 times in total.
Excessive
 
Posts: 33
Joined: Wed Apr 04, 2012 10:19 am

Re: Subsonic registration engine

Postby SparkyRih » Tue May 15, 2012 9:28 am

first I'd recommend you to remove the e-mail address from your post, since it can be used for spam...

To answer your question, I need to have information from your php.ini...

It's best to PM it to me, so that I can take a look...
If you have a customer internet connection, you usually have to setup their SMTP server to be able to send mail out...
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 Excessive » Tue May 15, 2012 11:19 am

PM sent .......... so I won't have to run a mailserver then?
Pls let me know of the settings in php.ini as I didn't really make any changes there.
Also if I won't have to run the mailserver, where do I enter my isp's details?
Thnx :)
Excessive
 
Posts: 33
Joined: Wed Apr 04, 2012 10:19 am

Re: Subsonic registration engine

Postby SparkyRih » Tue May 15, 2012 12:16 pm

Excessive wrote:PM sent .......... so I won't have to run a mailserver then?
Pls let me know of the settings in php.ini as I didn't really make any changes there.
Also if I won't have to run the mailserver, where do I enter my isp's details?
Thnx :)


Sinc your on windows, look for this block in your php.ini

Code: Select all
[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25


And chagne it to:
Code: Select all
[mail function]
; For Win32 only.
SMTP = domainofyourispmailserver.com
smtp_port = 25


Like I said, most ISP's don't allow usage of your own mail server (I know, there are many workarounds, I'm running an exchange server myself). but telling PHP to use the ISP's mail server for outbound messages is the best solution.

Edit: I tried registering an account on your server.
Your users are created in the MySQL database, but they aren't created on your subsonic server... So your config.php inside the lib folder has also a misconfiguration I guess...
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 Excessive » Tue May 15, 2012 1:16 pm

Ok, fixed the php.ini issue and uninstalled the database and reinstalled so that the trial registrations would be wiped. I PM-ed u the config.php file. I had to remove the password though or I couldn't get a connection. Pls let me know of your best advice.
Excessive
 
Posts: 33
Joined: Wed Apr 04, 2012 10:19 am

Re: Subsonic registration engine

Postby SparkyRih » Tue May 15, 2012 1:35 pm

Excessive wrote:Ok, fixed the php.ini issue and uninstalled the database and reinstalled so that the trial registrations would be wiped. I PM-ed u the config.php file. I had to remove the password though or I couldn't get a connection. Pls let me know of your best advice.


Your config file is perfectly fine, except for one line...

$subsonicdomain = "http://cooltunes.no-ip.org/subsonicusers"; //The IP address or domain name where your subsonic is located.

remove the http://:
$subsonicdomain = "cooltunes.no-ip.org/subsonicusers"; //The IP address or domain name where your subsonic is located.

So if your able to send mail from PHP by changnign the php.ini, and if you fix this little error in the config file, your registration engine is ready to use :)

But why did you need to reinstall the DB? PHP and MySQL are free platforms...
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 Excessive » Tue May 15, 2012 1:40 pm

Ok, I'll mod it tomorrow and let u know, time for bed here in Aust now ......... I reinstalled the database so u can try and register again without it saying that "this user or email already exists" so that u can see the error message.

Thanx for ur help
Excessive
 
Posts: 33
Joined: Wed Apr 04, 2012 10:19 am

Re: Subsonic registration engine

Postby Excessive » Wed May 16, 2012 5:57 am

Ok, I've removed the http:// and now when I go to register a user it comes up with an error message for a brief moment (I couldn't read it because it redirects too fast), and it redirects to the "This part of http://cooltunes.no-ip.org:100 is protected!" page. I also had to change the subfolder of the subregengine to "gbuser" because in the reset password email it gives the following link "http://cooltunes.no-ip.org/gbuser/changepass.php?id=19daa70bb4d29895ea5ac6e7f0e9f589d" with the "gbuser" subfolder and I couldn't find where to change the "gbuser" to "subsonicusers" as I had previously set up. Either way, I'm happy with the gbuser folder too, if u can tell me where to change the gbuser subfolder to subsonicusers in the reset password url so that it comes up with "http://cooltunes.no-ip.org/subsonicusers/changepass.php?id=19daa70bb4d29895ea5ac6e7f0e9f589d" instead of "http://cooltunes.no-ip.org/gbuser/changepass.php?id=19daa70bb4d29895ea5ac6e7f0e9f589d", then I'll change it back. Having said that, I receive emails both with register and change password, but users are still not registered in subsonic.
Also, I had to go through all the php files and change your domain to mine and also had to do some german to english translating. I recommend that you go through your files and change the german stuff to english and also redo the instructions as to what files to edit to replace your Schattorie.nl domain to the specified user's domain. One last thing in the changepass.php the translation to "If successful, I'd be a very bad scripter!" .......... this comes up after the change password window. Should this read "password reset"? ........ Please have a look at my site and do try and register and reset password to see the error messages. http://cooltunes.no-ip.org:100
And yes I still need it to make it register users in subsonic.
Thanks :)
Excessive
 
Posts: 33
Joined: Wed Apr 04, 2012 10:19 am

Re: Subsonic registration engine

Postby SparkyRih » Wed May 16, 2012 7:05 am

First of all, I'm not German, I'm Dutch :P

Second, the gbuser folder can be changed in the forgotpassmail.txt file....

And i'm also aware of the fact that my domain namei s used everywhere, I will change this in a future update... When I first created this mod I only created it for myself and another friend, but than I saw people really wanted to have something like this, so I released it...

Not being able to register users in subsonic has usually to do with the cURL module... but I had a brief look at that part in your php.ini, and it seemed fine to me...
If you can't figure it out, you can PM me a link to a php info file:

Code: Select all
<?php
echo phpinfo();
?>
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

PreviousNext

Return to Subsonic Registration Engine

Who is online

Users browsing this forum: No registered users and 5 guests