#125 mail page see all account, confirm email, updated system reference, renamed login to account

This commit is contained in:
Ulf Gebhardt 2016-06-06 05:19:58 +02:00
parent d8fe577efd
commit 94316e7843
18 changed files with 81 additions and 43 deletions

@ -1 +1 @@
Subproject commit dca8e12f5725db93e2aac86c0fa0caef66bcc5a1
Subproject commit b7637f426c44366abadbe478b5e6e59ac2270ae0

View File

@ -3,7 +3,7 @@
require_once dirname(__FILE__).'/default_page/autoload.inc';
require_once dirname(__FILE__).'/default_start/autoload.inc';
require_once dirname(__FILE__).'/default_impressum/autoload.inc';
require_once dirname(__FILE__).'/default_login/autoload.inc';
require_once dirname(__FILE__).'/default_account/autoload.inc';
require_once dirname(__FILE__).'/default_serverlist/autoload.inc';
require_once dirname(__FILE__).'/default_beta/autoload.inc';
require_once dirname(__FILE__).'/default_article/autoload.inc';

View File

@ -0,0 +1,26 @@
<?php
class default_account extends \SYSTEM\PAGE\Page {
public static function title(){
return \SYSTEM\PAGE\text::get('title_account');}
public static function meta(){
return \SYSTEM\PAGE\text::tag('meta_account');}
public static function js(){
return array(new \PPAGE('default_account/js/default_account.js'));}
public function html(){
$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);
}
}

View File

@ -1,4 +1,4 @@
function init_login(){
function init_account(){
$("#login_form input").not("[type=submit]").jqBootstrapValidation({
preventSubmit: true,
submitError: function($form, event, errors) {},
@ -30,4 +30,15 @@ function init_login(){
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();
});
});
}

View File

@ -0,0 +1,12 @@
<?php
namespace SQL;
class MOJO_ACCOUNT_ACCOUNTS extends \SYSTEM\DB\QP {
public static function get_class(){return \get_class();}
public static function mysql(){return
'SELECT username,MAX(online) as online,COUNT(chars.guid) as count'.
' FROM mangos_one_realm.account as accounts'.
' LEFT JOIN mangos_one_chars.characters as chars ON accounts.id = chars.account'.
' WHERE UPPER(email) = UPPER(?)'.
' GROUP BY username;';
}
}

View File

@ -5,7 +5,8 @@
<div class="panel-heading"><h4>Account</h4></div>
<div class="panel-body">
You are logged in as <b>${email}</b><br>
Your Website Account-Name is: <b>${username}</b>
Your Website Account-Name is: <b>${username}</b><br>
${option_confirm_email}
</div>
</div>
</div>
@ -21,6 +22,7 @@
<div class="col-md-3"><b>Online</b></div>
</div>
${wow_accounts}
${wow_accounts_confirm}
</div>
</div>
</div>

View File

@ -0,0 +1,2 @@
<a href="#!account" user="${username}" id="link_confirm_email">Request EMail Confirmation</a>
<p style="display:none; padding-top: 10px;" id="notice_email_confirm"></p>

View File

@ -0,0 +1,5 @@
<div class="row-fluid">
<div class="col-md-12">
<p style="font-size: 12px; padding-top: 15px;">To see all your Accounts confirm Your Email!</p>
</div>
</div>

View File

@ -10,9 +10,12 @@ class default_beta extends \SYSTEM\PAGE\Page {
$vars['email'] = \SYSTEM\SECURITY\security::getUser()->email;
$vars['username'] = \SYSTEM\SECURITY\security::getUser()->username;
$res = \SQL\MOJO_ACCOUNT_MAIN_ACCOUNT::Q1(array($vars['username'],$vars['email']));
$res['online'] = $res['online'] == 1 ? 'online' : 'offline';
$vars['wow_accounts'] = \SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_login/tpl/wow_account.tpl'))->SERVERPATH(), $res);
$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_login/tpl/wow_account.tpl'))->SERVERPATH(), $row);
}
$vars['beta_area'] = \SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_beta/tpl/beta_loggedin.tpl'))->SERVERPATH(), $vars);
} else {
$vars['beta_area'] = \SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_beta/tpl/beta_loggedout.tpl'))->SERVERPATH());}

View File

@ -1,23 +0,0 @@
<?php
class default_login extends \SYSTEM\PAGE\Page {
public static function title(){
return \SYSTEM\PAGE\text::get('title_login');}
public static function meta(){
return \SYSTEM\PAGE\text::tag('meta_login');}
public static function js(){
return array(new \PPAGE('default_login/js/default_login.js'));}
public function html(){
$vars = \SYSTEM\PAGE\text::tag('mojotrollz');
if(!\SYSTEM\SECURITY\security::isLoggedIn()){
return \SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_login/tpl/loggedout.tpl'))->SERVERPATH(), $vars);}
$vars['email'] = \SYSTEM\SECURITY\security::getUser()->email;
$vars['username'] = \SYSTEM\SECURITY\security::getUser()->username;
$res = \SQL\MOJO_ACCOUNT_MAIN_ACCOUNT::Q1(array($vars['username'],$vars['email']));
$res['online'] = $res['online'] == 1 ? 'online' : 'offline';
$vars['wow_accounts'] = \SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_login/tpl/wow_account.tpl'))->SERVERPATH(), $res);
return \SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_login/tpl/loggedin.tpl'))->SERVERPATH(), $vars);
}
}

View File

@ -57,7 +57,7 @@
<li class="ontop"><a href="${link_facebook}" target="_blank"><i class="fa fa-facebook fa-lg"></i></a></li>
<li class="ontop"><a href="${link_youtube}" target="_blank"><i class="fa fa-youtube fa-lg"></i></a></li>
<li class="ontop"><a href="#!donate"><i class="fa fa-usd fa-lg"></i></a></li>
<li class="ontop"><a href="#!login"><i class="glyphicon glyphicon-user"></i></a></li>
<li class="ontop"><a href="#!account"><i class="glyphicon glyphicon-user"></i></a></li>
</ul>
</div>
</div>
@ -91,7 +91,7 @@
<!--<a href="#content_addons">${mojotrollz_addons}</a><br><br>-->
</div>
<div class="col-md-4">
<a href="#!login"><i class="glyphicon glyphicon-user"></i>&nbsp;&nbsp; ${mojotrollz_login}</a> / <a href="#!register"> REGISTER</a><br><br>
<a href="#!account"><i class="glyphicon glyphicon-user"></i>&nbsp;&nbsp; ${mojotrollz_login}</a> / <a href="#!register"> REGISTER</a><br><br>
<!--<a href="#!guild">GUILD PAGES</a><br><br>
<a href="#!gshirt">GUILD SHIRTS</a><br><br>-->
<a href="${link_facebook}" target="_blank"><i class="fa fa-facebook fa-lg"></i>&nbsp;&nbsp; FACEBOOK</a><br><br>

View File

@ -16,8 +16,8 @@ class page_mojotrollz extends \SYSTEM\API\api_default {
public static function page_start(){
return (new default_start())->html();}
public static function page_login(){
return (new default_login())->html();}
public static function page_account(){
return (new default_account())->html();}
public static function page_serverlist(){
return (new default_serverlist())->html();}

View File

@ -3,7 +3,7 @@ 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 (15, 1, 'impressum', 'impressum', -1, 0, 0, '#content', './?page=impressum', 'init_impressum', 'default_impressum');
REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (20, 1, 'login', 'login', -1, 0, 0, '#content', './?page=login', 'init_login', 'default_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 (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');

View File

@ -63,8 +63,8 @@ REPLACE INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time
REPLACE INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('meta_donate_keywords', 'enUS', 'World of Warcraft, Private Server, Download WoW, Addons, Gaming Community, Online Games', 10, 10, '2016-05-28 01:25:23', '2016-05-28 01:25:23');
REPLACE INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('meta_impressum_description', 'enUS', 'Mojotrollz.eu - Your Online Gaming Community. Teamspeak 3 (ts3), Download WoW 1.12.1 Classic, WoW 2.4.3 TBC, WoW 3.3.5a WOTLK, Vote for Private Servers', 10, 10, '2016-05-28 01:34:38', '2016-05-28 01:34:38');
REPLACE INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('meta_impressum_keywords', 'enUS', 'World of Warcraft, Private Server, Download WoW, Addons, Gaming Community, Online Games', 10, 10, '2016-05-28 01:26:19', '2016-05-28 01:26:19');
REPLACE INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('meta_login_description', 'enUS', 'Mojotrollz.eu - Your Online Gaming Community. Teamspeak 3 (ts3), Download WoW 1.12.1 Classic, WoW 2.4.3 TBC, WoW 3.3.5a WOTLK, Vote for Private Servers', 10, 10, '2016-05-28 01:34:57', '2016-05-28 01:34:57');
REPLACE INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('meta_login_keywords', 'enUS', 'World of Warcraft, Private Server, Download WoW, Addons, Gaming Community, Online Games', 10, 10, '2016-05-28 01:22:59', '2016-05-28 01:22:59');
REPLACE INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('meta_account_description', 'enUS', 'Mojotrollz.eu - Your Online Gaming Community. Teamspeak 3 (ts3), Download WoW 1.12.1 Classic, WoW 2.4.3 TBC, WoW 3.3.5a WOTLK, Vote for Private Servers', 10, 10, '2016-06-06 04:51:54', '2016-05-28 01:34:57');
REPLACE INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('meta_account_keywords', 'enUS', 'World of Warcraft, Private Server, Download WoW, Addons, Gaming Community, Online Games', 10, 10, '2016-06-06 04:52:06', '2016-05-28 01:22:59');
REPLACE INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('meta_register_description', 'enUS', 'Mojotrollz.eu - Your Online Gaming Community. Teamspeak 3 (ts3), Download WoW 1.12.1 Classic, WoW 2.4.3 TBC, WoW 3.3.5a WOTLK, Vote for Private Servers', 10, 10, '2016-05-28 01:35:21', '2016-05-28 01:35:21');
REPLACE INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('meta_register_keywords', 'enUS', 'World of Warcraft, Private Server, Download WoW, Addons, Gaming Community, Online Games', 10, 10, '2016-05-28 01:27:04', '2016-05-28 01:27:04');
REPLACE INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('meta_serverlist_description', 'enUS', 'Mojotrollz.eu - Your Online Gaming Community. Teamspeak 3 (ts3), Download WoW 1.12.1 Classic, WoW 2.4.3 TBC, WoW 3.3.5a WOTLK, Vote for Private Servers', 10, 10, '2016-05-28 01:35:41', '2016-05-28 01:35:41');
@ -88,10 +88,10 @@ REPLACE INTO `system_text_tag` (`id`, `tag`) VALUES ('meta_impressum_description
REPLACE INTO `system_text_tag` (`id`, `tag`) VALUES ('meta_impressum_description', 'meta_impressum');
REPLACE INTO `system_text_tag` (`id`, `tag`) VALUES ('meta_impressum_keywords', 'meta');
REPLACE INTO `system_text_tag` (`id`, `tag`) VALUES ('meta_impressum_keywords', 'meta_impressum');
REPLACE INTO `system_text_tag` (`id`, `tag`) VALUES ('meta_login_description', 'meta');
REPLACE INTO `system_text_tag` (`id`, `tag`) VALUES ('meta_login_description', 'meta_login');
REPLACE INTO `system_text_tag` (`id`, `tag`) VALUES ('meta_login_keywords', 'meta');
REPLACE INTO `system_text_tag` (`id`, `tag`) VALUES ('meta_login_keywords', 'meta_login');
REPLACE INTO `system_text_tag` (`id`, `tag`) VALUES ('meta_account_description', 'meta');
REPLACE INTO `system_text_tag` (`id`, `tag`) VALUES ('meta_account_description', 'meta_account');
REPLACE INTO `system_text_tag` (`id`, `tag`) VALUES ('meta_account_keywords', 'meta');
REPLACE INTO `system_text_tag` (`id`, `tag`) VALUES ('meta_account_keywords', 'meta_account');
REPLACE INTO `system_text_tag` (`id`, `tag`) VALUES ('meta_register_description', 'meta');
REPLACE INTO `system_text_tag` (`id`, `tag`) VALUES ('meta_register_description', 'meta_register');
REPLACE INTO `system_text_tag` (`id`, `tag`) VALUES ('meta_register_keywords', 'meta');
@ -114,14 +114,14 @@ REPLACE INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time
REPLACE INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('title_beta', 'enUS', 'Mojotrollz - Beta', 10, 10, '2016-05-28 01:10:14', '2016-05-28 01:10:14');
REPLACE INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('title_donate', 'enUS', 'Mojotrollz - Donate', 10, 10, '2016-05-28 01:09:05', '2016-05-28 01:09:05');
REPLACE INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('title_impessum', 'enUS', 'Mojotrollz - Impressum', 10, 10, '2016-05-28 01:10:44', '2016-05-28 01:10:44');
REPLACE INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('title_login', 'enUS', 'Mojotrollz - Login', 10, 10, '2016-05-27 23:37:37', '2016-05-27 23:37:37');
REPLACE INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('title_account', 'enUS', 'Mojotrollz - Account', 10, 10, '2016-06-06 04:54:39', '2016-05-27 23:37:37');
REPLACE INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('title_register', 'enUS', 'Mojotrollz - Register', 10, 10, '2016-05-28 01:11:22', '2016-05-28 01:11:22');
REPLACE INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('title_start', 'enUS', 'MojotrollZ - Your Online Gaming Community', 10, 10, '2016-05-28 01:19:05', '2016-05-28 01:19:05');
REPLACE INTO `system_text_tag` (`id`, `tag`) VALUES ('title_article', 'title');
REPLACE INTO `system_text_tag` (`id`, `tag`) VALUES ('title_beta', 'title');
REPLACE INTO `system_text_tag` (`id`, `tag`) VALUES ('title_donate', 'title');
REPLACE INTO `system_text_tag` (`id`, `tag`) VALUES ('title_impessum', 'title');
REPLACE INTO `system_text_tag` (`id`, `tag`) VALUES ('title_login', 'title');
REPLACE INTO `system_text_tag` (`id`, `tag`) VALUES ('title_account', 'title');
REPLACE INTO `system_text_tag` (`id`, `tag`) VALUES ('title_register', 'title');
REPLACE INTO `system_text_tag` (`id`, `tag`) VALUES ('title_start', 'mojotrollz');
REPLACE INTO `system_text_tag` (`id`, `tag`) VALUES ('title_start', 'title');