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 @@
-

${register_title}

-
+

Register 'ur Mojotrollz Account

+
and create your Character
+
+ id="register_username" + placeholder="${basic_username}" + minlength="3" data-validation-minlength-message="${sai_error_username_short}" + maxlength="16" data-validation-maxlength-message="${sai_error_username_long}" + required data-validation-required-message="${sai_error_username_miss}"/>
+ id="register_email" + placeholder="${basic_email}" + data-validation-email-message="${sai_error_email_wrong}" + required data-validation-required-message="${sai_error_email_miss}"/>
-
- -
-
- +
+
+ +
+
+
+ +
+
-
+
+ id="register_betacode" + placeholder="BetaCode" + minlength="12" data-validation-minlength-message="Incorrect Beta Code!" + maxlength="12" data-validation-maxlength-message="Incorrect Beta Code!" + required data-validation-required-message="A Beta Code is required!"/>
-
+
+
+
diff --git a/mojotrollz/page/wizard_register/wizard_register.php b/mojotrollz/page/wizard_register/wizard_register.php index 77012fe..1292c77 100644 --- a/mojotrollz/page/wizard_register/wizard_register.php +++ b/mojotrollz/page/wizard_register/wizard_register.php @@ -11,7 +11,8 @@ class wizard_register extends SYSTEM\PAGE\Page { $vars['BG'] = \SYSTEM\FILES\files::getURL('backgrounds'); $vars['BUTTONS'] = \SYSTEM\FILES\files::getURL('buttons'); $vars['WOWICONS'] = \SYSTEM\FILES\files::getURL('wowicons'); - $vars = array_merge($vars, \SYSTEM\locale::getStrings(DBD\locale_string::VALUE_CATEGORY_MAINPAGE)); + $vars = array_merge($vars, \SYSTEM\locale::getStrings(DBD\locale_string::VALUE_CATEGORY_BASIC)); + $vars = array_merge($vars, \SYSTEM\locale::getStrings(DBD\locale_string::VALUE_CATEGORY_SYSTEM_SAI_ERROR)); $vars = array_merge($vars, \SYSTEM\locale::getStrings(DBD\locale_string::VALUE_CATEGORY_WOW_INFOTEXT)); return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'wizard_register/tpl/register.tpl'), $vars); } diff --git a/mojotrollz/sai/saimod_mojotrollz_beta/qq/BETA_CHECK_CODE.php b/mojotrollz/sai/saimod_mojotrollz_beta/qq/BETA_CHECK_CODE.php new file mode 100644 index 0000000..db66d05 --- /dev/null +++ b/mojotrollz/sai/saimod_mojotrollz_beta/qq/BETA_CHECK_CODE.php @@ -0,0 +1,12 @@ += 0 ? true : false;} + + public static function code_use($code,$user_new){ + return \DBD\BETA_USE_CODE::QI(array($user_new,$code));} + public static function sai_mod_saimod_mojotrollz_beta_action_del($code){ \DBD\BETA_DELETE_CODE::QI(array($code)); return JsonResult::ok();} diff --git a/system b/system index 076090e..5c04bb5 160000 --- a/system +++ b/system @@ -1 +1 @@ -Subproject commit 076090ea1ae37cea7cf900062aeec2848d8e133f +Subproject commit 5c04bb515f72edb46127eefca01e32c07de908bd