Changeset 1156 for trunk/admin/include
- Timestamp:
- Apr 13, 2006, 12:49:42 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/functions_notification_by_mail.inc.php
r1116 r1156 28 28 29 29 /* nbm_global_var */ 30 $env_nbm = array(); 30 $env_nbm = array 31 ( 32 'start_time' => get_moment(), 33 'sendmail_timeout' => (intval(ini_get('max_execution_time')) * $conf['nbm_max_treatment_timeout_percent']), 34 'is_sendmail_timeout' => false 35 ); 36 31 37 32 38 /* … … 56 62 } 57 63 } 64 } 65 66 /* 67 * Check sendmail timeout state 68 * 69 * @return true, if it's timeout 70 */ 71 function check_sendmail_timeout() 72 { 73 global $env_nbm; 74 75 $env_nbm['is_sendmail_timeout'] = ((get_moment() - $env_nbm['start_time']) > $env_nbm['sendmail_timeout']); 76 77 return $env_nbm['is_sendmail_timeout']; 58 78 } 59 79 … … 319 339 * check_key list where action will be done 320 340 * 321 * @return updated data count341 * @return check_key lisr treated 322 342 */ 323 343 function do_subscribe_unsubcribe_notification_by_mail($is_admin_request, $is_subscribe = false, $check_key_list = array()) … … 325 345 global $conf, $page, $env_nbm, $conf; 326 346 347 $check_key_treated = array(); 327 348 $updated_data_count = 0; 328 349 $error_on_updated_data_count = 0; … … 345 366 $data_users = get_user_notifications('subscribe', $check_key_list, !$is_subscribe); 346 367 368 // Prepare message after change language 369 $msg_break_timeout = l10n('nbm_nbm_break_timeout_send_mail'); 370 347 371 // Begin nbm users environment 348 372 begin_users_env_nbm(true); … … 350 374 foreach ($data_users as $nbm_user) 351 375 { 352 if ( ($env_nbm['error_on_mail_count'] + $env_nbm['sent_mail_count']) >= $conf['nbm_max_mails_send'])376 if (check_sendmail_timeout()) 353 377 { 354 378 // Stop fill list on 'send', if the quota is override 355 array_push($page['errors'], sprintf(l10n('nbm_nbm_break_send_mail'), $conf['nbm_max_mails_send']));379 array_push($page['errors'], $msg_break_timeout); 356 380 break; 357 381 } 382 383 // Fill return list 384 array_push($check_key_treated, $nbm_user['check_key']); 358 385 359 386 $do_update = true; … … 437 464 } 438 465 439 return $ updated_data_count;466 return $check_key_treated; 440 467 } 441 468 … … 445 472 * check_key list where action will be done 446 473 * 447 * @return updated data count474 * @return check_key lisr treated 448 475 */ 449 476 function unsubcribe_notification_by_mail($is_admin_request, $check_key_list = array()) … … 457 484 * check_key list where action will be done 458 485 * 459 * @return updated data count486 * @return check_key lisr treated 460 487 */ 461 488 function subcribe_notification_by_mail($is_admin_request, $check_key_list = array())
Note: See TracChangeset
for help on using the changeset viewer.