diff --git a/api.php b/api.php index d03d31f..79bc426 100644 --- a/api.php +++ b/api.php @@ -16,5 +16,5 @@ if(!$json){ //Construct the api with the dasense specific ApiVerfy Class and the call handler for da-sense api-calls ApiClass //ApiClass contains all stuff you would seek in the index -> look there -echo \SYSTEM\API\api::run('\SYSTEM\API\verify', 'api_mojotrollz',$json); +echo \SYSTEM\API\api::run('\SYSTEM\API\verify', 'api_mojotrollz_beta',$json); new \SYSTEM\LOG\COUNTER("API was called sucessfully."); \ No newline at end of file diff --git a/mojotrollz/api/api_mojotrollz.sql b/mojotrollz/api/api_mojotrollz.sql index 378ecff..24da714 100644 --- a/mojotrollz/api/api_mojotrollz.sql +++ b/mojotrollz/api/api_mojotrollz.sql @@ -9,6 +9,7 @@ INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `nam INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (25, 0, 2, 11, 'create', 'password_sha', 'STRING'); INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (26, 0, 2, 11, 'create', 'email', 'STRING'); INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (27, 0, 2, 11, 'create', 'locale', 'LANG'); + INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (30, 0, 2, 10, 'files', 'cat', 'STRING'); INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (31, 0, 3, 10, 'files', 'id', 'STRING'); INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (40, 0, 2, 10, 'text', 'request', 'STRING'); diff --git a/mojotrollz/api/autoload.inc b/mojotrollz/api/autoload.inc index 2248791..6a5694c 100644 --- a/mojotrollz/api/autoload.inc +++ b/mojotrollz/api/autoload.inc @@ -5,6 +5,7 @@ require_once dirname(__FILE__).'/realm/autoload.inc'; require_once dirname(__FILE__).'/world/autoload.inc'; require_once dirname(__FILE__).'/database/autoload.inc'; require_once dirname(__FILE__).'/map/autoload.inc'; +SYSTEM\autoload::registerFolder(dirname(__FILE__).'/beta',''); SYSTEM\autoload::registerFolder(dirname(__FILE__).'/char',''); SYSTEM\autoload::registerFolder(dirname(__FILE__).'/char/qq','DBD'); SYSTEM\autoload::registerFolder(dirname(__FILE__).'/client',''); \ No newline at end of file diff --git a/mojotrollz/api/beta/Security.php b/mojotrollz/api/beta/Security.php new file mode 100644 index 0000000..dcfc7b8 --- /dev/null +++ b/mojotrollz/api/beta/Security.php @@ -0,0 +1,49 @@ +id; + + //WoW Account + $result = \DBD\ACCOUNT_CREATE::QI(array($username,$wow_password,$email)); + + if(!$result){ + throw new ERROR("WoW Account creation fail!");} + $user_wow = \DBD\ACCOUNT_GET_ID::Q1(array($username))['id']; + + //mojotrollz_user + $result = \DBD\ACCOUNT_CREATE_MOJOTROLLZ::QI(array($user_system,$user_wow)); + if(!$result){ + throw new ERROR("System-Account - WoW-Account creation fail");} + + //Character + if(!charcreation::save($user_wow)){ + throw new ERROR("Character creation fail!");} + + //Update BetaCode + saimod_mojotrollz_beta::code_use($betacode, $user_system); + + //std system result + return JsonResult::toString(\SYSTEM\DBD\SYS_SECURITY_LOGIN_SHA1::Q1(array($username, $password),array($username, $username, $password))); + } +} diff --git a/mojotrollz/api/beta/api_mojotrollz_beta.php b/mojotrollz/api/beta/api_mojotrollz_beta.php new file mode 100644 index 0000000..a9d2772 --- /dev/null +++ b/mojotrollz/api/beta/api_mojotrollz_beta.php @@ -0,0 +1,5 @@ + self::DEFAULT_CHAR_NAME, 'char_gender' => self::DEFAULT_CHAR_GENDER, diff --git a/mojotrollz/api/char/charcreation_validator.php b/mojotrollz/api/char/charcreation_validator.php index e2fb778..d673baf 100644 --- a/mojotrollz/api/char/charcreation_validator.php +++ b/mojotrollz/api/char/charcreation_validator.php @@ -99,7 +99,7 @@ class charcreation_validator { } public static function is_char_equip($value){ - return false;} + return true;} public static function char_equip($value){} public static function is_char_guild($value){ diff --git a/mojotrollz/api/char/qq/CHAR_CREATE.php b/mojotrollz/api/char/qq/CHAR_CREATE.php new file mode 100644 index 0000000..65f4bca --- /dev/null +++ b/mojotrollz/api/char/qq/CHAR_CREATE.php @@ -0,0 +1,21 @@ + user will be loged in + window.location.href = location.href.replace(/#/g, ""); + }else{ // show errors + alert('Not successfull: '+data.result.message); + } + } + }); + } + }); } \ No newline at end of file diff --git a/mojotrollz/page/wizard_register/tpl/register.tpl b/mojotrollz/page/wizard_register/tpl/register.tpl index 310afe8..b819407 100644 --- a/mojotrollz/page/wizard_register/tpl/register.tpl +++ b/mojotrollz/page/wizard_register/tpl/register.tpl @@ -1,59 +1,65 @@