| @@ -14,6 +14,8 @@ | |||||
| - 1337hamburg@gmail.com | - 1337hamburg@gmail.com | ||||
| - d.knudsen@spawntree.de | - d.knudsen@spawntree.de | ||||
| - UPDATE `account` SET `pass`='aa47377bfef0917b6ff2e73ece5a6952d7763664' WHERE 1 | - 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: | Neuinstallation: | ||||
| - cd .docker | - cd .docker | ||||
| @@ -406,7 +406,14 @@ app.core.Dict = { | |||||
| "CONTINUE_TO_PROBUDDY" : "Weiter", | "CONTINUE_TO_PROBUDDY" : "Weiter", | ||||
| "REGISTRATION_INCOMPLETE" : "Validierung fehlgeschlagen.", | "REGISTRATION_INCOMPLETE" : "Validierung fehlgeschlagen.", | ||||
| "REGISTRATION_INCOMPLETE_INFO" : "Bitte melde dich beim ProBuddy Support Team.", | "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.", | "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_FIRSTNAME" : "Vorname", | ||||
| "LOGIN_LASTNAME" : "Nachname", | "LOGIN_LASTNAME" : "Nachname", | ||||
| @@ -14,6 +14,7 @@ app.state.AuthLogin = function() | |||||
| var $authContent = app.core.View.getAuthContent(), | var $authContent = app.core.View.getAuthContent(), | ||||
| redirect = app.core.Controller.getGetParam( "redirect" ), | redirect = app.core.Controller.getGetParam( "redirect" ), | ||||
| theme = p.hasOwnProperty( 'theme' ) ? p.theme : null, | theme = p.hasOwnProperty( 'theme' ) ? p.theme : null, | ||||
| validatationEmail = ""; | |||||
| bgImg = null; | bgImg = null; | ||||
| switch( theme ) | 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="btn-back-to-login"]' ).first().click( function() | ||||
| { | { | ||||
| $authContent.find( '[data-id="section-not-validated"]' ).first().hide(); | $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(); | $authContent.find( '[data-id="section-login"]' ).first().show(); | ||||
| }); | }); | ||||
| @@ -69,7 +73,14 @@ app.state.AuthLogin = function() | |||||
| res.error === 'not_validated' ) | res.error === 'not_validated' ) | ||||
| { | { | ||||
| $authContent.find( '[data-id="section-login"]' ).first().hide(); | $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"]' ).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 | else | ||||
| { | { | ||||
| @@ -115,6 +126,37 @@ app.state.AuthLogin = function() | |||||
| return false; | 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(); | app.gui.PageLoader.hide(); | ||||
| }; | }; | ||||
| @@ -66,6 +66,7 @@ app.state.AuthStartJoin = function() | |||||
| app.gui.PageLoader.hide(); | app.gui.PageLoader.hide(); | ||||
| $authContent.find( '[data-id="section-form-join"]' ).first().hide(); | $authContent.find( '[data-id="section-form-join"]' ).first().hide(); | ||||
| $authContent.find( '[data-id="section-validation-info"]' ).first().show(); | $authContent.find( '[data-id="section-validation-info"]' ).first().show(); | ||||
| $authContent.find( '[data-id="validation-registered-email"]' ).html(res.email); | |||||
| } | } | ||||
| } | } | ||||
| ); | ); | ||||
| @@ -70,4 +70,41 @@ | |||||
| </button> | </button> | ||||
| </div> | </div> | ||||
| </form> | </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> | </section> | ||||
| @@ -102,6 +102,11 @@ | |||||
| <p class="text-center"> | <p class="text-center"> | ||||
| <%=raw _lc( 'REGISTER_SUCCESS_HEADER_DESCRIPTION' ) %> | <%=raw _lc( 'REGISTER_SUCCESS_HEADER_DESCRIPTION' ) %> | ||||
| </p> | </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"> | <p class="text-center"> | ||||
| <a href="#/auth/login"><%= _lc( 'BACK_TO_LOGIN' ) %></a> | <a href="#/auth/login"><%= _lc( 'BACK_TO_LOGIN' ) %></a> | ||||
| </p> | </p> | ||||
| @@ -4,7 +4,7 @@ | |||||
| ********************************************************************************/ | ********************************************************************************/ | ||||
| // General | // General | ||||
| Francis_Utils_Config::set( 'url.client', 'src/client/app/' ); | |||||
| Francis_Utils_Config::set( 'url.client', 'src/client/app' ); | |||||
| // DB settings | // DB settings | ||||
| Francis_Utils_Config::set( 'db.tbcore.host', 'database' ); | Francis_Utils_Config::set( 'db.tbcore.host', 'database' ); | ||||
| @@ -50,6 +50,7 @@ class TB_Server_Control_Auth | |||||
| 'url' => TB_Server_Utils_Config::get( 'url.client' ) . '/#/auth/validate-email/' . $ad->token | 'url' => TB_Server_Utils_Config::get( 'url.client' ) . '/#/auth/validate-email/' . $ad->token | ||||
| )); | )); | ||||
| $resp->addData( 'error', 'not_validated' ); | $resp->addData( 'error', 'not_validated' ); | ||||
| $resp->addData( 'email', $account->email ); | |||||
| return $resp; | return $resp; | ||||
| } | } | ||||
| @@ -111,6 +112,43 @@ class TB_Server_Control_Auth | |||||
| return $resp; | 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 | * @param TB_Server_Core_RequestData $params | ||||
| * @return TB_Server_Core_Response | * @return TB_Server_Core_Response | ||||
| @@ -151,6 +189,8 @@ class TB_Server_Control_Auth | |||||
| $email = $params->get( 'email' ); | $email = $params->get( 'email' ); | ||||
| $email = TB_Shared_Utils_Validator::isValidEmail( $email ) ? $email : NULL; | $email = TB_Shared_Utils_Validator::isValidEmail( $email ) ? $email : NULL; | ||||
| $resp->addData( 'email', $email ); | |||||
| if ( is_null( $email ) ) | if ( is_null( $email ) ) | ||||
| { | { | ||||
| throw new Exception( 'Invalid email' ); | throw new Exception( 'Invalid email' ); | ||||
| @@ -141,7 +141,8 @@ class TB_Server_Core_Notification | |||||
| // Notify | // Notify | ||||
| $headline = "Neues Mitglied"; | $headline = "Neues Mitglied"; | ||||
| $message = "Ein neues Mitglied ist deiner Gruppe beigetreten."; | $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( | self::sendToProfiles( | ||||
| $headline, | $headline, | ||||
| $message, | $message, | ||||