Changeset 9360 for trunk/include/functions_mail.inc.php
- Timestamp:
- Feb 23, 2011, 11:44:07 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_mail.inc.php
r8728 r9360 278 278 * @return boolean (Ok or not) 279 279 */ 280 function pwg_mail_notification_admins($keyargs_subject, $keyargs_content) 281 { 280 function pwg_mail_notification_admins($keyargs_subject, $keyargs_content, $send_technical_details=true) 281 { 282 global $conf, $user; 283 282 284 // Check arguments 283 if 284 ( 285 empty($keyargs_subject) or 286 empty($keyargs_content) 287 ) 285 if (empty($keyargs_subject) or empty($keyargs_content)) 288 286 { 289 287 return false; 290 288 } 291 289 292 global $conf, $user;293 290 $return = true; 294 291 … … 296 293 297 294 $query = ' 298 select 299 U.'.$conf['user_fields']['username'].' as username, 300 U.'.$conf['user_fields']['email'].' as mail_address 301 from 302 '.USERS_TABLE.' as U, 303 '.USER_INFOS_TABLE.' as I 304 where 305 I.user_id = U.'.$conf['user_fields']['id'].' and 306 I.status in (\'webmaster\', \'admin\') and 307 '.$conf['user_fields']['email'].' is not null and 308 I.user_id <> '.$user['id'].' 309 order by 310 username 311 '; 295 SELECT 296 u.'.$conf['user_fields']['username'].' AS username, 297 u.'.$conf['user_fields']['email'].' AS mail_address 298 FROM '.USERS_TABLE.' AS u 299 JOIN '.USER_INFOS_TABLE.' AS i ON i.user_id = u.'.$conf['user_fields']['id'].' 300 WHERE i.status in (\'webmaster\', \'admin\') 301 AND '.$conf['user_fields']['email'].' IS NOT NULL 302 AND i.user_id <> '.$user['id'].' 303 ORDER BY username 304 ;'; 312 305 313 306 $datas = pwg_query($query); … … 325 318 if (count($admins) > 0) 326 319 { 327 $keyargs_content_admin_info = array 328 ( 320 $keyargs_content_admin_info = array( 329 321 get_l10n_args('Connected user: %s', stripslashes($user['username'])), 330 322 get_l10n_args('IP: %s', $_SERVER['REMOTE_ADDR']), 331 323 get_l10n_args('Browser: %s', $_SERVER['HTTP_USER_AGENT']) 332 );324 ); 333 325 334 326 switch_lang_to(get_default_language()); 335 327 336 $return = pwg_mail 337 ( 338 '', 339 array 340 ( 341 'Bcc' => $admins, 328 $content = l10n_args($keyargs_content)."\n"; 329 if ($send_technical_details) 330 { 331 $content.= "\n".l10n_args($keyargs_content_admin_info)."\n"; 332 } 333 334 $return = pwg_mail( 335 implode(', ', $admins), 336 array( 342 337 'subject' => '['.$conf['gallery_title'].'] '.l10n_args($keyargs_subject), 343 'content' => 344 l10n_args($keyargs_content)."\n\n" 345 .l10n_args($keyargs_content_admin_info)."\n", 346 'content_format' => 'text/plain' 347 ) 348 ) and $return; 349 338 'content' => $content, 339 'content_format' => 'text/plain', 340 'email_format' => 'text/plain', 341 ) 342 ); 343 350 344 switch_lang_back(); 351 345 }
Note: See TracChangeset
for help on using the changeset viewer.