From 136429e37e3de9090a5bcb423030b88e178cbe38 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Thu, 23 Jun 2016 19:47:40 +0200 Subject: [PATCH] #124 tbc account list, account details --- mojotrollz/page/account_tbc/account_tbc.php | 25 +++++++++ mojotrollz/page/account_tbc/autoload.inc | 3 + mojotrollz/page/account_tbc/js/account_tbc.js | 4 ++ .../page/account_tbc/tpl/account_tbc.tpl | 12 ++++ .../page/account_website/account_website.php | 22 ++++++++ mojotrollz/page/account_website/autoload.inc | 3 + .../account_website/js/account_website.js | 15 +++++ .../account_website/tpl/account_website.tpl | 8 +++ .../tpl/option_confirm_email.tpl | 0 mojotrollz/page/autoload.inc | 5 +- .../page/default_account/default_account.php | 11 ---- .../default_account/js/default_account.js | 11 ---- .../page/default_account/tpl/loggedin.tpl | 55 +++++++------------ mojotrollz/page/page_mojotrollz.php | 6 ++ 14 files changed, 121 insertions(+), 59 deletions(-) create mode 100644 mojotrollz/page/account_tbc/account_tbc.php create mode 100644 mojotrollz/page/account_tbc/autoload.inc create mode 100644 mojotrollz/page/account_tbc/js/account_tbc.js create mode 100644 mojotrollz/page/account_tbc/tpl/account_tbc.tpl create mode 100644 mojotrollz/page/account_website/account_website.php create mode 100644 mojotrollz/page/account_website/autoload.inc create mode 100644 mojotrollz/page/account_website/js/account_website.js create mode 100644 mojotrollz/page/account_website/tpl/account_website.tpl rename mojotrollz/page/{default_account => account_website}/tpl/option_confirm_email.tpl (100%) diff --git a/mojotrollz/page/account_tbc/account_tbc.php b/mojotrollz/page/account_tbc/account_tbc.php new file mode 100644 index 0000000..3d71431 --- /dev/null +++ b/mojotrollz/page/account_tbc/account_tbc.php @@ -0,0 +1,25 @@ +email; + $vars['wow_accounts'] = ''; + $res = \SYSTEM\SECURITY\security::getUser()->email_confirmed ? \SQL\MOJO_ACCOUNT_ACCOUNTS::QQ(array($vars['email'])) : \SQL\MOJO_ACCOUNT_MAIN_ACCOUNT::QQ(array($vars['username'],$vars['email'])); + 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()); + return \SYSTEM\PAGE\replace::replaceFile((new PPAGE('account_tbc/tpl/account_tbc.tpl'))->SERVERPATH(), $vars); + } + + public static function css() {return array();} +} \ No newline at end of file diff --git a/mojotrollz/page/account_tbc/autoload.inc b/mojotrollz/page/account_tbc/autoload.inc new file mode 100644 index 0000000..a05a7ef --- /dev/null +++ b/mojotrollz/page/account_tbc/autoload.inc @@ -0,0 +1,3 @@ + +

TBC WoW Account

+
+
+
Username
+
Chars
+
Online
+
+ ${wow_accounts} + ${wow_accounts_confirm} +
+ \ No newline at end of file diff --git a/mojotrollz/page/account_website/account_website.php b/mojotrollz/page/account_website/account_website.php new file mode 100644 index 0000000..d80f55d --- /dev/null +++ b/mojotrollz/page/account_website/account_website.php @@ -0,0 +1,22 @@ +email; + $vars['username'] = \SYSTEM\SECURITY\security::getUser()->username; + $vars['option_confirm_email'] = \SYSTEM\SECURITY\security::getUser()->email_confirmed ? '' : \SYSTEM\PAGE\replace::replaceFile((new PPAGE('account_website/tpl/option_confirm_email.tpl'))->SERVERPATH(),$vars); + + return \SYSTEM\PAGE\replace::replaceFile((new PPAGE('account_website/tpl/account_website.tpl'))->SERVERPATH(), $vars); + } + + public static function css() {return array();} +} \ No newline at end of file diff --git a/mojotrollz/page/account_website/autoload.inc b/mojotrollz/page/account_website/autoload.inc new file mode 100644 index 0000000..a05a7ef --- /dev/null +++ b/mojotrollz/page/account_website/autoload.inc @@ -0,0 +1,3 @@ + +

Account

+
+ You are logged in as ${email}
+ Your Website Account-Name is: ${username}
+ ${option_confirm_email} +
+ \ No newline at end of file diff --git a/mojotrollz/page/default_account/tpl/option_confirm_email.tpl b/mojotrollz/page/account_website/tpl/option_confirm_email.tpl similarity index 100% rename from mojotrollz/page/default_account/tpl/option_confirm_email.tpl rename to mojotrollz/page/account_website/tpl/option_confirm_email.tpl diff --git a/mojotrollz/page/autoload.inc b/mojotrollz/page/autoload.inc index d347d2a..141d1d8 100644 --- a/mojotrollz/page/autoload.inc +++ b/mojotrollz/page/autoload.inc @@ -8,4 +8,7 @@ require_once dirname(__FILE__).'/default_serverlist/autoload.inc'; require_once dirname(__FILE__).'/default_beta/autoload.inc'; require_once dirname(__FILE__).'/default_article/autoload.inc'; require_once dirname(__FILE__).'/default_donate/autoload.inc'; -require_once dirname(__FILE__).'/default_register/autoload.inc'; \ No newline at end of file +require_once dirname(__FILE__).'/default_register/autoload.inc'; + +require_once dirname(__FILE__).'/account_website/autoload.inc'; +require_once dirname(__FILE__).'/account_tbc/autoload.inc'; \ No newline at end of file diff --git a/mojotrollz/page/default_account/default_account.php b/mojotrollz/page/default_account/default_account.php index 44aa36d..9f42fc3 100644 --- a/mojotrollz/page/default_account/default_account.php +++ b/mojotrollz/page/default_account/default_account.php @@ -10,17 +10,6 @@ class default_account implements \SYSTEM\PAGE\Page { $vars = \SYSTEM\PAGE\text::tag('mojotrollz'); if(!\SYSTEM\SECURITY\security::isLoggedIn()){ return \SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_account/tpl/loggedout.tpl'))->SERVERPATH(), $vars);} - - $vars['email'] = \SYSTEM\SECURITY\security::getUser()->email; - $vars['username'] = \SYSTEM\SECURITY\security::getUser()->username; - $vars['option_confirm_email'] = \SYSTEM\SECURITY\security::getUser()->email_confirmed ? '' : \SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_account/tpl/option_confirm_email.tpl'))->SERVERPATH(),$vars); - - $vars['wow_accounts'] = ''; - $res = \SYSTEM\SECURITY\security::getUser()->email_confirmed ? \SQL\MOJO_ACCOUNT_ACCOUNTS::QQ(array($vars['email'])) : \SQL\MOJO_ACCOUNT_MAIN_ACCOUNT::QQ(array($vars['username'],$vars['email'])); - 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()); return \SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_account/tpl/loggedin.tpl'))->SERVERPATH(), $vars); } diff --git a/mojotrollz/page/default_account/js/default_account.js b/mojotrollz/page/default_account/js/default_account.js index 9b01a39..131f449 100644 --- a/mojotrollz/page/default_account/js/default_account.js +++ b/mojotrollz/page/default_account/js/default_account.js @@ -30,15 +30,4 @@ function init_account(){ event.preventDefault(); } }); - - $('#link_confirm_email').click(function(){ - system.account_confirm_email($(this).attr('user'),function (data) { - if(data.status){ - $('#notice_email_confirm').html("EMail sent"); - } else { - $('#notice_email_confirm').html("An Error occurred."); - } - $('#notice_email_confirm').show(); - }); - }); } \ No newline at end of file diff --git a/mojotrollz/page/default_account/tpl/loggedin.tpl b/mojotrollz/page/default_account/tpl/loggedin.tpl index 57dfa08..61e4c02 100644 --- a/mojotrollz/page/default_account/tpl/loggedin.tpl +++ b/mojotrollz/page/default_account/tpl/loggedin.tpl @@ -1,44 +1,27 @@
-

-
+
+
+

Account

- You are logged in as ${email}
- Your Website Account-Name is: ${username}
- ${option_confirm_email} -
-
-
-
-
-
-
-

WoW Account

-
-
-
Username
-
Chars
-
Online
-
- ${wow_accounts} - ${wow_accounts_confirm} -
-
-
-
-
-
-
-
-
-
- - -
-
-
+
+
+
\ No newline at end of file diff --git a/mojotrollz/page/page_mojotrollz.php b/mojotrollz/page/page_mojotrollz.php index 17d533d..3f03f8a 100644 --- a/mojotrollz/page/page_mojotrollz.php +++ b/mojotrollz/page/page_mojotrollz.php @@ -33,4 +33,10 @@ class page_mojotrollz extends \SYSTEM\API\api_default { public static function page_register(){ return (new default_register())->html();} + + public static function page_account_website(){ + return (new account_website())->html();} + + public static function page_account_tbc(){ + return (new account_tbc())->html();} } \ No newline at end of file