Changeset 1793 in subversion


Ignore:
Timestamp:
Sep 15, 2008 2:53:18 AM (5 years ago)
Author:
alec
Message:
  • Added 'sendmail_delay' option to restrict messages sending interval (#1484491)
Location:
trunk/roundcubemail
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/CHANGELOG

    r1776 r1793  
    11CHANGELOG RoundCube Webmail 
    22--------------------------- 
     3 
     42008/09/15 (alec) 
     5---------- 
     6- Added 'sendmail_delay' option to restrict messages sending interval (#1484491) 
    37 
    482008/09/12 (alec) 
  • trunk/roundcubemail/config/main.inc.php.dist

    r1722 r1793  
    107107// Log sent messages 
    108108$rcmail_config['smtp_log'] = TRUE; 
     109 
     110// how many seconds must pass between emails sent by a user 
     111$rcmail_config['sendmail_delay'] = 0; 
    109112 
    110113// these cols are shown in the message list 
  • trunk/roundcubemail/program/localization/en_GB/messages.inc

    r1788 r1793  
    4141$messages['contactnotfound'] = 'The requested contact was not found'; 
    4242$messages['sendingfailed'] = 'Failed to send message'; 
     43$messages['senttooquickly'] = 'You have to wait $sec sec. to sent the message'; 
    4344$messages['errorsavingsent'] = 'An error occured while saving sent message'; 
    4445$messages['errorsaving'] = 'An error occured while saving'; 
  • trunk/roundcubemail/program/localization/en_US/messages.inc

    r1788 r1793  
    4141$messages['contactnotfound'] = 'The requested contact was not found'; 
    4242$messages['sendingfailed'] = 'Failed to send message'; 
     43$messages['senttooquickly'] = 'You have to wait $sec sec. to sent the message'; 
    4344$messages['errorsavingsent'] = 'An error occured while saving sent message'; 
    4445$messages['errorsaving'] = 'An error occured while saving'; 
  • trunk/roundcubemail/program/localization/pl_PL/messages.inc

    r1788 r1793  
    5252$messages['contactnotfound'] = 'Szukany kontakt nie został odnaleziony'; 
    5353$messages['sendingfailed'] = 'Nie udało się wysłać wiadomości!'; 
     54$messages['senttooquickly'] = 'Musisz poczekać $sec sek. aby móc wysłać tÄ 
     55 wiadomość!'; 
    5456$messages['errorsavingsent'] = 'WystÄ 
    5557pił błĠ
  • trunk/roundcubemail/program/steps/mail/sendmail.inc

    r1755 r1793  
    2626$OUTPUT->framed = TRUE; 
    2727 
     28$savedraft = !empty($_POST['_draft']) ? TRUE : FALSE; 
     29 
     30/****** checks ********/ 
    2831 
    2932if (!isset($_SESSION['compose']['id'])) { 
     
    3437} 
    3538 
     39if (!$savedraft && empty($_POST['_to']) && empty($_POST['_cc']) && empty($_POST['_bcc']) && empty($_POST['_subject']) && $_POST['_message']) { 
     40  $OUTPUT->show_message('sendingfailed', 'error'); 
     41  $OUTPUT->send('iframe'); 
     42} 
     43 
     44if(!$savedraft && !empty($CONFIG['sendmail_delay'])) { 
     45  $wait_sec = time() - intval($CONFIG['sendmail_delay']) - intval($_SESSION['last_message_time']); 
     46  if($wait_sec < 0) 
     47    { 
     48    $OUTPUT->show_message('senttooquickly', 'error', array('sec' => $wait_sec * -1)); 
     49    $OUTPUT->send('iframe'); 
     50    } 
     51} 
     52 
    3653 
    3754/****** message sending functions ********/ 
    38  
    3955 
    4056// get identity record 
     
    117133} 
    118134 
     135 
     136/****** compose message ********/ 
     137 
    119138if (strlen($_POST['_draft_saveid']) > 3) 
    120139  $olddraftmessageid = get_input_value('_draft_saveid', RCUBE_INPUT_POST); 
    121140 
    122141$message_id = sprintf('<%s@%s>', md5(uniqid('rcmail'.rand(),true)), $RCMAIL->config->mail_domain($_SESSION['imap_host'])); 
    123 $savedraft = !empty($_POST['_draft']) ? TRUE : FALSE; 
    124  
    125  
    126 /****** check submission and compose message ********/ 
    127  
    128  
    129 if (!$savedraft && empty($_POST['_to']) && empty($_POST['_cc']) && empty($_POST['_bcc']) && empty($_POST['_subject']) && $_POST['_message']) 
    130   { 
    131   $OUTPUT->show_message("sendingfailed", 'error'); 
    132   $OUTPUT->send('iframe'); 
    133   return; 
    134   } 
    135  
    136142 
    137143// set default charset 
     
    347353    $OUTPUT->show_message("sendingfailed", 'error');  
    348354    $OUTPUT->send('iframe'); 
    349     return; 
    350     } 
     355    } 
     356 
     357  // save message sent time 
     358  if (!empty($CONFIG['sendmail_delay'])) 
     359    $_SESSION['last_message_time'] = time(); 
    351360   
    352361  // set replied/forwarded flag 
Note: See TracChangeset for help on using the changeset viewer.