Avatar

Version 2.4.17 - "Invalid request - please try again!" (General)

by Magma, Tuesday, January 08, 2019, 22:33 (1929 days ago)

I hit another problem since updating :-( This applies to guests or users using the admin contact form and for users who email each other through the forum

Guest or Users who have an obscure email address like for example one that ends with the domain .email they get an error when submitting the form

Error!

Invalid request - please try again!

Avatar

Version 2.4.17 - "Invalid request - please try again!"

by Auge ⌂, Wednesday, January 09, 2019, 07:53 (1928 days ago) @ Magma

Hello

I hit another problem since updating :-( This applies to guests or users using the admin contact form and for users who email each other through the forum

Guest or Users who have an obscure email address like for example one that ends with the domain .email they get an error when submitting the form

Error!

Invalid request - please try again!

Please look into the script contact.inc.php (on your server!) and compare the lines 91 (ff.) with the shown code. The line 92 contains the only one occurence of the language key for "Invalid request - please try again!" (error_invalid_form) in this script. If you'll find the key error_invalid_form somewhere around line 84 and not in line 92 please upload the schript contact.inc.php from the 2.4.17-archive to the server again.

Code up to version 2.4.16 starting with line 83:

if (empty($_SESSION[$settings['session_prefix'].'user_id'])) {
  if (empty($_SESSION[$settings['session_prefix'].'formtime'])) $errors[] = 'error_invalid_form';
  else {
    // several instructions
  }
}

Code of version 2.4.17, starting with line 91:

if (!isset($_SESSION[$settings['session_prefix'] . 'receipt_timestamp_difference']) || intval($_SESSION[$settings['session_prefix'] . 'receipt_timestamp_difference']) <= 0)
  $errors[] = 'error_invalid_form';
  else {
    // several instructions
  }
 

Tschö, Auge

--
Trenne niemals Müll, denn er hat nur eine Silbe!

Avatar

Version 2.4.17 - "Invalid request - please try again!"

by Magma, Wednesday, January 09, 2019, 12:35 (1928 days ago) @ Auge

If you'll find the key error_invalid_form somewhere around line 84 and not in line 92 please upload the schript contact.inc.php from the 2.4.17-archive to the server again.

I do find it in line 92?

On a separate note I continued doing some testing of 2.4.17, I created a couple of dummy registrations with gmail, yahoo and mail.com accounts and still after a few hours not received the activation email for them, not even in the spam folders.

Avatar

Version 2.4.17 - "Invalid request - please try again!"

by Auge ⌂, Wednesday, January 09, 2019, 12:44 (1928 days ago) @ Magma

Hello

If you'll find the key error_invalid_form somewhere around line 84 and not in line 92 please upload the schript contact.inc.php from the 2.4.17-archive to the server again.


I do find it in line 92?

Is that a question. Do you find it in line 92 or do you ask, what you should find there?

On a separate note I continued doing some testing of 2.4.17, I created a couple of dummy registrations with gmail, yahoo and mail.com accounts and still after a few hours not received the activation email for them, not even in the spam folders.

Ok, that's a point. We will investigate in the code and on our installations.

Tschö, Auge

--
Trenne niemals Müll, denn er hat nur eine Silbe!

Avatar

Version 2.4.17 - "Invalid request - please try again!"

by Magma, Wednesday, January 09, 2019, 12:54 (1928 days ago) @ Auge

Hello

If you'll find the key error_invalid_form somewhere around line 84 and not in line 92 please upload the schript contact.inc.php from the 2.4.17-archive to the server again.


I do find it in line 92?


Is that a question. Do you find it in line 92 or do you ask, what you should find there?

Sorry. Yes I do find that error_invalid_form in line 92.

Avatar

Version 2.4.17 - "Invalid request - please try again!"

by Auge ⌂, Wednesday, January 09, 2019, 13:01 (1928 days ago) @ Magma

Hello

line 92 [of] the schript contact.inc.php


I do find it in line 92?


Is that a question. Do you find it in line 92 or do you ask, what you should find there?


Sorry. Yes I do find that error_invalid_form in line 92.

:-)

Ok, so you are on 2.4.17 with the contact.inc.php. Micha assured to investigate the code further because he is well versed in the relevant code changes.

Tschö, Auge

--
Trenne niemals Müll, denn er hat nur eine Silbe!

Avatar

Version 2.4.17 - "Invalid request - please try again!"

by Micha ⌂, Wednesday, January 09, 2019, 18:29 (1928 days ago) @ Magma

Hi,

please modify the contact.inc.php file and add the missing function call: setReceiptTimestamp();.

  // check form session and time used to complete the form:
  setReceiptTimestamp(); // Missing function call!
  // if (empty($_SESSION[$settings['session_prefix'].'user_id'])) {
  if (!isset($_SESSION[$settings['session_prefix'] . 'receipt_timestamp_difference']) || intval($_SESSION[$settings['session_prefix'] . 'receipt_timestamp_difference']) <= 0)
   $errors[] = 'error_invalid_form';
  else {
   if ($_SESSION[$settings['session_prefix'] . 'receipt_timestamp_difference'] < $settings['min_email_time'])
    $errors[] = 'error_form_sent_too_fast';
   elseif ($_SESSION[$settings['session_prefix'] . 'receipt_timestamp_difference'] > $settings['max_email_time'])
    $errors[] = 'error_form_sent_too_slow';
  }

This, hopefully, solves the problem.

regards
Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

Tags:
bug, 2.4.17, contact

Avatar

Version 2.4.17 - "Invalid request …" solved, further problem

by Magma, Wednesday, January 09, 2019, 19:56 (1928 days ago) @ Micha

On testing this seems to have fixed the contact form thanks.

But my activation emails are still not getting sent :-(

Avatar

Version 2.4.17 - "Invalid request …" solved, further problem

by Micha ⌂, Wednesday, January 09, 2019, 20:23 (1928 days ago) @ Magma

On testing this seems to have fixed the contact form thanks.

Thank you for reporting. I close the branch.

But my activation emails are still not getting sent :-(

Can you register a new account here (in this forum)? (I can remove the account after the test!).

/Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

Avatar

Version 2.4.17 - registration not possible

by Magma, Wednesday, January 09, 2019, 23:40 (1928 days ago) @ Micha

But my activation emails are still not getting sent :-(


Can you register a new account here (in this forum)? (I can remove the account after the test!).

/Micha


I registered a new account here on mlf and got the email fine. I contacted my hosting service earlier today to see if they could help. Not at all sure why it would stop working after the update :lookaround:

Avatar

Version 2.4.17 - registration not possible

by Magma, Thursday, January 10, 2019, 02:36 (1927 days ago) @ Micha

My colleague emailed me to say he changed the main cpanel password. Would that mess up the automated emails going out?

Avatar

Version 2.4.17 - registration not possible

by Micha ⌂, Thursday, January 10, 2019, 07:45 (1927 days ago) @ Magma

Hi Magma,

My colleague emailed me to say he changed the main cpanel password. Would that mess up the automated emails going out?

No, I don't think so because the mail-function itself is equal in all cases (contact, registration, notification, etc).

Let's have a try: Can you replace the complete directory includes and subtemplates of your installed forum? Maybe, one file is missing or not up-to-date.

/Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

Avatar

Version 2.4.17 - registration not possible

by Magma, Thursday, January 10, 2019, 10:25 (1927 days ago) @ Micha

Hi Magma,

My colleague emailed me to say he changed the main cpanel password. Would that mess up the automated emails going out?


No, I don't think so because the mail-function itself is equal in all cases (contact, registration, notification, etc).

Let's have a try: Can you replace the complete directory includes and subtemplates of your installed forum? Maybe, one file is missing or not up-to-date.

/Micha

I replaced those two includes and subtemplates and still no email is sent :-(

Avatar

Version 2.4.17 - registration not possible

by Auge ⌂, Thursday, January 10, 2019, 07:54 (1927 days ago) @ Magma

Hello

My colleague emailed me to say he changed the main cpanel password. Would that mess up the automated emails going out?

You are you talking about the cPanel web hosting admin tool? If yes, then no. The change of the password for this tool should not cause the failed sending of e-mails in the forum.

Are you able to send an e-mail with the PHP mail-function at all with the following script?

<?php
 
$subject  = "Pipapo";
$content  = "This e-mail if for testing.";
$sender   = ""; // add the e-mail-address of the sender
$receiver = ""; // add the e-mail-address of the receiver
$headers  = "From: " . $sender . "\r\n";
$headers .= "Content-Type: text/plain; charset=UTF-8\r\n";
 
$returnValue = mail($receiver, $subject, $content);
 
if ($returnValue === false) {
 echo "E-mail could not be passed to the mail server program.";
} else {
 echo "E-mail was passed to the mail server program.";
}
 
?>

Tschö, Auge

--
Trenne niemals Müll, denn er hat nur eine Silbe!

Avatar

Version 2.4.17 - registration not possible

by Magma, Thursday, January 10, 2019, 10:33 (1927 days ago) @ Auge

Hello

My colleague emailed me to say he changed the main cpanel password. Would that mess up the automated emails going out?


You are you talking about the cPanel web hosting admin tool? If yes, then no. change of the password for this tool should not cause the failed sending of e-mails.

Yes the password to login to the cpanel.

Are you able to send an e-mail with the PHP mail-function at all with the following script?

<?php
 
$subject  = "Pipapo";
$content  = "This e-mail if for testing.";
$sender   = ""; // add the e-mail-address of the sender
$receiver = ""; // add the e-mail-address of the receiver
$headers  = "From: " . $sender . "\r\n";
$headers .= "Content-Type: text/plain; charset=UTF-8\r\n";
 
$returnValue = mail($receiver, $subject, $content);
 
if ($returnValue === false) {
echo "E-mail could not be passed to the mail server program.";
} else {
echo "E-mail was passed to the mail server program.";
}
 
?>

Tschö, Auge


Not sure how to do this, is that within the cpanel?

Avatar

Version 2.4.17 - registration not possible

by Auge ⌂, Thursday, January 10, 2019, 11:38 (1927 days ago) @ Magma

Hello

Yes the password to login to the cpanel.

O.k.

Are you able to send an e-mail with the PHP mail-function at all with the following script?

<?php
 
$subject  = "Pipapo";
$content  = "This e-mail if for testing.";
$sender   = ""; // add the e-mail-address of the sender
$receiver = ""; // add the e-mail-address of the receiver
$headers  = "From: " . $sender . "\r\n";
$headers .= "Content-Type: text/plain; charset=UTF-8\r\n";
 
$returnValue = mail($receiver, $subject, $content);
 
if ($returnValue === false) {
echo "E-mail could not be passed to the mail server program.";
} else {
echo "E-mail was passed to the mail server program.";
}
 
?>


Not sure how to do this, is that within the cpanel?

No, it's a simple PHP script, that should send an e-mail, when you call it in the browser. But the task is not necessary because you said that the unubscribing function was broken. If it was broken, the e-mail itself was sent and because of that, your server is generally able to send e-mails.

I would like to see the source code of the e-mail as it is generated by the function my_mail.

Tschö, Auge

--
Trenne niemals Müll, denn er hat nur eine Silbe!

Avatar

Version 2.4.17 - registration not possible

by Magma, Thursday, January 10, 2019, 12:05 (1927 days ago) @ Auge

What if I swap the functions.inc file on the server for the previous 2.4.8 file that I had before? then see if the activation email comes through

Is that possible, would that tell us anything? :lookaround:

Avatar

Version 2.4.17 - registration not possible

by Auge ⌂, Thursday, January 10, 2019, 13:31 (1927 days ago) @ Magma

What if I swap the functions.inc file on the server for the previous 2.4.8 file that I had before? then see if the activation email comes through

This might break the forum because of the lack of functions, that got introduced after 2.4.8. But with a backup of the file from 2.4.17 it would be a short way to acutualise the script again.

Is that possible, would that tell us anything? :lookaround:

In the case of a succeeding registration with the old script, it would tell us, that a change, made after the version 2.4.8 broke the function on your server.

Please bear in mind, that you was able to registrate a new account in this forum, that is running version 2.4.17, and to activate this account after receiving the e-mail. The registration process in itself works, here and also in my forum (two different hosting companies and web server).

Tschö, Auge

--
Trenne niemals Müll, denn er hat nur eine Silbe!

Avatar

Version 2.4.17 - registration not possible

by Micha ⌂, Thursday, January 10, 2019, 13:43 (1927 days ago) @ Magma

Hello,

Is that possible, would that tell us anything? :lookaround:

This isn't a good idea. The mail function itself works because you can confirmed that the contact-form works and you received notification mails etc. From a techniquel point of view, I cannot reproduce your issue.

If you like to test an older version of the forum, you should install the complete version (e.g. parallel to your existing system). But you should not mixing files from different versions.

/Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

Avatar

Version 2.4.17 - registration not possible

by Magma, Thursday, January 10, 2019, 14:05 (1927 days ago) @ Micha

I tried swapping the functions.inc and yes it went to an error page.

It's weird because the notifications emails are being sent out and the contact form is working. It is just the registering activation email is not being sent. Still waiting for the hosting company.

Can you tell me what files deal with sending out the activation email? is it just the functions.inc

Avatar

Version 2.4.17 - registration not possible

by Micha ⌂, Thursday, January 10, 2019, 14:25 (1927 days ago) @ Magma

Hello,

Can you tell me what files deal with sending out the activation email? is it just the functions.inc

Yes. In register.inc.php the function my_mail is called (if the option is enabled in your forum settings!). The my_mail is located in functions.inc.php.

/Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

Avatar

Version 2.4.17 - registration not possible

by Magma, Thursday, January 10, 2019, 21:27 (1927 days ago) @ Micha

Hello,

Can you tell me what files deal with sending out the activation email? is it just the functions.inc


Yes. In register.inc.php the function my_mail is called (if the option is enabled in your forum settings!). The my_mail is located in functions.inc.php.

/Micha

What option is that?

I notice in the advanced settings the mail_parameter box is blank, I don't remember if that has always been blank.

Avatar

Version 2.4.17 - registration not possible

by Micha ⌂, Friday, January 11, 2019, 08:09 (1926 days ago) @ Magma

Hello,

What option is that?

A mail parameter. However, the parameter doesn't solve your problem. The my_mail-function is called here, here or here and you confirmed that these function calls works as designet. There is no reason why the same function works fine in several script files with the exception of the registration script.

Do you have enabled the mail function for new registered users?

/Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

Avatar

Version 2.4.17 - activation email fixed

by Magma, Friday, January 11, 2019, 15:07 (1926 days ago) @ Micha

The host got back to me, they said the activation emails were being dropped by the server as spam, the engineer has whitelisted my account thus the emails are now being sent as per normal.

thanks

Avatar

Version 2.4.17 - activation email fixed

by Micha ⌂, Friday, January 11, 2019, 15:11 (1926 days ago) @ Magma

Hi Magma,

thank you for reporting!

Have a nice weekend
Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

Avatar

Version 2.4.17 - activation email fixed

by Auge ⌂, Friday, January 11, 2019, 15:13 (1926 days ago) @ Magma

Hello

The host got back to me, they said the activation emails were being dropped by the server as spam, the engineer has whitelisted my account thus the emails are now being sent as per normal.

Phew. Good to hear that because it prevents us to hunt a ghost. ;-)

Please ask your hoster, if a transmission via a PHP SMTP-code instead via mail() would prevent such a case.

Tschö, Auge

--
Trenne niemals Müll, denn er hat nur eine Silbe!

Avatar

Version 2.4.17 - activation email fixed

by Magma, Friday, January 11, 2019, 22:49 (1926 days ago) @ Auge

Please ask your hoster, if a transmission via a PHP SMTP-code instead via mail() would prevent such a case.

Tschö, Auge


This was their reply:

"Even if you use PHP SMTP-code we cannot prevent it from blocking. We have already whitelisted it and the emails should now work fine."

Avatar

Version 2.4.17 - "Invalid request - please try again!"

by Micha ⌂, Wednesday, January 09, 2019, 18:54 (1928 days ago) @ Magma

Hello,

I created a couple of dummy registrations with gmail, yahoo and mail.com accounts and still after a few hours not received the activation email for them, not even in the spam folders.

I cannot confirm this issue. I was able to register a new account to this forum. The registration process should work.

/Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

RSS Feed of thread