Changeset 17986


Ignore:
Timestamp:
Sep 18, 2012, 5:58:18 PM (12 years ago)
Author:
flop25
Message:

send mail to admin AND webmasters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/UserAdvManager/trunk/include/functions.inc.php

    r17974 r17986  
    11811181                if (isset($conf_UAM[1]) and $conf_UAM[1] == 'local')
    11821182                {
    1183                 pwg_mail(get_webmaster_mail_address(), array(
     1183                $admins = array();
     1184      $query = '
     1185    SELECT
     1186        u.'.$conf['user_fields']['username'].' AS username,
     1187        u.'.$conf['user_fields']['email'].' AS mail_address
     1188      FROM '.USERS_TABLE.' AS u
     1189        JOIN '.USER_INFOS_TABLE.' AS i ON i.user_id =  u.'.$conf['user_fields']['id'].'
     1190      WHERE i.status in (\'webmaster\',  \'admin\')
     1191        AND '.$conf['user_fields']['email'].' IS NOT NULL
     1192        AND i.user_id <> '.$user['id'].'
     1193      ORDER BY username
     1194    ;';
     1195   
     1196      $datas = pwg_query($query);
     1197      if (!empty($datas))
     1198      {
     1199        while ($admin = pwg_db_fetch_assoc($datas))
     1200        {
     1201          if (!empty($admin['mail_address']))
     1202          {
     1203            array_push($admins, format_email($admin['username'], $admin['mail_address']));
     1204          }
     1205        }
     1206      }
     1207      pwg_mail(implode(', ', $admins), array(
    11841208                'subject' => $subject,
    11851209      'content' => (isset($infos1) ? $infos1_perso.l10n_args($infos1)."\n\n" : "").(isset($infos2) ? $infos2_perso.l10n_args($infos2)."\n\n" : "").get_absolute_root_url(),
Note: See TracChangeset for help on using the changeset viewer.