security updates
have to check views and entityreference for custom patches
This commit is contained in:
@@ -101,7 +101,7 @@ function mimemail_admin_settings() {
|
||||
$form['mimemail']['advanced']['mimemail_key'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Message validation string'),
|
||||
'#default_value' => variable_get('mimemail_key', md5(rand())),
|
||||
'#default_value' => variable_get('mimemail_key', drupal_random_key()),
|
||||
'#required' => TRUE,
|
||||
'#description' => t('This string will be used to validate incoming messages. It can be anything, but must be used on both sides of the transfer.'),
|
||||
);
|
||||
|
@@ -15,15 +15,23 @@
|
||||
* The POSTed message.
|
||||
*/
|
||||
function mimemail_post() {
|
||||
$message = $_POST['message'];
|
||||
$token = $_POST['token'];
|
||||
$hash = md5(variable_get('mimemail_key', '**') . $message);
|
||||
|
||||
if ($hash != $token) {
|
||||
watchdog('access denied', 'Authentication error for POST e-mail', WATCHDOG_WARNING);
|
||||
if (!isset($_POST['token']) || empty($_POST['token'])) {
|
||||
return drupal_access_denied();
|
||||
}
|
||||
return mimemail_incoming($message);
|
||||
|
||||
if (isset($_POST['message']) && !empty($_POST['message'])) {
|
||||
$key = variable_get('mimemail_key', drupal_random_key());
|
||||
$hash = hash_hmac('sha1', $_POST['message'], $key);
|
||||
if ($hash != $_POST['token']) {
|
||||
watchdog('access denied', 'Authentication error for POST e-mail', WATCHDOG_WARNING);
|
||||
return drupal_access_denied();
|
||||
}
|
||||
else {
|
||||
return mimemail_incoming($_POST['message']);
|
||||
}
|
||||
}
|
||||
|
||||
return drupal_access_denied();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user