Ignore:
Timestamp:
Dec 23, 2010, 11:24:37 PM (13 years ago)
Author:
Eric
Message:

bug 2066 second step fix :

  • Add option to enable / disable email send
  • Email function integration in userlist table
  • LCAS_SendMail function coded (not tested)

Database init updated
Translation files updated

File:
1 edited

Legend:

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

    r8217 r8271  
    621621
    622622
    623 /* Function called from main.inc.php to send validation email */
    624 function LCAS_SendMail2User($typemail, $id, $username, $password, $email, $confirm)
     623/* Function called from LCAS_admin.php to send notification email */
     624function LCAS_SendMail($id, $username)
    625625{
    626626  global $conf;
     
    629629 
    630630        include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');
    631  
    632         $infos1_perso = "";
    633   $infos2_perso = "";
    634631
    635632/* We have to get the user's language in database */
     
    656653  }
    657654
    658   switch($typemail)
    659   {
    660     case 1:
    661       $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Add of %s', stripslashes($username)));
    662       $password = $password <> '' ? $password : l10n('LCAS_empty_pwd');
    663      
    664       if (isset($conf_LCAS[9]) and $conf_LCAS[9] <> '')
    665       {
    666         if (function_exists('get_user_language_desc'))
    667         {
    668           $infos1_perso = get_user_language_desc($conf_LCAS[9])."\n\n";
    669         }
    670         else $infos1_perso = l10n($conf_LCAS[9])."\n\n";
    671       }
    672      
    673       break;
    674      
    675     case 2:
    676       $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Update of %s', stripslashes($username)));
    677       $password = $password <> '' ? $password : l10n('LCAS_empty_pwd');
    678 
    679       break;
    680        
    681     case 3:
    682       $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Update of %s', stripslashes($username)));
    683       $password = $password <> '' ? $password : l10n('LCAS_no_update_pwd');
    684 
    685       break;
    686   }
    687 
    688   if (isset($conf_LCAS[0]) and $conf_LCAS[0] == 'true')
    689   {
    690     $infos1 = array(
    691       get_l10n_args('infos_mail %s', stripslashes($username)),
    692       get_l10n_args('User: %s', stripslashes($username)),
    693       get_l10n_args('Password: %s', $password),
    694       get_l10n_args('Email: %s', $email),
    695       get_l10n_args('', ''),
    696     );
    697   }
    698 
    699 
    700   if ( isset($conf_LCAS[1]) and $conf_LCAS[1] == 'true' and $confirm)
    701   {
    702     $infos2 = array
    703     (
    704       get_l10n_args('Link: %s', AddConfirmMail($id, $email)),
    705       get_l10n_args('', ''),
    706     );
    707 
    708     if (isset($conf_LCAS[10]) and $conf_LCAS[10] <> '')
     655  $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Username_updated_for_%s', stripslashes($username)));
     656
     657  if (isset($conf_LCAS[3]) and $conf_LCAS[3] <> '')
     658  {
     659    if (function_exists('get_user_language_desc'))
    709660    {
    710       if (function_exists('get_user_language_desc'))
    711       {
    712         $infos2_perso = get_user_language_desc($conf_LCAS[10])."\n\n";
    713       }
    714       else $infos2_perso = l10n($conf_LCAS[10])."\n\n";
     661      $customtxt = get_user_language_desc($conf_LCAS[3])."\n\n";
    715662    }
    716   }
    717 
    718 /* Sending the email with subject and contents */
     663    else $customtxt = l10n($conf_LCAS[3])."\n\n";
     664  }
     665
     666/* Send the email with subject and contents */
    719667  pwg_mail($email, array(
    720668    'subject' => $subject,
    721     'content' => (isset($infos1) ? $infos1_perso.l10n_args($infos1)."\n\n" : "").(isset($infos2) ? $infos2_perso.l10n_args($infos2)."\n\n" : "").get_absolute_root_url(),
     669    'content' => ($customtxt),
    722670  ));
    723671
Note: See TracChangeset for help on using the changeset viewer.