Changeset 26934


Ignore:
Timestamp:
Jan 23, 2014, 10:38:19 PM (10 years ago)
Author:
Eric
Message:

Piwigo 2.6 compliance - Step 34 and final:
Improve confirmation and information email sending workflow

File:
1 edited

Legend:

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

    r26914 r26934  
    142142
    143143    // --------------------------------------------------------------------------------------------------------------------
    144     // Workflow when admins have to validate registrations (CONFIRM_MAIL = local)
    145     // No validation needed when admins add users if ADMINCONFMAIL is set to OFF - users are considered as valid by default
    146     // Else a notification email with validation link is send to admins
    147     // Finally when a user registers himself, a notification email with validation link is send to admins
     144    // Workflow when admins have to validate registrations (CONFIRM_MAIL = local):
     145    // 1- A confirmation email with validation link is send to users added by admins
     146    // 2- Else no validation needed when admins add users if ADMINCONFMAIL is set to OFF - users are considered as valid by
     147    // default and no information email is send to user from UAM (Piwigo will do that by checking the option box)
     148    // 3- Finally when a user registers himself, a notification email with validation link is send to admins
    148149    // --------------------------------------------------------------------------------------------------------------------
    149150    if (isset($conf_UAM['CONFIRM_MAIL']) and $conf_UAM['CONFIRM_MAIL'] == 'local')
    150151    {
    151       if (is_admin() and isset($conf_UAM['ADMINCONFMAIL']) and $conf_UAM['ADMINCONFMAIL'] == 'true')
     152      if (is_admin() and (isset($conf_UAM['ADMINCONFMAIL']) and $conf_UAM['ADMINCONFMAIL'] == 'true'))
    152153      {
    153154        SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], true);
    154155      }
    155       elseif (is_admin() and isset($conf_UAM['ADMINCONFMAIL']) and $conf_UAM['ADMINCONFMAIL'] == 'false')
     156      elseif (is_admin() and (isset($conf_UAM['ADMINCONFMAIL']) and $conf_UAM['ADMINCONFMAIL'] == 'false'))
    156157      {
    157158        SetValidated($register_user['id']);
    158         SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], false);
     159        // Pending information email - Managed by Piwigo
     160        //SendMail2User(2, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], false);
    159161      }
    160162      elseif (!is_admin())
     
    164166    }
    165167    // --------------------------------------------------------------------------------------------------------------------
    166     // Workflow when users have to validate their registration (CONFIRM_MAIL = true)
    167     // No validation needed when admins add users if ADMINCONFMAIL is set to OFF - users are considered as valid by default
    168     // Else an email with validation link is send to user
    169     // Finally when a user registers himself, an email with validation link is send to him
     168    // Workflow when users have to validate their registration (CONFIRM_MAIL = true):
     169    // 1- A confirmation email with validation link is send to users added by admins
     170    // 2- ELse no validation needed when admins add users if ADMINCONFMAIL is set to OFF - users are considered as valid by
     171    // default and no information email is send to user from UAM (Piwigo will do that by checking the option box)
     172    // 3- Finally when a user registers himself, an email with validation link is send to him
    170173    // --------------------------------------------------------------------------------------------------------------------
    171174    elseif (isset($conf_UAM['CONFIRM_MAIL']) and $conf_UAM['CONFIRM_MAIL'] == 'true')
    172175    {
    173       if (is_admin() and isset($conf_UAM['ADMINCONFMAIL']) and $conf_UAM['ADMINCONFMAIL'] == 'true')
     176      if (is_admin() and (isset($conf_UAM['ADMINCONFMAIL']) and $conf_UAM['ADMINCONFMAIL'] == 'true'))
    174177      {
    175178        SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], true);
    176179      }
    177       elseif (is_admin() and isset($conf_UAM['ADMINCONFMAIL']) and $conf_UAM['ADMINCONFMAIL'] == 'false')
     180      elseif (is_admin() and (isset($conf_UAM['ADMINCONFMAIL']) and $conf_UAM['ADMINCONFMAIL'] == 'false'))
    178181      {
    179182        SetValidated($register_user['id']);
    180         SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], false);
     183        // Pending information email - Managed by Piwigo
     184        //SendMail2User(2, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], false);
    181185      }
    182186      elseif (!is_admin())
     
    317321      }
    318322
    319       $typemail = 2;
    320 
    321       // Send email
     323      // Send information email
    322324      if ((isset($conf_UAM['MAIL_INFO']) and $conf_UAM['MAIL_INFO'] == 'true') or $confirm_mail_need)
    323325      {
     
    330332        list($username) = pwg_db_fetch_row(pwg_query($query));
    331333
    332         SendMail2User($typemail, $user['id'], $username, $_POST['use_new_pwd'], $_POST['mail_address'], $confirm_mail_need);
     334        SendMail2User(2, $user['id'], $username, $_POST['use_new_pwd'], $_POST['mail_address'], $confirm_mail_need);
    333335      }
    334336    }
     
    11961198  }
    11971199
     1200//       $converted_res = ($confirm) ? 'true' : 'false';
     1201//       UAMLog($typemail,$converted_res,$conf_UAM['CONFIRM_MAIL'],$subject);
    11981202
    11991203// Sending the email with subject and contents
     
    12171221
    12181222
    1219         if (isset($conf_UAM['CONFIRM_MAIL']) and $conf_UAM['CONFIRM_MAIL'] == 'true' and $confirm) // Confirmation email send to users
     1223        if ((isset($conf_UAM['CONFIRM_MAIL']) and $conf_UAM['CONFIRM_MAIL'] == 'true') and $confirm) // Confirmation email send to users
    12201224        {
    12211225          // Adding gallery URL at the end of the email
     
    12731277
    12741278
    1275         if (isset($conf_UAM['MAIL_INFO']) and $conf_UAM['MAIL_INFO'] == 'true') // Information email send to users
     1279        if ((isset($conf_UAM['MAIL_INFO']) and $conf_UAM['MAIL_INFO'] == 'true') and $typemail <> 1) // Information email send to users
    12761280        {
    12771281          // Adding gallery URL at the end of the email
Note: See TracChangeset for help on using the changeset viewer.