#374 fixed declaration error - register instead of create call to api

This commit is contained in:
Ulf Gebhardt 2017-08-03 00:30:52 +02:00
parent ae474b9d11
commit 4c640c4a03
2 changed files with 7 additions and 8 deletions

View File

@ -1,6 +1,4 @@
<?php
//silence model declaration warning
$_ = function () {
class api_mojotrollz extends \SYSTEM\API\api_system {
public static function call_mojo_action_newserver($address){
return \SQL\MOJOTROLLZ_SERVER_INSERT::QI(array($address,$address)) ?
@ -13,7 +11,11 @@ class api_mojotrollz extends \SYSTEM\API\api_system {
\SYSTEM\LOG\JsonResult::fail();
}
public static function call_account_action_create($username, $password, $email, $wow_password){
//override System call 2 prevent creatio without wow acc
public static function call_account_action_create($username, $password_sha1, $email, $locale = null){
throw new \ERROR('Not allowed - use action register');}
public static function call_account_action_register($username, $password, $email, $wow_password){
if(!\SYSTEM\SECURITY\security::available($username,$email) || !self::wow_username_available($username)){
throw new \SYSTEM\LOG\ERROR('EMail is already in use or Username is not available.');}
if( !\SYSTEM\SECURITY\security::create($username, $password, $email, \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_LANG)) ||
@ -58,7 +60,4 @@ class api_mojotrollz extends \SYSTEM\API\api_system {
public static function call_tbc_action_itemextendedcost($id){
return \JsonResult::toString(\SQL\TBC_ITEMEXTENDEDCOST::Q1(array($id),new \SQL\mangos_one_dbc()));}
}
};
@$_();
unset($_);
}

View File

@ -11,7 +11,7 @@ function init_register(){
url: './api.php',
data: {
call: 'account',
action: 'create',
action: 'register',
username: username,
password_sha1: $.sha1(password),
email: $('#register_email').val(),