Subsonic registration engine

A little external engine to register users in Subsonic

Moderator: moderators

Re: Subsonic registration engine

Postby dr3van » Wed Jul 25, 2012 3:12 pm

Your timing is fine. I just appreciate the help!! I will look into the smarthost in the the mean time.

Thanks for all your help in getting this far!

**EDIT**
I was able to get sendmail working!!

**EDIT 2
I seem to have got the API to start working for me. I can ping with: https://dr3van.com/rest/ping.view?v=1.1.0&c=ping
And I have successfully created a new user with the API.

However your registration goes through and says everything is registered and sends the email saying the user is registered and moves the data from the woa table to the users table, but they do not register in subsonic.
Subsonic Server: https://dr3van.com

build
Ubuntu Server 12.10 64 bit LAMP
Subsonic 4.7 custom
dr3van
 
Posts: 48
Joined: Wed Feb 22, 2012 8:43 pm

Re: Subsonic registration engine

Postby SparkyRih » Mon Jul 30, 2012 10:18 pm

Ok, so there are no API changes in 4.7 compared to 4.6, so that shouldn't be a problem...

So now you' re saying that everything is working perfectly, except, still no users are registered in subsonic if you use my scripts?

Could you pm me your config.php (don't forget to remove the password)...
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 dr3van » Tue Jul 31, 2012 1:14 pm

SparkyRih wrote:Ok, so there are no API changes in 4.7 compared to 4.6, so that shouldn't be a problem...

So now you' re saying that everything is working perfectly, except, still no users are registered in subsonic if you use my scripts?

Could you pm me your config.php (don't forget to remove the password)...


Yes, Still not registering, I have fiddled around a bit and did get the API working, not sure how, and now got mail sending, I have not been able to find a good way to test curl, but I know it is installed and up to date. I found a few ways to test curl by google searching it, but I am not sure how to confirm it is working. I also tried changing the line with the html to register to a hard coded line without all the php includes and it did not work.

I also noticed in your /admin/approve.php line 32 needed changed to the $protocol. instead of http:// I used the same format as you changed in the register.php of
Code: Select all
$url = $protocol."://".$subsonicdomain."/rest/createUser.view?u=".$admin."&p=".$pass."&v=1.1.0&c=remoteregister&username=".$username."&password=".$spassword."&email=".$email."&settingsRole=".$settingsRole."&streamRole=".$streamRole."&jukeboxRole=".$jukeboxRole."&downloadRole=".$downloadRole."&uploadRole=".$uploadRole."&playlistRole=".$playlistRole."&coverartRole=".$coverartRole."&commentRole=".$commentRole."&podcastRole=".$podcastRole."&shareRole=".$shareRole;


I also sent PM with my config.php
Subsonic Server: https://dr3van.com

build
Ubuntu Server 12.10 64 bit LAMP
Subsonic 4.7 custom
dr3van
 
Posts: 48
Joined: Wed Feb 22, 2012 8:43 pm

Re: Subsonic registration engine

Postby SparkyRih » Wed Aug 01, 2012 10:26 pm

Looking at your config.php, and the phpinfo() that you've send me earlier everything should be perfectly fine...

Try to install these packages via your terminal...
Code: Select all
sudo apt-get install libcurl3 libcurl3-dev php5-curl


Are you using any special characters in your subsonic admin password? like a " or a \

And thank you for pointing me to the little flaw in the approve.php...
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 columbiabbs » Thu Aug 02, 2012 12:55 am

Well after a stint in the hospital I still trying to get this program to work..Somewear I have missed
some thing.Let me tell what i have tryed sofar and my setup here.
1. Dell 755, 2.6mhz, 2gig mem 250gig Hard Drive
2. Windows 7 Home Premium
3. Wamp or Xampp I have tryed both.

4.Subsonic 4.6
5. I have eddited the login.jsp file and replaced the org. one(it works OK)
6. eddited the other files and moved them to the WWW or the HTDOCS Directory
7. made a new DB called Subsonicusers,imported Users and woausers.

The capcha does not show up just a red x in the little box.
Please any help you might give is Welcomed
Thanks William.
columbiabbs
 
Posts: 52
Joined: Sun Oct 03, 2010 3:10 am
Location: COLUMBIA,SC

Re: Subsonic registration engine

Postby tsmith3590 » Thu Aug 02, 2012 4:38 am

Ok, So i have setup most of this right, I am stuck... when i go to my server to login (www.djt630.com) under the register area i am missing the verification code picture and code... Can someone help or point me in the right direction? If you go to my site http://www.djt630.com you will see what i am talking about

Thanks,
Tim
tsmith3590
 
Posts: 4
Joined: Fri Mar 11, 2011 12:14 am

Re: Subsonic registration engine

Postby gurutech » Thu Aug 02, 2012 5:13 am

Check the configuration file. I had the same problem, and had to adjust the lines in the config file referring to my website.

If you are redirecting through any of the "ddns" services, you will have to specify the "long" version of your URL (with port numbers if applicable), not the shortened redirect URL.
Image
gurutech
 
Posts: 492
Joined: Sun Jan 15, 2012 9:56 pm

Re: Subsonic registration engine

Postby dr3van » Thu Aug 02, 2012 2:40 pm

SparkyRih wrote:Looking at your config.php, and the phpinfo() that you've send me earlier everything should be perfectly fine...

Try to install these packages via your terminal...
Code: Select all
sudo apt-get install libcurl3 libcurl3-dev php5-curl

0 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.

SparkyRih wrote:Are you using any special characters in your subsonic admin password? like a " or a \

Nope...

Is there a way to test curl to make sure it works?
Subsonic Server: https://dr3van.com

build
Ubuntu Server 12.10 64 bit LAMP
Subsonic 4.7 custom
dr3van
 
Posts: 48
Joined: Wed Feb 22, 2012 8:43 pm

Re: Subsonic registration engine

Postby dr3van » Thu Aug 02, 2012 3:42 pm

dr3van wrote:Is there a way to test curl to make sure it works?

Using my good friend google I was able to compile a few things I found and made a testing script
Code: Select all
<?php
$ch = curl_init();

curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($ch, CURLOPT_URL, "https://dr3van.com/rest/createUser.view?u=dr3van&p=**EDITED FOR SECURITY**&v=1.1.0&c=remoteregister&username=testuser1&password=testpass1&email=test@test.com&settingsRole=true&streamRole=true&jukeboxRole=true&downloadRole=true&uploadRole=true&playlistRole=true&coverartRole=true&commentRole=true&podcastRole=true&shareRole=true
");

$result = curl_exec($ch);

echo '<pre>';
print_r(curl_getinfo($ch));
echo '</pre>';

echo 'Errors: ' . curl_errno($ch) . ' ' . curl_error($ch) . '<br><br>';

curl_close ($ch);

echo $result . 'EOF';
?>


and it returns
Code: Select all
Array
(
    [url] => https://dr3van.com/rest/createUser.view?u=dr3van&p=**EDITED FOR SECURITY**&v=1.1.0&c=remoteregister&username=testuser1&password=testpass1&email=test@test.com&settingsRole=true&streamRole=true&jukeboxRole=true&downloadRole=true&uploadRole=true&playlistRole=true&coverartRole=true&commentRole=true&podcastRole=true&shareRole=true

    [content_type] =>
    [http_code] => 0
    [header_size] => 0
    [request_size] => 0
    [filetime] => -1
    [ssl_verify_result] => 0
    [redirect_count] => 0
    [total_time] => 0.005071
    [namelookup_time] => 7.2E-5
    [connect_time] => 0.005083
    [pretransfer_time] => 0
    [size_upload] => 0
    [size_download] => 0
    [speed_download] => 0
    [speed_upload] => 0
    [download_content_length] => -1
    [upload_content_length] => -1
    [starttransfer_time] => 0
    [redirect_time] => 0
    [certinfo] => Array
        (
        )

    [redirect_url] =>
)

Errors: 35 error:14077438:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert internal error

EOF


Any Idea what this error is? Or did I compile the script wrong?

After searching around I came across this and it seems to be able to fix the problem, but I am unsure where the argument would need to go?
https://bugs.launchpad.net/ubuntu/+source/openssl/+bug/861137
Last edited by dr3van on Fri Aug 03, 2012 7:43 pm, edited 1 time in total.
Subsonic Server: https://dr3van.com

build
Ubuntu Server 12.10 64 bit LAMP
Subsonic 4.7 custom
dr3van
 
Posts: 48
Joined: Wed Feb 22, 2012 8:43 pm

Re: Subsonic registration engine

Postby SparkyRih » Fri Aug 03, 2012 9:10 am

gurutech wrote:Check the configuration file. I had the same problem, and had to adjust the lines in the config file referring to my website.

If you are redirecting through any of the "ddns" services, you will have to specify the "long" version of your URL (with port numbers if applicable), not the shortened redirect URL.


You are pointing the login.jsp to the wrong location...

http://24.192.102.13/lib/captcha.php
That path doesn't seem to exist...

@dr3van: I'm currently adding a new function to my script, I will post it as a patch for you because I'm curently not able to test it myself...

Edit: Try downloading the file below, it contáins the updated files, you can just overwrite everything, and there is ot need for reconfiguration, it should work... I hope I didn't make any syntax errors, if not, I hope it works...

http://download.schattorie.nl/subreg/httpspatch.zip

Also make sure that the (new) tmp directory is writeable, espacialy the cookie.txt (CHMOD 777)...
The code is a little bit dirty now, but if this works I will clean it up and update my release...
If it 'doesn't work, we will go on fixing it :)
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 dr3van » Fri Aug 03, 2012 3:15 pm

SparkyRih wrote:@dr3van: I'm currently adding a new function to my script, I will post it as a patch for you because I'm curently not able to test it myself...

Edit: Try downloading the file below, it contáins the updated files, you can just overwrite everything, and there is ot need for reconfiguration, it should work... I hope I didn't make any syntax errors, if not, I hope it works...

http://download.schattorie.nl/subreg/httpspatch.zip

Also make sure that the (new) tmp directory is writable, especially the cookie.txt (CHMOD 777)...
The code is a little bit dirty now, but if this works I will clean it up and update my release...
If it 'doesn't work, we will go on fixing it :)


installed the new script, gave cookie.txt full permissions. It goes as far as letting the user complete the registration form and then sends me the email and adds them to the woa table. I can then log into the admin section and approve the user, but after hitting the approve button I am redirected to a white screen. It moves the user from the woa table to the user table. The email after approving does not even send now either and it did before. Nothing was ever written to cookie.txt either.

Just another note that register.php line 91 should also have $protocol. instead of http:// I believe too on the redirect.
Subsonic Server: https://dr3van.com

build
Ubuntu Server 12.10 64 bit LAMP
Subsonic 4.7 custom
dr3van
 
Posts: 48
Joined: Wed Feb 22, 2012 8:43 pm

Re: Subsonic registration engine

Postby dr3van » Fri Aug 03, 2012 9:21 pm

Fixed the original script. You need to add
Code: Select all
curl_setopt($curl, CURLOPT_SSLVERSION, 3);
after line 34 in approve.php and after line 60 in register.php

Not sure if that would complicate things for a http connection but you could create an argument of if the protocol=https to use the line or something.
Subsonic Server: https://dr3van.com

build
Ubuntu Server 12.10 64 bit LAMP
Subsonic 4.7 custom
dr3van
 
Posts: 48
Joined: Wed Feb 22, 2012 8:43 pm

Re: Subsonic registration engine

Postby gurutech » Sat Aug 04, 2012 3:56 am

I'm looking to upgrade to 4.7 beta 3, since it looks like most of the bugs are worked out. Just wondering what files/folders I would need to back up in order to keep the registration engine going after the upgrade. I also have the "signature" mod going, so I would want to back that up as well.

Or would it be best to start over?
Image
gurutech
 
Posts: 492
Joined: Sun Jan 15, 2012 9:56 pm

Re: Subsonic registration engine

Postby SparkyRih » Sat Aug 04, 2012 11:19 am

I have to build a test setup myself so I can test everything properly in an https envoirement...

That's probably going to be tomorrow or monday... I'm sorry for that...

Edit: I got it working, I made 2 very small mistakes in the previous patch :S

I'm going to clean up the whole code now and upload it as soon as I'm done...

Edit 2: Finished...
I've updated the package here: http://marc.schattorie.com/homepage/en/ ... ion-engine

I would recommend overwriting all files (except for the config.php and mailconf.php, but in mailconf.php you have to remove line 2: include("lib/functions.php");)...

I hope it will work for you now...
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 dr3van » Mon Aug 06, 2012 4:25 pm

In an unrelated effort to stop my FLAC files from crashing flash in Firefox I upgraded to the newest 4.7 beta3 and it has a password reset option and kinda changed things around a bit. You might want to take a look at this to try and adapt to it.
Last edited by dr3van on Mon Aug 06, 2012 7:36 pm, edited 2 times in total.
Subsonic Server: https://dr3van.com

build
Ubuntu Server 12.10 64 bit LAMP
Subsonic 4.7 custom
dr3van
 
Posts: 48
Joined: Wed Feb 22, 2012 8:43 pm

PreviousNext

Return to Subsonic Registration Engine

Who is online

Users browsing this forum: No registered users and 3 guests