Ignore:
Timestamp:
Oct 17, 2009, 4:47:20 PM (15 years ago)
Author:
cljosse
Message:

[mail_supervisor] new gestion of copy carbon

Location:
extensions/Mail_supervisor
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • extensions/Mail_supervisor/admin/mail_superv_admin.php

    r4053 r4054  
    3030
    3131
    32 global $user, $lang, $conf, $errors;
     32
     33
     34
     35// +-----------------------------------------------------------------------+
     36// | Check Access and exit when user status is not ok                      |
     37// +-----------------------------------------------------------------------+
     38check_status(ACCESS_ADMINISTRATOR);
     39
     40global $user, $lang, $conf, $errors,$mails_données;
    3341global $args, $conf_mail,$infos_message,$erreur_message ;
    34 
    35  load_language('plugin.lang', MAIL_SUPERV_PATH);
    36 // +-----------------------------------------------------------------------+
    37 // | Check Access and exit when user status is not ok                      |
    38 // +-----------------------------------------------------------------------+
    39 check_status(ACCESS_ADMINISTRATOR);
    4042
    4143include_once (PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
     
    5052
    5153
    52 
     54 load_language('plugin.lang', MAIL_SUPERV_PATH);
     55 
    5356$mails_options = explode("," , $conf['mail_superv']);
    5457$mails_données=Get_Datas();
     
    211214                ;';
    212215                list($group_name) = mysql_fetch_row(pwg_query($query));
    213                  
    214                
     216                }       else {
     217                                $group_name="";         
    215218                }               
    216219//================================================
     
    219222       
    220223if ( isset($_POST['test_envoie']) ) {
    221         if ($group_id >= 0) {
     224       
    222225                $mails_données['message_test'] = isset($_POST['content']) ? $_POST['content'] :  $mails_données['message_test']  ;
    223226                $message=$mails_données['message_test'];
     
    225228                test_envoie($message,$group_name,$group_id);   
    226229                $mails_données = Get_Datas() ;
    227         }       
     230               
    228231  }
    229232
  • extensions/Mail_supervisor/include/fonctions.php

    r4053 r4054  
    186186//===============================================
    187187
    188 function corrige_header($Carbonne,$headers)
     188function corrige_header($Carbonne,$headers,$args)
    189189        {
    190         global $mails_options,$conf_mail,$mailto,$args,$infos_message;
    191  
    192         if (!empty($args[$Carbonne]))
     190        global $mails_options,$conf_mail,$mailto,$infos_message;
     191
     192 if (!empty($args[$Carbonne]))
    193193         {
    194194 
    195195                if ( count($args[$Carbonne]) > 0 )
    196196                {
    197                   if ($mails_options[1] == 'on') {
    198                   // Correction "< >"
    199                         $list_mail  = get_strict_email_list(implode(',', $args[$Carbonne])) ;
    200                         $headers = preg_replace('/.*'.$Carbonne.'(.*).\n/i', $Carbonne.' : '.$list_mail."\n", $headers);
    201                         }
     197                 if ($mails_options[1] == 'on') {
     198                        $list_mail  = str_replace(","," ,",get_strict_email_list(implode(',', $args[$Carbonne])))." \n" ;
     199                        $headers = preg_replace('/.*'.$Carbonne.'(.*).\n/i', $Carbonne.': '.$list_mail, $headers);
     200                 }
    202201                }
    203202        } else {
     
    207206               
    208207               
    209  
    210208return $headers;
    211209
     
    259257function vérif_base()
    260258{
     259
     260global $lang;
     261 load_language('plugin.lang', MAIL_SUPERV_PATH);
    261262
    262263$q = "
     
    393394        }
    394395}
     396
     397
    395398function Get_colonnes_de($table)
    396399{
  • extensions/Mail_supervisor/include/function_test_send.php

    r4051 r4054  
    3131function test_envoie($message,$group_name,$group_id)
    3232{
    33     global $infos_message,$erreur_message ,$conf,$user,$conf_mail,$mail_données,$args ;
     33    global $infos_message,$erreur_message ,$conf,$user,$conf_mail,$mail_données,$args,$lang ;
    3434        $mailto=""; 
    3535       
    36 
     36 load_language('plugin.lang', MAIL_SUPERV_PATH);
     37 
    3738//==================================================================================
    3839if (!isset($infos_message))
     
    6970  if (count($groups) > 0)
    7071  {
    71  //===========================================================
    72         $args['Bcc']=$groups;
     72       $args['Bcc']=$groups;
     73   }   else {
     74       $mailto = $conf_mail['formated_email_webmaster'];
     75   }
     76   
    7377        $args['from'] = $conf_mail['formated_email_webmaster'];
    7478        //==================================================================
     
    8892        $args['subject']="Plugin Piwigo TEST";
    8993        $args['content']=$message_html;
     94                $infos_message .="To :" . $mailto;
     95               
    9096        $ret= pwg_mail($mailto , $args);
    91                
    92                  $infos_message .=    sprintf( l10n('An information email was sent to group "%s"'), $group_name ).'<br />';
    93 
     97        if ( $group_name <> '' or $mailto <> '' )
     98        {       
     99                if ($group_name<>'') {
     100                 $infos_message .=  '<br />'.  sprintf( l10n('An information email was sent to group "%s"'), $group_name ).'<br />';
     101                        }
     102                        if ($mailto <> '') {
     103                                $infos_message .=  '<br />'.  sprintf( l10n('mail_sent_to'), $mailto ).'<br />';
     104                                }
    94105                 
    95106        }else{
    96                $infos_message .=l10n('no_receiver_available') ;
     107               $infos_message .='<br />'.l10n('no_receiver_available') ;
    97108        }
    98109       
     
    101112function mail_attachement($args)
    102113{
    103  global $infos_message,$erreur_message ,$conf,$user,$conf_mail,$mail_données ;
     114 global $infos_message,$erreur_message ,$conf,$user,$conf_mail,$mail_données,$lang ;
    104115
    105116    $mails_données = Get_Datas();
     
    109120  }
    110121
    111 
     122 load_language('plugin.lang', MAIL_SUPERV_PATH);
    112123
    113124                $nom ='piwigo_logo_sombre_214x100.png';
  • extensions/Mail_supervisor/main.inc.php

    r4053 r4054  
    2424/*
    2525Plugin Name: Mail supervisor
    26 Version: 1.1.5
     26Version: 1.1.6
    2727Description:  Mail supervisor surveille l'envoie des mails.
    2828Plugin URI: http://piwigo.org/ext/extension_view.php?eid=315
     
    117117        }else{
    118118   
    119                 if (!empty($args['Cc']))
     119 
     120     }
     121
     122//=============================================================================         
     123if (!empty($args['Cc']))
    120124                        {
    121                          $headers= corrige_header('Cc',$headers);
    122                                  
     125                         $headers= corrige_header('Cc',$headers,$args);
    123126                        }
    124127                if (!empty($args['Bcc']))
    125128                        {   
    126                                    $headers     = corrige_header('Bcc',$headers);
    127                         }
    128 
    129  
    130      }
    131 
     129                                   $headers     = corrige_header('Bcc',$headers,$args);
     130                        }
     131//=============================================================================                 
    132132if ($mails_options[2]=='on')   {
    133133
     
    152152                 if ($nb_destinataires > 0) {
    153153                   $ret = mail($mailto, $subject, $content, $headers);
    154 /* <br />
    155 <b>Warning</b>:  mail() [<a href='function.mail'>function.mail</a>]: Trop de spam. Fonction mail() bloque.
    156  in <b>/mnt/102/sdb/9/5/cl.josse/Galerie/plugins/mail_supervisor/main.inc.php</b> on line <b>132</b><br />
    157 */
     154
    158155                        }else{
    159156                           $message .='Nombre de destinataires = 0';
  • extensions/Mail_supervisor/maintain.inc.php

    r4053 r4054  
    3131
    3232include_once (MAIL_SUPERV_PATH.'include/constants.php');
    33 global $lang;
     33
    3434include_once (MAIL_SUPERV_PATH.'include/fonctions.php');
    3535
     
    4141  SELECT  count(`id`) as total   FROM `'.PLUGINS_TABLE.'` WHERE `id` LIKE "free_mail"   ;';
    4242     $plugs = mysql_fetch_array(pwg_query($q));
    43  $nb= $plugs['total'];
     43        $nb= $plugs['total'];
    4444
    4545  if (count($nb)>=1) {
Note: See TracChangeset for help on using the changeset viewer.