ソースを参照

wip new register process

master
Daniel 2年前
コミット
06489ef564
10個のファイルの変更133549行の追加3行の削除
  1. +2
    -0
      README.md
  2. +133411
    -0
      pbserver-log.txt
  3. +8
    -1
      src/client/app/js/app/core/Dict.js
  4. +42
    -0
      src/client/app/js/app/state/AuthLogin.js
  5. +1
    -0
      src/client/app/js/app/state/AuthStartJoin.js
  6. +37
    -0
      src/client/app/tmpl/auth-login.html
  7. +5
    -0
      src/client/app/tmpl/auth-start-join.html
  8. +1
    -1
      src/server/server/config/boot_local.php
  9. +40
    -0
      src/server/server/control/TB_Server_Control_Auth.php
  10. +2
    -1
      src/server/server/core/TB_Server_Core_Notification.php

+ 2
- 0
README.md ファイルの表示

@@ -14,6 +14,8 @@
- 1337hamburg@gmail.com
- d.knudsen@spawntree.de
- UPDATE `account` SET `pass`='aa47377bfef0917b6ff2e73ece5a6952d7763664' WHERE 1
- in den Container wcchseln: docker exec -it pb-php /bin/bash
- Validation-link: http://localhost:8097/client/app//#/auth/validate-email/dGm4XsJy0dp7gPnkgnKNzlgrUKh5M9pE

Neuinstallation:
- cd .docker


+ 133411
- 0
pbserver-log.txt
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 8
- 1
src/client/app/js/app/core/Dict.js ファイルの表示

@@ -406,7 +406,14 @@ app.core.Dict = {
"CONTINUE_TO_PROBUDDY" : "Weiter",
"REGISTRATION_INCOMPLETE" : "Validierung fehlgeschlagen.",
"REGISTRATION_INCOMPLETE_INFO" : "Bitte melde dich beim ProBuddy Support Team.",
"ACCOUNT_NOT_VALIDATED" : "Email nocht nicht validiert!",
"REGISTRATION_EMAIL_PROVIDED" : "Du hast dich mit folgender Emailadresse registriert:",
"REGISTRATION_SUCCESS_EMAIL_CHECK_NOTE" : "Bitte prüfe, ob du die Emailadresse korrekt eingetragen hast bzw. ob es auch die richtige Emailadresse ist! Sollte die Emailadresse nicht korrekt sein, logge dich erneut mit der nicht korrekten Emailadresse ein. Nach dem Login hast die die Möglichkeit die Emailadresse zu ändern.",
"REGISTRATION_EMAIL_CHECK_NOTE" : "Bitte prüfe, ob du die Emailadresse korrekt eingetragen hast bzw. ob es auch die richtige Emailadresse ist!",
"REGISTRATION_EMAIL_CHANGE_NOTE" : "Du hast hier die Möglichkeit deine, noch nicht validierte, Emailadresse zu ändern. Wenn du deine Emailadresse geändert hast, versuche dich mit deiner neuen Emailadresse einzuloggen. Danach wirst du eine neue Verifizierungs-Email erhalten.",
"REGISTRATION_EMAIL_CHANGE_BTN" : "Email ändern",
"REGISTRATION_EMAIL_CHANGED_SUCCESS" : "Deine Emailadresse wurde erfolgreich geändert.",
"REGISTRATION_EMAIL_CHANGED_SUCCESS_INFO" : "Deine Emailadresse wurde erfolgreich geändert. Gehe nun zurück zum Login und versuche nun dich mit deiner neuen Emailadresse einzuloggen, um eine neue Verifizierungsmail zu erhalten.",
"ACCOUNT_NOT_VALIDATED" : "Email noch nicht validiert!",
"ACCOUNT_NOT_VALIDATED_DESCRIPTION" : "Bitte validiere zunächst deine Email Adresse. Wir haben dir gerade erneut einen Validierungslink per Mail zugeschickt. Bitte schau in deinem Postfach nach (ggf. auch im Spam-Ordner) und klicke auf den Button.",
"LOGIN_FIRSTNAME" : "Vorname",
"LOGIN_LASTNAME" : "Nachname",


+ 42
- 0
src/client/app/js/app/state/AuthLogin.js ファイルの表示

@@ -14,6 +14,7 @@ app.state.AuthLogin = function()
var $authContent = app.core.View.getAuthContent(),
redirect = app.core.Controller.getGetParam( "redirect" ),
theme = p.hasOwnProperty( 'theme' ) ? p.theme : null,
validatationEmail = "";
bgImg = null;
switch( theme )
@@ -43,6 +44,9 @@ app.state.AuthLogin = function()
$authContent.find( '[data-id="btn-back-to-login"]' ).first().click( function()
{
$authContent.find( '[data-id="section-not-validated"]' ).first().hide();
$authContent.find( '[data-id="section-not-validated-change-email"]' ).first().hide();
$authContent.find( '[data-id="auth-change-registered-email-info"]' ).first().hide();
$authContent.find( '[data-id="auth-change-registered-email-info-changed"]' ).first().hide();
$authContent.find( '[data-id="section-login"]' ).first().show();
});
@@ -69,7 +73,14 @@ app.state.AuthLogin = function()
res.error === 'not_validated' )
{
$authContent.find( '[data-id="section-login"]' ).first().hide();
$authContent.find( '[data-id="form-not-validated-email-change"]' ).first().show();
$authContent.find( '[data-id="section-not-validated"]' ).first().show();
$authContent.find( '[data-id="section-not-validated-change-email"]' ).first().show();
$authContent.find( '[data-id="auth-change-registered-email-info"]' ).first().show();
$authContent.find( '[data-id="auth-change-registered-email-info-changed"]' ).first().hide();
$authContent.find( '[data-id="auth-change-registered-email"]' ).html(res.email);
$authContent.find( '[data-id="input-change-email"]' ).html("");
validatationEmail = res.email;
}
else
{
@@ -115,6 +126,37 @@ app.state.AuthLogin = function()
return false;
});
$authContent.find( '[data-id="btn-not-validated-email-change"]' ).first().click( function() {
let $form = $authContent.find('[data-id="form-not-validated-email-change"]').first(),
isValid = app.util.Form.bootstrapValidate($form),
newEmail = $form.find( '[data-id="input-change-email"]' ).first().val();
if (isValid) {
app.core.Rpc.call(
'Auth',
'changeNotValidatedEmail',
{
currentEmail: validatationEmail,
newEmail : newEmail,
},
function( res )
{
validatationEmail = newEmail;
$authContent.find( '[data-id="auth-change-registered-email-info"]' ).first().hide();
$authContent.find( '[data-id="form-not-validated-email-change"]' ).first().hide();
$authContent.find( '[data-id="auth-change-registered-email-info-changed"]' ).first().show();
$authContent.find( '[data-id="auth-change-registered-email"]' ).html(newEmail);
app.core.View.toastSuccess( _lc( 'REGISTRATION_EMAIL_CHANGED_SUCCESS' ) );
},
function( err, code )
{
}
);
}
});
app.gui.PageLoader.hide();
};


+ 1
- 0
src/client/app/js/app/state/AuthStartJoin.js ファイルの表示

@@ -66,6 +66,7 @@ app.state.AuthStartJoin = function()
app.gui.PageLoader.hide();
$authContent.find( '[data-id="section-form-join"]' ).first().hide();
$authContent.find( '[data-id="section-validation-info"]' ).first().show();
$authContent.find( '[data-id="validation-registered-email"]' ).html(res.email);
}
}
);


+ 37
- 0
src/client/app/tmpl/auth-login.html ファイルの表示

@@ -70,4 +70,41 @@
</button>
</div>
</form>
</section>
<section data-id="section-not-validated-change-email"
style="display: none;">
<div data-id="auth-change-email">
<div class="auth-change-email">
<p><%=raw _lc( 'REGISTRATION_EMAIL_PROVIDED' ) %></p>
<div data-id="auth-change-registered-email" class="font-bold"></div>
<div data-id="auth-change-registered-email-info">
<p><%=raw _lc( 'REGISTRATION_EMAIL_CHECK_NOTE' ) %></p>
<p><%=raw _lc( 'REGISTRATION_EMAIL_CHANGE_NOTE' ) %></p>
</div>
<div data-id="auth-change-registered-email-info-changed" class="pb_color-danger">
<p><%=raw _lc( 'REGISTRATION_EMAIL_CHANGED_SUCCESS_INFO' ) %></p>
</div>
<form data-id="form-not-validated-email-change"
class="bg-white rounded pb_form_v1 form-auth-login needs-validation"
novalidate>
<label for="input-change-email"
data-id=""
class="sr-only">
<%= _lc( 'LOGIN_EMAIL' ) %>
</label>
<input type="email"
id="input-change-email"
data-id="input-change-email"
class="form-control reverse pb_height-50"
placeholder="<%= _lc( 'LOGIN_EMAIL' ) %>"
required autofocus />
<button class="btn btn-lg btn-primary btn-block"
data-id="btn-not-validated-email-change"
type="button">
<%= _lc( 'REGISTRATION_EMAIL_CHANGE_BTN' ) %>
</button>
</form>
</div>
</div>
</section>

+ 5
- 0
src/client/app/tmpl/auth-start-join.html ファイルの表示

@@ -102,6 +102,11 @@
<p class="text-center">
<%=raw _lc( 'REGISTER_SUCCESS_HEADER_DESCRIPTION' ) %>
</p>
<p>
<%=raw _lc( 'REGISTRATION_EMAIL_PROVIDED' ) %>
<div data-id="validation-registered-email" class="font-bold"></div>
<%=raw _lc( 'REGISTRATION_SUCCESS_EMAIL_CHECK_NOTE' ) %>
</p>
<p class="text-center">
<a href="#/auth/login"><%= _lc( 'BACK_TO_LOGIN' ) %></a>
</p>


+ 1
- 1
src/server/server/config/boot_local.php ファイルの表示

@@ -4,7 +4,7 @@
********************************************************************************/
// General
Francis_Utils_Config::set( 'url.client', 'src/client/app/' );
Francis_Utils_Config::set( 'url.client', 'src/client/app' );
// DB settings
Francis_Utils_Config::set( 'db.tbcore.host', 'database' );


+ 40
- 0
src/server/server/control/TB_Server_Control_Auth.php ファイルの表示

@@ -50,6 +50,7 @@ class TB_Server_Control_Auth
'url' => TB_Server_Utils_Config::get( 'url.client' ) . '/#/auth/validate-email/' . $ad->token
));
$resp->addData( 'error', 'not_validated' );
$resp->addData( 'email', $account->email );
return $resp;
}
@@ -111,6 +112,43 @@ class TB_Server_Control_Auth
return $resp;
}
public static function changeNotValidatedEmail( TB_Server_Core_RequestData $params ) {
// Return value
$resp = new TB_Server_Core_Response();
// Validate params
$newEmail = $params->get( 'newEmail' );
$currentEmail = $params->get( 'currentEmail' );
$newEmail = TB_Shared_Utils_Validator::isValidEmail( $newEmail ) ? $newEmail : NULL;
$currentEmail = TB_Shared_Utils_Validator::isValidEmail( $currentEmail ) ? $currentEmail : NULL;
if ( is_null( $newEmail ) || is_null($currentEmail) )
{
throw new Exception( 'Invalid email' );
}
$account = TB_Shared_Ent_Core_Account::getByEmail( $currentEmail );
if ( is_null( $account ) )
{
throw new Exception( 'account not found' );
}
$existingAccount = TB_Shared_Ent_Core_Account::getByEmail( $newEmail );
if ( !is_null( $existingAccount ) )
{
throw new Exception( 'account with this new email exists already' );
}
if ($account->is_validated) {
throw new Exception( 'account already validated' );
}
$account->email = $newEmail;
$account->save();
return $resp;
}
/**
* @param TB_Server_Core_RequestData $params
* @return TB_Server_Core_Response
@@ -151,6 +189,8 @@ class TB_Server_Control_Auth
$email = $params->get( 'email' );
$email = TB_Shared_Utils_Validator::isValidEmail( $email ) ? $email : NULL;
$resp->addData( 'email', $email );
if ( is_null( $email ) )
{
throw new Exception( 'Invalid email' );


+ 2
- 1
src/server/server/core/TB_Server_Core_Notification.php ファイルの表示

@@ -141,7 +141,8 @@ class TB_Server_Core_Notification
// Notify
$headline = "Neues Mitglied";
$message = "Ein neues Mitglied ist deiner Gruppe beigetreten.";
$additionalData = self::createAdditionalData( '#/profile/' . $profile->id );
$additionalData = self::createAdditionalData( '#/group/' . $team->id . '/membermanagement' );
//$additionalData = self::createAdditionalData( '#/profile/' . $profile->id );
self::sendToProfiles(
$headline,
$message,


読み込み中…
キャンセル
保存