Commit a56227d6 authored by jcnventura's avatar jcnventura

Issue #1379448: new print_mail permission: send unlimited e-mails

parent 68669810
......@@ -51,7 +51,7 @@ function print_mail_form($form, &$form_state) {
$print_mail_hourly_threshold = variable_get('print_mail_hourly_threshold', PRINT_MAIL_HOURLY_THRESHOLD);
if ((!user_access('administer print')) && (!flood_is_allowed('print_mail', $print_mail_hourly_threshold))) {
if ((!user_access('send unlimited e-mails')) && (!flood_is_allowed('print_mail', $print_mail_hourly_threshold))) {
$form['flood'] = array(
'#type' => 'markup',
'#markup' => '<p>' . format_plural($print_mail_hourly_threshold, 'You cannot send more than 1 message per hour. Please try again later.', 'You cannot send more than @count messages per hour. Please try again later.') . '</p>',
......@@ -235,7 +235,7 @@ function print_mail_form_validate($form, &$form_state) {
$print_mail_hourly_threshold = variable_get('print_mail_hourly_threshold', PRINT_MAIL_HOURLY_THRESHOLD);
if ((!user_access('administer print')) && (!flood_is_allowed('print_mail', $print_mail_hourly_threshold - count($to_array) + 1))) {
if ((!user_access('send unlimited e-mails')) && (!flood_is_allowed('print_mail', $print_mail_hourly_threshold - count($to_array) + 1))) {
form_set_error('txt_to_addrs', t('You cannot send more than %number messages per hour. Please reduce the number of recipients.', array('%number' => $print_mail_hourly_threshold)));
}
......
......@@ -37,6 +37,10 @@ function print_mail_permission() {
'title' => t('Access the Send To Friend functionality'),
'description' => t('Provides the ability to send pages to a friend and the links to them in the original pages.'),
),
'send unlimited e-mails' => array(
'title' => t('Send unlimited emails'),
'description' => t("Overrides the built-in hourly threshold limits when sending e-mails. This permission should only be granted to trusted users, due to it's potential in enabling the use of your site as a source of e-mail spam."),
),
);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment