Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Registration does not support mangoszero, cmangos-class #8

Closed
wolone opened this issue Apr 14, 2020 · 27 comments
Closed

Registration does not support mangoszero, cmangos-class #8

wolone opened this issue Apr 14, 2020 · 27 comments

Comments

@wolone
Copy link

wolone commented Apr 14, 2020

Is it possible to consider making a simple registration page to support mangoszero, cmangos-class. Thank you

@masterking32
Copy link
Owner

Hey,
Can you send me a repack or auth and characters database of mangoszero?

@wolone
Copy link
Author

wolone commented Apr 16, 2020

I don't know which database tables should be given to you. I exported the account table. Send it to you to see if it works

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for account
-- ----------------------------
DROP TABLE IF EXISTS `account`;
CREATE TABLE `account`  (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Identifier',
  `username` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '',
  `gmlevel` tinyint(3) UNSIGNED NOT NULL DEFAULT 0,
  `sessionkey` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
  `v` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
  `s` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
  `email` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
  `joindate` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
  `last_ip` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0.0.0.0',
  `failed_logins` int(11) UNSIGNED NOT NULL DEFAULT 0,
  `locked` tinyint(3) UNSIGNED NOT NULL DEFAULT 0,
  `last_login` timestamp(0) NOT NULL,
  `active_realm_id` int(11) UNSIGNED NOT NULL DEFAULT 0,
  `expansion` tinyint(3) UNSIGNED NOT NULL DEFAULT 0,
  `mutetime` bigint(40) UNSIGNED NOT NULL DEFAULT 0,
  `locale` tinyint(3) UNSIGNED NOT NULL DEFAULT 0,
  `token` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `idx_username`(`username`) USING BTREE,
  INDEX `idx_gmlevel`(`gmlevel`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 5 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = 'Account System' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of account
-- ----------------------------
INSERT INTO `account` VALUES (1, 'ADMINISTRATOR', 3, '', '312B99EEF1C0196BB73B79D114CE161C5D089319E6EF54FAA6117DAB8B672C14', '8EB5DE915AA3D805FA7099CF61C0BB8A77990EA869078A0C5B9EEE55828F4505', '', '2006-04-25 18:18:56', '127.0.0.1', 0, 0, '0000-00-00 00:00:00', 0, 0, 0, 0, NULL);
INSERT INTO `account` VALUES (2, 'GAMEMASTER', 2, '', '681F5A7D4DE26DBFD3060EE37E03B79FD154875FB18F44DBF843963F193FC1AC', '8873CD861DEFBF124232D6A29E4884E34C73385304A8AC44175976B1003DCFD7', '', '2006-04-25 18:18:56', '127.0.0.1', 0, 0, '0000-00-00 00:00:00', 0, 0, 0, 0, NULL);
INSERT INTO `account` VALUES (3, 'MODERATOR', 1, '', '2CA85C9853E44A6DCE09FC92EBDE57EF20975281EB7604326E25751AF8576859', 'AD68B088D7BCE5E4B734495A7A956F1D5DD1BAB61FB0FEE46C737D93EC166DF5', '', '2006-04-25 18:19:35', '127.0.0.1', 0, 0, '0000-00-00 00:00:00', 0, 0, 0, 0, NULL);
INSERT INTO `account` VALUES (4, 'PLAYER', 0, '', '3738EC7E7C731FD431C716990C6D97CA5C1D50EF0DA7DE9819076DE1D03AA891', 'EBA23AF194D89B8061CA7FEBA06D336B1C38D8FBDABA76F2C51D45141362D881', '', '2006-04-25 18:19:35', '127.0.0.1', 0, 0, '0000-00-00 00:00:00', 0, 0, 0, 0, NULL);

SET FOREIGN_KEY_CHECKS = 1;

@wolone
Copy link
Author

wolone commented Apr 16, 2020

Thank you very much for replying to my message and hope to add support for cmangos registration function

@DJBoxer
Copy link

DJBoxer commented Apr 16, 2020

@masterking32 Cmangos dropped sha_hash and replaced it with SRP, Hope this helps.

@wolone
Copy link
Author

wolone commented Apr 16, 2020

@masterking32
Copy link
Owner

Yes I see, https://github.com/skout23/srp6passwd
So I have an idea without SRP6.
We can use SOAP!
@DJBoxer

masterking32 added a commit that referenced this issue Apr 17, 2020
@masterking32
Copy link
Owner

https://github.com/skout23/simpleregister has some security issues.
It's not a good idea to use system function with https://github.com/skout23/srp6passwd and that's a bit hard to install srp6passwd for users.
Now, you can use it with SOAP, Please test and send me feedback.
But you need to disable the change password.

@DJBoxer
Copy link

DJBoxer commented Apr 17, 2020

I can`t personally test this as currently not running CMangos, Though i see no reason about why using SOAP would not work. Looking forward to the STORE implementation now your project has SOAP. Also was thinking about the terminal project also using SOAP would be nice feature within an admin panel. I understand this was meant to be a simple signup page lol.

Maybe I'll compile cmangos classic in the morning lol.

@wolone
Copy link
Author

wolone commented Apr 18, 2020

$config['soap_username'] = 'admin_soap';                            // SOAP account username.
$config['soap_password'] = 'admin_soap';                            // SOAP account password.

soap_username,soap_password
Where is the user name and password set

cmangos.conf

#    SOAP.Enable
#        Enable soap service
#        Default: 0 - off
#                 1 - on
#
#    SOAP.IP
#        Bound SOAP service ip address, use 0.0.0.0 to access from everywhere
#        Default: 127.0.0.1
#
#    SOAP.Port
#        SOAP port
#        Default: 7878

@DJBoxer
Copy link

DJBoxer commented Apr 18, 2020

@wolone this is the part you need to change

$config['soap_username'] = 'admin_soap';
$config['soap_password'] = 'admin_soap';

basically to

$config['soap_username'] = 'your username here';
$config['soap_password'] = 'your password here';

also in your cmangos.conf all you need to change is soap enabled 1
you will need to create a user that has console access with the details you added to website config.

@wolone
Copy link
Author

wolone commented Apr 18, 2020

@DJBoxer Is the console access right the GM account in the game?
Do GM accounts need to create roles?

@DJBoxer
Copy link

DJBoxer commented Apr 18, 2020

The account would be like a admin account as it needs console access,basic GM accounts should not have access to your console only Owners/admin, if i remember on cmangos you have a GM Level in realmd database, i know the level for trinity is 4 but you would have to ask the Devs over at cmangos discord channel or forum. just to confirm.

@wolone
Copy link
Author

wolone commented Apr 18, 2020

Ok, I see
Account, password requires an account with console permissions
Do you need this account to create game characters?

@DJBoxer
Copy link

DJBoxer commented Apr 18, 2020

The account will be able execute any command in console.

basically soap is like a remote access to console and the way its used on masterking WoWSimpleRegistration is to register a user.

so for this to happen it will send a command to your console such as .account create $user $password

@wolone
Copy link
Author

wolone commented Apr 18, 2020

ok, got it
Let me try
thank you very much

@wolone
Copy link
Author

wolone commented Apr 18, 2020

@DJBoxer Account registration is successful
thank you very much
Your reply solved my big problem

@wolone
Copy link
Author

wolone commented Apr 18, 2020

@masterking32

mangos>SQL: INSERT INTO account(username,v,s,joindate) VALUES('WOLONE','222F516E98EEE88D8A60B5BC188ECE47FE8CA48BDD33B2D46C5EEB489D7BCF8A','9D28E12D5386AFF6EC41EB599B447465DC43A2992DADC5A5F47B06F90A085E3F',NOW())
SQL ERROR: Field 'last_login' doesn't have a default value
Your account has been created.

The page shows successful creation
No data in the database
Console error message

@wolone
Copy link
Author

wolone commented Apr 18, 2020

The strange thing is that I can create an account normally when running in the local virtual machine
An error message appears when running on the server

@wolone
Copy link
Author

wolone commented Apr 18, 2020

JmBFUg.png
JmBk5Q.png
JmBCb8.png
This is the local virtual machine

@wolone
Copy link
Author

wolone commented Apr 18, 2020

I re-initialized the realmd table on the server
Now you can register normally

@wolone
Copy link
Author

wolone commented Apr 18, 2020

@DJBoxer Ask you a question
The server has started mangosd
How to modify user password through ssh

@wolone
Copy link
Author

wolone commented Apr 18, 2020

@masterking32
change Password
reset Password
Is it not available in cmangos?

@DJBoxer
Copy link

DJBoxer commented Apr 18, 2020

@wolone sorry been awhile since i use CMangos, many things have changed but you can try.

.account set password $account $password $password

Or

.account password $old_password $new_password $new_password

What i would suggest is joining Cmangos Discord channel, they are a friendly community. they will also help solve your issue. Once i get home from work i can compile cmangos and maybe find any issues but i dont believe there to be any as soap is a simple connection to a console. i just believe you need assistance in getting things running so to speak.

@wolone
Copy link
Author

wolone commented Apr 18, 2020

@DJBoxer
I know how the command is executed in the console
My server runs realmd via pm2, mangosd runs in the background
On my own computer, I use ssh to connect to the server. I can't see the console interface of mangosd. In this case, what other ways can I perform to add users to the console and change the password?

@al3xc1985
Copy link

I get

Fatal error: Uncaught Error: Class 'SoapClient' not found in C:\AppServ\www\application\include\functions.php:178 Stack trace: #0 C:\AppServ\www\application\include\user.php(168): RemoteCommandWithSOAP('account create ...') #1 C:\AppServ\www\application\include\user.php(27): user::normal_register() #2 C:\AppServ\www\index.php(34): user::post_handler() #3 {main} thrown in C:\AppServ\www\application\include\functions.php on line 178

I have mysql 8.0.19
Apache 2.4.41
PHP 7.3.10

I use tbc cmangos
Enabled soap 127.0.0.1
also
my config
$config['use_soap'] = true; // Enable it if you use servers like CMangos. (Not work on Battle.net servers) $config['soap_host'] = '127.0.0.1'; // SOAP server address. $config['soap_port'] = '7878'; // SOAP server port. $config['soap_uri'] = 'urn:MaNGOS'; // urn:TC for TrinityCore, urn:AC for AzerothCore, urn:MaNGOS for Mangos $config['soap_style'] = 'SOAP_RPC'; // SOAP style $config['soap_username'] = 'accbot'; // SOAP account username. $config['soap_password'] = '1234'; // SOAP account password. $config['soap_ca_command'] = 'account create {USERNAME} {PASSWORD}'; // Create account command, You can use it like this too: '.account create {USERNAME} {PASSWORD} {PASSWORD} {EMAIL}' $config['soap_cp_command'] = 'account set password {USERNAME} {PASSWORD} {PASSWORD}'; // Change password command

I did created that account and gave it gmlevel 4

and I get first error that I replied
Can you analize the info that I gave and share an ideea of what to be done or modified?

@masterking32
Copy link
Owner

masterking32 commented Apr 20, 2020

Hey,
Enable soap in your PHP.
https://stackoverflow.com/questions/11391442/fatal-error-class-soapclient-not-found

@DJBoxer Just need .account set password (for restore password)
Account change password not working for CMangos.

@al3xc1985
Copy link

OMG it works... thank you @masterking32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants