Permalink
Browse files

Merge branch 'release/6.7.x' into develop

  • Loading branch information...
2 parents c78d85f + 8375c87 commit dec9cef164e9f9b3de1d16afe54cdc8eb5121610 @fplanque fplanque committed Nov 17, 2016
View
@@ -59,7 +59,7 @@
{
if( $current_User->check_status( 'can_be_validated' ) )
{ // redirect back to the login page
- $action = 'req_validatemail';
+ $action = 'req_activate_email';
require $htsrv_path.'login.php';
}
else
View
@@ -42,7 +42,7 @@
switch( $action )
{
case 'logout':
- // log out the current user:
+ // Log the current user out:
logout(); // logout $Session and set $current_User = NULL
@@ -111,7 +111,8 @@
break;
case 'resetpassword':
- // Send password change request by mail
+ // Send password reset request by email:
+
global $servertimenow;
$login_required = true; // Do not display "Without login.." link on the form
@@ -187,9 +188,6 @@
break;
}
- // echo 'email: ', $forgetful_User->email;
- // echo 'locale: '.$forgetful_User->locale;
-
locale_temp_switch( $forgetful_User->locale );
if( $demo_mode )
@@ -259,7 +257,7 @@
case 'changepwd':
- // Clicked "Reset password NOW" link from an password request email:
+ // User clicked "Reset password NOW" link from an password reset email:
param( 'reqID', 'string', '' );
@@ -310,7 +308,7 @@
case 'updatepwd':
- // Update password (The submit action of the above reset password form):
+ // User is updating his password (submit action of the above reset password form):
param( 'reqID', 'string', '' );
@@ -356,8 +354,8 @@
break;
- case 'activateaccount':
- // Clicked link to activate account from an account activation reminder email:
+ case 'activateacc_ez':
+ // User clicked 'Activate NOW' or 'Reactivate NOW' from an account activation email with EASY activation process (first email or reminder):
// Stop a request from the blocked IP addresses or Domains
antispam_block_request();
@@ -390,7 +388,7 @@
elseif( empty( $last_reminder_key ) || ( $last_reminder_key != $reminder_key ) )
{ // the reminder key in db is empty or not equal with the received one
$Messages->add( T_('Invalid account activation request!'), 'error' );
- $action = 'req_validatemail';
+ $action = 'req_activate_email';
break;
}
@@ -405,8 +403,9 @@
/* exited */
break;
- case 'validatemail':
- // Clicked "Validate email" link from an email:
+ case 'activateacc_sec':
+ // User clicked 'Activate NOW' or 'Reactivate NOW' from an account activation email with SECURE activation process (first email or reminder):
+ // fp> NOTE: I am not sure secure process works allows reminders.
// Stop a request from the blocked IP addresses or Domains
antispam_block_request();
@@ -416,34 +415,34 @@
if( check_user_status( 'is_validated' ) )
{ // Already validated, e.g. clicked on an obsolete email link:
- $Messages->add( T_('Your email address has already been validated.'), 'note' );
+ $Messages->add( T_('Your account has already been activated.'), 'note' );
// no break: cleanup & redirect below
}
else
{
// Check valid format:
if( empty($reqID) )
{ // This was not requested
- $Messages->add( T_('Invalid email address validation request!'), 'error' );
- $action = 'req_validatemail';
+ $Messages->add( T_('Invalid account activation request!'), 'error' );
+ $action = 'req_activate_email';
break;
}
// Check valid session (format only, meant as help for the user):
if( $sessID != $Session->ID )
{ // Another session ID than for requesting account validation link used!
$Messages->add( T_('You have to use the same session (by means of your session cookie) as when you have requested the action. Please try again...'), 'error' );
- $action = 'req_validatemail';
+ $action = 'req_activate_email';
break;
}
// Validate provided reqID against the one stored in the user's session
- $request_ids = $Session->get( 'core.validatemail.request_ids' );
+ $request_ids = $Session->get( 'core.activateacc.request_ids' );
if( ( ! is_array($request_ids) || ! in_array( $reqID, $request_ids ) )
&& ! ( isset($current_User) && $current_User->grp_ID == 1 && $reqID == 1 /* admin users can validate themselves by a button click */ ) )
{
- $Messages->add( T_('Invalid email address validation request!'), 'error' );
- $action = 'req_validatemail';
+ $Messages->add( T_('Invalid account activation request!'), 'error' );
+ $action = 'req_activate_email';
$login_required = true; // Do not display "Without login.." link on the form
break;
}
@@ -452,22 +451,22 @@
{ // this can happen, if a new user registers and clicks on the "validate by email" link, without logging in first
// Note: we reuse $reqID and $sessID in the form to come back here.
- $Messages->add( T_('Please login to validate your account.'), 'error' );
+ $Messages->add( T_('Please log in to activate your account.'), 'error' );
break;
}
// activate user account
$current_User->activate_from_Request();
- $Messages->add( T_( 'Your email address has been validated.' ), 'success' );
+ $Messages->add( T_( 'Your account is now activated.' ), 'success' );
}
// init redirect_to
$redirect_to = redirect_after_account_activation();
// Cleanup:
- $Session->delete('core.validatemail.request_ids');
- $Session->delete('core.validatemail.redirect_to');
+ $Session->delete('core.activateacc.request_ids');
+ $Session->delete('core.activateacc.redirect_to');
// redirect Will save $Messages into Session:
header_redirect( $redirect_to );
@@ -481,8 +480,9 @@
/* For actions that other delegate to from the switch above: */
switch( $action )
{
- case 'req_validatemail':
- // Send activation link by email (initial form and action)
+ case 'req_activate_email':
+ // User wants to request a new activation link by email (initial form and action):
+
if( ! is_logged_in() )
{
$Messages->add( T_('You have to be logged in to request an account validation link.'), 'error' );
@@ -496,10 +496,10 @@
break;
}
- param( 'req_validatemail_submit', 'integer', 0 ); // has the form been submitted
+ param( 'req_activate_email_submit', 'integer', 0 ); // has the form been submitted
$email = utf8_strtolower( param( $dummy_fields['email'], 'string', $current_User->email ) ); // the email address is editable
- if( $req_validatemail_submit )
+ if( $req_activate_email_submit )
{ // Form has been submitted
param_check_email( $dummy_fields['email'], true );
@@ -526,7 +526,7 @@
}
}
- // Call plugin event to allow catching input in general and validating own things from DisplayRegisterFormFieldset event
+ // Call plugin event to allow catching input in general and validating own things from DisplayRegisterFormFieldset event:
$Plugins->trigger_event( 'ValidateAccountFormSent' );
if( $Messages->has_errors() )
@@ -547,30 +547,30 @@
$inskin_blog = $inskin ? $blog : NULL;
if( $current_User->send_validate_email( $redirect_to, $inskin_blog, $email_changed ) )
{
- $Messages->add( sprintf( /* TRANS: %s gets replaced by the user's email address */ T_('An email has been sent to your email address (%s). Please click on the link therein to validate your account.'), $current_User->dget('email') ), 'success' );
+ $Messages->add( sprintf( /* TRANS: %s gets replaced by the user's email address */ T_('An email has been sent to your email address (%s). Please click on the link therein to activate your account.'), $current_User->dget('email') ), 'success' );
}
elseif( $demo_mode )
{
$Messages->add( 'Sorry, could not send email. Sending email in demo mode is disabled.', 'error' );
}
else
{
- $Messages->add( T_('Sorry, the email with the link to validate and activate your password could not be sent.')
+ $Messages->add( T_('Sorry, the email with the link to activate your account could not be sent.')
.'<br />'.T_('Possible reason: the PHP mail() function may have been disabled on the server.'), 'error' );
}
}
else
{ // Form not yet submitted:
// Add a note, if we have already sent validation links:
- $request_ids = $Session->get( 'core.validatemail.request_ids' );
+ $request_ids = $Session->get( 'core.activateacc.request_ids' );
if( is_array($request_ids) && count($request_ids) )
{
- $Messages->add( sprintf( T_('We have already sent you %d email(s) with a validation link.'), count($request_ids) ), 'note' );
+ $Messages->add( sprintf( T_('We have already sent you %d email(s) with an activation link.'), count($request_ids) ), 'note' );
}
if( empty($current_User->email) )
{ // add (error) note to be displayed in the form
- $Messages->add( T_('You have no email address with your profile, therefore we cannot validate it. Please give your email address below.'), 'error' );
+ $Messages->add( T_('Your user account has no associated email address; therefore we cannot activate it. Please provide your email address below.'), 'error' );
}
}
break;
@@ -619,8 +619,8 @@
{
$redirect_to = $Blog->gen_blogurl();
}
- // check if action was req_validatemail
- if( ( $action == 'req_validatemail' ) && !empty( $current_User ) )
+ // check if action was req_activate_email
+ if( ( $action == 'req_activate_email' ) && !empty( $current_User ) )
{ // redirect to inskin activate account page
$redirect = url_add_param( $Blog->gen_blogurl(), 'disp=activateinfo', '&' );
if( $Messages->has_errors() )
@@ -647,8 +647,9 @@
}
}
+
/**
- * Display standard login screen:
+ * Display one of the standard login management screens:
*/
switch( $action )
{
@@ -682,17 +683,17 @@
require $adminskins_path.'login/_html_footer.inc.php';
break;
- case 'req_validatemail':
+ case 'changepwd':
+ // Display form to reset password: (after 'lostpassword' form has been submitted and email has been received+clicked)
+ require $adminskins_path.'login/_reset_pwd_form.main.php';
+ break;
+
+ case 'req_activate_email':
// Send activation link by email (initial form and action)
// Display validation form:
require $adminskins_path.'login/_validate_form.main.php';
break;
- case 'changepwd':
- // Display form to change password:
- require $adminskins_path.'login/_reset_pwd_form.main.php';
- break;
-
default:
// Display login form:
@@ -432,7 +432,7 @@ function get_request_title( $params = array() )
'contacts_text' => T_('Contacts'),
'login_text' => /* TRANS: trailing space = verb */ T_('Login '),
'register_text' => T_('Register'),
- 'req_validatemail' => T_('Account activation'),
+ 'req_activate_email' => T_('Account activation'),
'account_activation' => T_('Account activation'),
'lostpassword_text' => T_('Lost your password?'),
'profile_text' => T_('User Profile'),
@@ -597,9 +597,9 @@ function get_request_title( $params = array() )
case 'login':
// We are requesting the login form:
- if( $action == 'req_validatemail' )
+ if( $action == 'req_activate_email' )
{
- $r[] = $params['req_validatemail'];
+ $r[] = $params['req_activate_email'];
}
else
{
@@ -2343,7 +2343,7 @@ function display_login_form( $params )
if( $params['display_abort_link']
&& empty( $params['login_required'] )
- && $params['action'] != 'req_validatemail'
+ && $params['action'] != 'req_activate_email'
&& strpos( $return_to, $admin_url ) !== 0
&& strpos( $ReqHost.$return_to, $admin_url ) !== 0 )
{ // No login required, allow to pass through
@@ -2421,9 +2421,9 @@ function display_login_form( $params )
}
$Form->hidden( 'validate_required', $params[ 'validate_required' ] );
- if( isset( $params[ 'action' ], $params[ 'reqID' ], $params[ 'sessID' ] ) && $params[ 'action' ] == 'validatemail' )
+ if( isset( $params[ 'action' ], $params[ 'reqID' ], $params[ 'sessID' ] ) && $params[ 'action' ] == 'activateacc_sec' )
{ // the user clicked the link from the "validate your account" email, but has not been logged in; pass on the relevant data:
- $Form->hidden( 'action', 'validatemail' );
+ $Form->hidden( 'action', 'activateacc_sec' );
$Form->hidden( 'reqID', $params[ 'reqID' ] );
$Form->hidden( 'sessID', $params[ 'sessID' ] );
}
@@ -2698,7 +2698,7 @@ function display_lostpassword_form( $login, $hidden_params, $params = array() )
echo '<li>'.T_('Please enter your login (or email address) above.').'</li>';
echo '<li>'.T_('An email will be sent to your registered email address immediately.').'</li>';
echo '<li>'.T_('As soon as you receive the email, click on the link therein to reset your password.').'</li>';
- echo '<li>'.T_('Your browser will open a page where you can chose a new password.').'</li>';
+ echo '<li>'.T_('Your browser will open a page where you can set a new password.').'</li>';
echo '</ol>';
echo '<p class="red"><strong>'.T_('Important: for security reasons, you must do steps 1 and 4 on the same computer and same web browser. Do not close your browser in between.').'</strong></p>';
@@ -2775,7 +2775,7 @@ function display_activateinfo( $params )
$Form->begin_form( $params[ 'form_class' ] );
$Form->add_crumb( 'validateform' );
- $Form->hidden( 'action', 'req_validatemail');
+ $Form->hidden( 'action', 'req_activate_email');
$Form->hidden( 'redirect_to', $params[ 'redirect_to' ] );
if( $params[ 'inskin' ] )
{
@@ -2786,7 +2786,7 @@ function display_activateinfo( $params )
{ // Form title in standard form
echo '<h4>'.$params['form_title'].'</h4>';
}
- $Form->hidden( 'req_validatemail_submit', 1 ); // to know if the form has been submitted
+ $Form->hidden( 'req_activate_email_submit', 1 ); // to know if the form has been submitted
$Form->begin_fieldset();
@@ -2885,7 +2885,7 @@ function display_activateinfo( $params )
$Form->begin_form( 'evo_form__login' );
$Form->add_crumb( 'validateform' );
- $Form->hidden( 'action', 'validatemail' );
+ $Form->hidden( 'action', 'activateacc_sec' );
$Form->hidden( 'redirect_to', url_rel_to_same_host( $redirect_to, get_htsrv_url( true ) ) );
$Form->hidden( 'reqID', 1 );
$Form->hidden( 'sessID', $Session->ID );
@@ -430,9 +430,9 @@
// Check if the user needs to be validated, but is not yet:
if( check_user_status( 'can_be_validated' ) // user is logged in but not validated and validation is required
&& $action != 'logout'
- && $action != 'req_validatemail' && $action != 'validatemail' && $validate_required )
+ && $action != 'req_activate_email' && $action != 'activateacc_sec' && $validate_required )
{ // we're not in that action already:
- $action = 'req_validatemail'; // for login.php
+ $action = 'req_activate_email'; // for login.php
if( $is_admin_page )
{
$login_error = T_('In order to access the admin interface, you must first activate your account by clicking on the activation link in the email we sent you. <b>See below:</b>');
@@ -747,7 +747,7 @@ function check_allow_disp( $disp )
}
$messages_content = $Messages->get_string( '', '', '', 'raw' );
- if( ( strstr( $messages_content, 'disp=activateinfo' ) !== false ) || ( strstr( $messages_content, 'action=req_validatemail' ) !== false ) )
+ if( ( strstr( $messages_content, 'disp=activateinfo' ) !== false ) || ( strstr( $messages_content, 'action=req_activate_email' ) !== false ) )
{ // If there is already a message to display activateinfo link, then don't add this message again
return;
}
@@ -1206,15 +1206,15 @@ function skin_init( $disp )
$after_email_validation = $Settings->get( 'after_email_validation' );
if( $after_email_validation == 'return_to_original' )
{ // we want to return to original page after account activation
- // check if Session 'validatemail.redirect_to' param is still set
- $redirect_to = $Session->get( 'core.validatemail.redirect_to' );
+ // check if Session 'activateacc.redirect_to' param is still set
+ $redirect_to = $Session->get( 'core.activateacc.redirect_to' );
if( empty( $redirect_to ) )
{ // Session param is empty try to get general redirect_to param
$redirect_to = param( 'redirect_to', 'url', '' );
}
else
{ // cleanup validateemail.redirect_to param from session
- $Session->delete('core.validatemail.redirect_to');
+ $Session->delete('core.activateacc.redirect_to');
}
}
else
Oops, something went wrong.

0 comments on commit dec9cef

Please sign in to comment.