masterking32 / WoWSimpleRegistration

Simple Registration page for TrinityCore/AzerothCore/AshamaneCore/CMangos
https://masterking32.com
GNU General Public License v3.0
264 stars 216 forks source link

Restore password fails via SOAP. Fatal error "cannot connect to host" #16

Closed Ansem closed 4 years ago

Ansem commented 4 years ago

Restore password only works when said account actually has an email, regardless of SOAP enabled or not. The mail gets sent but when the link is clicked the following error displays:

Fatal error: Uncaught SoapFault exception: [HTTP] Error Fetching http headers in /var/www/html/application/include/functions.php:164 Stack trace: #0 [internal function]: SoapClient->doRequest('<?xml version="...', 'http://127.0.0....', 'urn:MaNGOS#exec...', 1, 0) #1 /var/www/html/application/include/functions.php(164): SoapClient->call('executeCommand', Array) #2 /var/www/html/application/include/user.php(454): RemoteCommandWithSOAP('account set pas...') #3 /var/www/html/application/include/user.php(19): user::restorepassword_setnewpw('', '...') #4 /var/www/html/index.php(34): user::post_handler() #5 {main} thrown in /var/www/html/application/include/functions.php on line 164

I have a very barebones SOAP registration script right now which works to create an account with user and password, I have even tried a newly made account as the SOAP user to test if it has proper access, it has.

OS: Centos 7 PHP: 7.3.13 PHP modules installed and enabled.

How to reproduce: Enable SOAP. Restore a password. Click the link in the e-mail. The error shows up.

masterking32 commented 4 years ago

hmmm, Are you sure create account work with soap? Check the command of the set password, Is that work on your core? What is your Core?

Ansem commented 4 years ago

$config['soap_cp_command'] = 'account set password {USERNAME} {PASSWORD} {PASSWORD}'; Terminal output for "help account set password" is: mangos>help account set password Syntax: .account set password (#accountId|$accountName) $password $password

Set password for account.

So I don't know why it doesn't work. Also I found out there is a change password feature in the console: mangos>help account password Syntax: .account password $old_password $new_password $new_password

Change your account password. Meaning that if the old password is known a user could change it or it will get denied if the username/password don't match.

This is for the latest Cmangos.

Ansem commented 4 years ago

Could it be the case that the script sends the SOAP input as a HTTP document instead of a SOAP command, which the server simply refuses?

masterking32 commented 4 years ago

Contact me on Discord, Let me check it with remote. MasterkinG32#9999

amae-byte commented 4 years ago

same problem here :

Fatal error: Uncaught SoapFault exception: [HTTP] Error Fetching http headers in /var/www/hhhhh/application/include/functions.php:185 Stack trace: #0 [internal function]: SoapClient->doRequest('<?xml version="...', 'http://127.0.0....', 'urn:MaNGOS#exec...', 1, 0) #1 /var/www/hhhhhh/application/include/functions.php(185): SoapClient->call('executeCommand', Array) #2 /var/www/hhhhhh/application/include/user.php(548): RemoteCommandWithSOAP('account set pas...') #3 /var/www/hhhhhh/application/include/user.php(19): user::restorepassword_setnewpw('amaetest', '3b2242aab4a1fc4...') #4 /var/www/hhhhh/index.php(34): user::post_handler() #5 {main} thrown in /var/www/xxxxxxxxx/application/include/functions.php on line 185

OS: Debian 10 uptodate PHP-FPM: 7.3 PHP modules installed and enabled.

How to reproduce: Enable SOAP. Restore a password. Click the link in the e-mail. The error shows up. Change passwd in cmd-line OK

Any solution ?

masterking32 commented 4 years ago

What is your core? for TrinityCore you don't need SOAP for restore password!

Check the change password command!