#124 reset password

This commit is contained in:
Ulf Gebhardt 2016-12-17 01:26:06 +01:00
parent 7dcff1eb37
commit 848e10d052
17 changed files with 94 additions and 76 deletions

@ -1 +1 @@
Subproject commit 209a86b080deed9247de01acc5012b5df87d9b93
Subproject commit 87a59c5e91d6d5918450444909aacdfa1d4236d2

View File

@ -10,7 +10,7 @@ class account_changeemail implements \SYSTEM\PAGE\Page {
$vars = \SYSTEM\PAGE\text::tag('mojotrollz');
if(!\SYSTEM\SECURITY\security::isLoggedIn()){
return \SYSTEM\PAGE\replace::replaceFile((new PPAGE('account_login/tpl/account_login.tpl'))->SERVERPATH(), $vars);}
return \SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_account/tpl/account_login.tpl'))->SERVERPATH(), $vars);}
return \SYSTEM\PAGE\replace::replaceFile((new PPAGE('account_changeemail/tpl/account_changeemail.tpl'))->SERVERPATH(), $vars);
}

View File

@ -10,7 +10,7 @@ class account_changepassword implements \SYSTEM\PAGE\Page {
$vars = \SYSTEM\PAGE\text::tag('mojotrollz');
if(!\SYSTEM\SECURITY\security::isLoggedIn()){
return \SYSTEM\PAGE\replace::replaceFile((new PPAGE('account_login/tpl/account_login.tpl'))->SERVERPATH(), $vars);}
return \SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_account/tpl/account_login.tpl'))->SERVERPATH(), $vars);}
return \SYSTEM\PAGE\replace::replaceFile((new PPAGE('account_changepassword/tpl/account_changepassword.tpl'))->SERVERPATH(), $vars);
}

View File

@ -49,10 +49,10 @@
name="user_password_new2"
placeholder="${basic_placeholder_password}"
data-validation-matches-match="user_password_new1"
data-validation-matches-message="${basic_password_match}"/>
required data-validation-matches-message="${basic_password_match}"/>
<br/>
</div>
<p class="help-block" id="changepassword-help-block" style="float: left; margin-top: 3px;"></p>
<p class="help-block" style="float: left; margin-top: 3px;"></p>
</div>
</td>
</tr>
@ -68,6 +68,7 @@
</tr>
</tbody>
</table>
<p id="changepassword-help-block" style="float: left; margin-top: 3px;"></p>
</div>
</form>
</div>

View File

@ -1,58 +0,0 @@
<div class="row-fluid">
<div class="col-md-6 col-md-offset-3">
<div class="panel panel-success">
<div class="panel-heading"><h4>Mojotrollz - Login</h4></div>
<div class="panel-body">
<form class="textbox" style="padding:10px" id="login_form">
<div class="control-group">
<table id="userLoginTable" style="margin-left: 20px;">
<tbody>
<tr>
<th style="width: 200px;">${basic_username}</th>
<td>
<div class="controls">
<input type="text"
size="25"
style="margin-bottom: 15px;"
id="bt_login_user"
placeholder="${basic_placeholder_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}"/>
</div>
</td>
</tr>
<tr>
<th>${basic_password}</th>
<td>
<div class="controls">
<input type="password"
size="25"
style="margin-bottom: 15px;"
id="bt_login_password"
placeholder="${basic_placeholder_password}"
minlength="5" data-validation-minlength-message="${sai_error_password_short}"
maxlength="16" data-validation-maxlength-message="${sai_error_password_long}"
required data-validation-required-message="${sai_error_password_miss}"/>
</div>
</td>
</tr>
<tr>
<th>
<p style="float: left;"><a href="#!register">Register an Account</a></p>
</th>
<td>
<p style="float: right;">
<button class="btn-sm btn btn-success" style="clear: left; height: 32px; font-size: 13px;" type="submit" id="login_submit"><span class="glyphicon glyphicon-log-in" aria-hidden="true"></span> ${basic_login}</button>
</p>
</td>
</tr>
</tbody>
</table>
<p class="help-block" style="float: left; margin-top: 3px;"></p>
</div>
</form>
</div>
</div>
</div>
</div>

View File

@ -10,7 +10,7 @@ class account_tbc implements \SYSTEM\PAGE\Page {
$vars = \SYSTEM\PAGE\text::tag('mojotrollz');
if(!\SYSTEM\SECURITY\security::isLoggedIn()){
return \SYSTEM\PAGE\replace::replaceFile((new PPAGE('account_login/tpl/account_login.tpl'))->SERVERPATH(), $vars);}
return \SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_account/tpl/account_login.tpl'))->SERVERPATH(), $vars);}
$vars['email'] = \SYSTEM\SECURITY\security::getUser()->email;
$vars['username'] = \SYSTEM\SECURITY\security::getUser()->username;

View File

@ -10,7 +10,7 @@ class account_website implements \SYSTEM\PAGE\Page {
$vars = \SYSTEM\PAGE\text::tag('mojotrollz');
if(!\SYSTEM\SECURITY\security::isLoggedIn()){
return \SYSTEM\PAGE\replace::replaceFile((new PPAGE('account_login/tpl/account_login.tpl'))->SERVERPATH(), $vars);}
return \SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_account/tpl/account_login.tpl'))->SERVERPATH(), $vars);}
$vars['email'] = \SYSTEM\SECURITY\security::getUser()->email;
$vars['username'] = \SYSTEM\SECURITY\security::getUser()->username;

View File

@ -9,6 +9,7 @@ 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';
require_once dirname(__FILE__).'/default_resetpassword/autoload.inc';
require_once dirname(__FILE__).'/account_website/autoload.inc';
require_once dirname(__FILE__).'/account_tbc/autoload.inc';

View File

@ -9,7 +9,7 @@ class default_account implements \SYSTEM\PAGE\Page {
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);}
return \SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_account/tpl/account_login.tpl'))->SERVERPATH(), $vars);}
return \SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_account/tpl/loggedin.tpl'))->SERVERPATH(), $vars);
}

View File

@ -3,18 +3,17 @@
<div class="col-md-6 col-md-offset-3">
<div class="panel panel-success">
<div class="panel-heading"><h4>Mojotrollz - Login</h4></div>
<div class="panel-body">
<form class="textbox" style="padding:10px" id="login_form">
<div class="panel-body" style="padding-bottom: 0;">
<form class="textbox" id="login_form">
<div class="control-group">
<table id="userLoginTable">
<tbody>
<tr>
<th style="width: 200px;">${basic_username}</th>
<td>
<td style="margin-top: 15px;">
<div class="controls">
<input type="text"
size="35"
style="margin-bottom: 15px;"
id="bt_login_user"
placeholder="${basic_placeholder_username}"
minlength="3" data-validation-minlength-message="${basic_username_short}"
@ -24,12 +23,12 @@
</td>
</tr>
<tr>
<th>${basic_password}</th>
<th style="padding-top: 0;">${basic_password}</th>
<td>
<div class="controls">
<input type="password"
size="35"
style="margin-bottom: 15px;"
style="margin-bottom: 15px; margin-top: 15px;"
id="bt_login_password"
placeholder="${basic_placeholder_password}"
minlength="5" data-validation-minlength-message="${basic_password_short}"
@ -39,18 +38,25 @@
</td>
</tr>
<tr>
<th>
<th style="padding-top: 10px;">
<p style="float: left;"><a href="#!register">Register an Account</a></p>
</th>
<td>
<td>
<p style="float: right;">
<button class="btn-sm btn btn-success" style="clear: left; height: 32px; font-size: 13px;" type="submit" id="login_submit"><span class="glyphicon glyphicon-log-in" aria-hidden="true"></span> ${basic_login}</button>
</p>
</td>
</td>
</tr>
<tr>
<th>
<p class="help-block" style="float: left; margin-top: 3px;"></p>
</th>
<td>
<p style="float: right;"><a href="#!resetpassword">Forgot your Password?</a></p>
</td>
</tr>
</tbody>
</table>
<p class="help-block" style="float: left; margin-top: 3px;"></p>
</div>
</form>
</div>

View File

@ -0,0 +1,2 @@
<?php
\SYSTEM\autoload::registerFolder(dirname(__FILE__));

View File

@ -0,0 +1,14 @@
<?php
class default_resetpassword implements \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_resetpassword/js/default_resetpassword.js'));}
public static function css() {return array();}
public function html(){
$vars = \SYSTEM\PAGE\text::tag('mojotrollz');
return \SYSTEM\PAGE\replace::replaceFile((new PPAGE('default_resetpassword/tpl/default_resetpassword.tpl'))->SERVERPATH(), $vars);
}
}

View File

@ -0,0 +1,11 @@
function init_resetpassword(){
$('#btn_resetpassword').click(function(){
system.account_reset_password($('#input_resetpassword').val(),function(data){
if(data.status){
$('.help-block').html('EMail sent.');
} else {
$('.help-block').html(data.result.message);
}
});
});
}

View File

@ -0,0 +1,35 @@
<div class="row-fluid">
<br><br>
<div class="col-md-6 col-md-offset-3">
<div class="panel panel-primary">
<div class="panel-heading"><h4>Mojotrollz - Reset Password</h4></div>
<div class="panel-body" style="padding-bottom: 0;">
<table id="userLoginTable"> <!-- style="margin-left: 20px;" -->
<tbody>
<tr>
<th style="width: 200px;">${basic_username} or ${basic_email}</th>
<td style="margin-top: 15px;">
<input type="text"
size="35"
style="margin-bottom: 15px;"
id="input_resetpassword"
placeholder="${basic_placeholder_username}"/>
</td>
</tr>
<tr>
<th style="padding-top: 10px;">
<p style="float: left;"><a href="#!register">Register an Account</a></p>
</th>
<td>
<p style="float: right;">
<button class="btn-sm btn btn-primary" style="clear: left; height: 32px; font-size: 13px;" id="btn_resetpassword"><span class="glyphicon glyphicon-envelope" aria-hidden="true"></span>&nbsp;&nbsp;Reset password</button>
</p>
</td>
</tr>
</tbody>
</table>
<p class="help-block" style="float: left; margin-top: 3px;"></p>
</div>
</div>
</div>
</div>

View File

@ -34,6 +34,9 @@ class page_mojotrollz extends \SYSTEM\API\api_default {
public static function page_register(){
return (new default_register())->html();}
public static function page_resetpassword(){
return (new default_resetpassword())->html();}
public static function page_account_website(){
return (new account_website())->html();}

View File

@ -5,6 +5,8 @@ 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 (19, 1, 'resetpassword', 'resetpassword', -1, 0, 0, '#content', './?page=resetpassword', 'init_resetpassword', 'default_resetpassword');
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');

View File

@ -34,6 +34,7 @@ REPLACE INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_password_old', 'mojo
REPLACE INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_change_password', 'mojotrollz');
REPLACE INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_change_email', 'mojotrollz');
REPLACE INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_email_new', 'mojotrollz');
REPLACE INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_email', 'mojotrollz');
REPLACE INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('link_facebook', 'enUS', 'https://www.facebook.com/mojotrollz/', 10, 10, '2015-09-17 23:16:50', '2015-09-17 23:16:50');
REPLACE INTO `system_text_tag` (`id`, `tag`) VALUES ('link_facebook', 'link');