diff --git a/mojotrollz/api/api_mojotrollz.php b/mojotrollz/api/api_mojotrollz.php index 908e01a..9354f58 100644 --- a/mojotrollz/api/api_mojotrollz.php +++ b/mojotrollz/api/api_mojotrollz.php @@ -11,11 +11,21 @@ class api_mojotrollz extends \SYSTEM\API\api_system { \SYSTEM\LOG\JsonResult::fail(); } - public static function call_account_action_create($username, $password, $email, $wowpassword){ + public static function call_account_action_create($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)) || - !self::wow_account_register($username,$email,$wowpassword)){ + !self::wow_account_register($username,$email,$wow_password)){ + throw new ERROR("Account creation failed. Retry later.");} + return JsonResult::ok(); + } + + public static function call_account_action_create_wow($username, $wow_password){ + if(!\SYSTEM\SECURITY\security::isLoggedIn()){ + throw new \SYSTEM\LOG\ERROR('You need to be logged in to register another WoW Account.');} + if(!self::wow_username_available($username)){ + throw new \SYSTEM\LOG\ERROR('Username is not available.');} + if( !self::wow_account_register($username, \SYSTEM\SECURITY\security::getUser()->email,$wow_password)){ throw new ERROR("Account creation failed. Retry later.");} return JsonResult::ok(); } diff --git a/mojotrollz/page/account_tbc/account_tbc.php b/mojotrollz/page/account_tbc/account_tbc.php index c150589..a62c1ef 100644 --- a/mojotrollz/page/account_tbc/account_tbc.php +++ b/mojotrollz/page/account_tbc/account_tbc.php @@ -19,7 +19,9 @@ class account_tbc implements \SYSTEM\PAGE\Page { while($row = $res->next()){ $row['online'] = $row['online'] == 1 ? 'online' : 'offline'; $vars['wow_accounts'] .= \SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_account/tpl/wow_account.tpl'))->SERVERPATH(), $row);} - $vars['wow_accounts_confirm'] = \SYSTEM\SECURITY\security::getUser()->email_confirmed ? '' : \SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_account/tpl/wow_accounts_confirm.tpl'))->SERVERPATH()); + $vars['wow_accounts_confirm'] = \SYSTEM\SECURITY\security::getUser()->email_confirmed ? + \SYSTEM\PAGE\replace::replaceFile((new PPAGE('account_tbc/tpl/account_tbc_new.tpl'))->SERVERPATH()) : + \SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_account/tpl/wow_accounts_confirm.tpl'))->SERVERPATH()); return \SYSTEM\PAGE\replace::replaceFile((new PPAGE('account_tbc/tpl/account_tbc.tpl'))->SERVERPATH(), $vars); } diff --git a/mojotrollz/page/account_tbc/tpl/account_tbc_new.tpl b/mojotrollz/page/account_tbc/tpl/account_tbc_new.tpl new file mode 100644 index 0000000..403ef57 --- /dev/null +++ b/mojotrollz/page/account_tbc/tpl/account_tbc_new.tpl @@ -0,0 +1,5 @@ +
| - + |
diff --git a/mojotrollz/page/page_mojotrollz.php b/mojotrollz/page/page_mojotrollz.php index 59035f1..05819b2 100644 --- a/mojotrollz/page/page_mojotrollz.php +++ b/mojotrollz/page/page_mojotrollz.php @@ -39,13 +39,16 @@ class page_mojotrollz extends \SYSTEM\API\api_default { public static function page_account_website(){ return (new account_website())->html();} - - public static function page_account_tbc(){ - return (new account_tbc())->html();} public static function page_account_changepassword(){ return (new account_changepassword())->html();} public static function page_account_changeemail(){ return (new account_changeemail())->html();} + + public static function page_account_tbc(){ + return (new account_tbc())->html();} + + public static function page_account_tbc_new(){ + return (new account_tbc_new())->html();} } \ No newline at end of file diff --git a/mojotrollz/sql/mysql/system_api.sql b/mojotrollz/sql/mysql/system_api.sql index 5bc04a3..17e3cf9 100644 --- a/mojotrollz/sql/mysql/system_api.sql +++ b/mojotrollz/sql/mysql/system_api.sql @@ -3,11 +3,14 @@ REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `na REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (200, 0, 2, 11, 'newserver', 'address', 'STRING'); REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (205, 0, 2, 11, 'vote', 'server', 'INT'); -REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (210, 0, 2, 11, 'register', 'username', 'STRING'); -REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (211, 0, 2, 11, 'register', 'password', 'STRING'); -REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (212, 0, 2, 11, 'register', 'email', 'STRING'); -REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (213, 0, 2, 11, 'register', 'wowpassword', 'STRING'); -REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (214, 0, 3, 11, 'register', 'betakey', 'STRING'); +-- REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (210, 0, 2, 11, 'register', 'username', 'STRING'); +-- REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (211, 0, 2, 11, 'register', 'password_sha1', 'STRING'); +-- REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (212, 0, 2, 11, 'register', 'email', 'STRING'); +-- REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (213, 0, 2, 11, 'register', 'wow_password', 'STRING'); +-- REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (214, 0, 3, 11, 'register', 'betakey', 'STRING'); + +REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (210, 0, 2, 11, 'create_wow', 'username', 'STRING'); +REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (211, 0, 2, 11, 'create_wow', 'wow_password', 'STRING'); -- REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (210, 1, 3, 1, 'beta', 'key', 'STRING'); REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (215, 1, 2, 1, 'article', 'id', 'STRING'); diff --git a/mojotrollz/sql/mysql/system_page.sql b/mojotrollz/sql/mysql/system_page.sql index fc07a21..8f70c2b 100644 --- a/mojotrollz/sql/mysql/system_page.sql +++ b/mojotrollz/sql/mysql/system_page.sql @@ -9,12 +9,14 @@ REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login` REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (20, 1, 'account', 'account', -1, 0, 0, '#content', './?page=account', 'init_account', 'default_account'); REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (21, 1, 'website', 'account', 20, 1, 0, '#content_account', './?page=account_website', 'init_account_website', 'account_website'); -REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (22, 1, 'tbc', 'account', 20, 1, 1, '#content_account', './?page=account_tbc', 'init_account_tbc', 'account_tbc'); -REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (23, 1, 'changepassword', 'account', 20, 1, 1, '#content_account', './?page=account_changepassword', 'init_account_changepassword', 'account_changepassword'); -REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (24, 1, 'changeemail', 'account', 20, 1, 1, '#content_account', './?page=account_changeemail', 'init_account_changeemail', 'account_changeemail'); +REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (22, 1, 'changepassword', 'account', 20, 1, 1, '#content_account', './?page=account_changepassword', 'init_account_changepassword', 'account_changepassword'); +REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (23, 1, 'changeemail', 'account', 20, 1, 1, '#content_account', './?page=account_changeemail', 'init_account_changeemail', 'account_changeemail'); -REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (25, 1, 'beta', 'beta', -1, 0, 0, '#content', './?page=beta', 'init_beta', 'default_beta'); -REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (26, 1, 'register', 'register', -1, 0, 0, '#content', './?page=register', 'init_register', 'default_register'); +REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (24, 1, 'tbc', 'account', 20, 1, 1, '#content_account', './?page=account_tbc', 'init_account_tbc', 'account_tbc'); +REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (25, 1, 'tbc_new', 'account', 20, 1, 1, '#content_account', './?page=account_tbc_new', 'init_account_tbc_new', 'account_tbc_new'); + +REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (26, 1, 'beta', 'beta', -1, 0, 0, '#content', './?page=beta', 'init_beta', 'default_beta'); +REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (27, 1, 'register', 'register', -1, 0, 0, '#content', './?page=register', 'init_register', 'default_register'); REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (30, 1, 'article', 'article', -1, 0, 0, '#content', './?page=article&id=${article}', 'init_article', 'default_article'); |
|---|