Changeset 30776 for extensions


Ignore:
Timestamp:
Dec 18, 2014, 9:54:35 PM (10 years ago)
Author:
Eric
Message:

New feature : Allow admins to receive a copy of all emails sent by the plugin

Location:
extensions/UserAdvManager/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • extensions/UserAdvManager/trunk/admin/UAM_admin.php

    r30744 r30776  
    118118  case 'global':
    119119
    120   if (isset($_POST['submit']) and isset($_POST['UAM_Mail_Info']) and isset($_POST['UAM_Username_Char']) and isset($_POST['UAM_Confirm_Mail']) and isset($_POST['UAM_GhostUser_Tracker']) and isset($_POST['UAM_Admin_ConfMail']) and isset($_POST['UAM_RedirToProfile']) and isset($_POST['UAM_GTAuto']) and isset($_POST['UAM_GTAutoMail']) and isset($_POST['UAM_CustomPasswRetr']) and isset($_POST['UAM_USRAuto']) and isset($_POST['UAM_USRAutoMail']) and isset($_POST['UAM_Stuffs']) and isset($_POST['UAM_HidePassw']) and isset($_POST['UAM_RejectConnexion']) and isset($_POST['UAM_AddURL2Mail']))
     120  if (isset($_POST['submit']) and isset($_POST['UAM_Mail_Info']) and isset($_POST['UAM_Username_Char']) and isset($_POST['UAM_Confirm_Mail']) and isset($_POST['UAM_GhostUser_Tracker']) and isset($_POST['UAM_Admin_ConfMail']) and isset($_POST['UAM_RedirToProfile']) and isset($_POST['UAM_GTAuto']) and isset($_POST['UAM_GTAutoMail']) and isset($_POST['UAM_CustomPasswRetr']) and isset($_POST['UAM_USRAuto']) and isset($_POST['UAM_USRAutoMail']) and isset($_POST['UAM_Stuffs']) and isset($_POST['UAM_HidePassw']) and isset($_POST['UAM_RejectConnexion']) and isset($_POST['UAM_AddURL2Mail']) and isset($_POST['UAM_Emails_Copy2Admins']))
    121121  {
    122122
     
    274274    $newconf_UAM['ADMINVALIDATIONMAIL_SUBJECT'] = (isset($_POST['UAM_AdminValidationMail_Subject']) ? $_POST['UAM_AdminValidationMail_Subject'] : l10n('UAM_Default_AdminValidationMail_Subject'));
    275275    $newconf_UAM['ADD_GALLERY_URL_TO_EMAILS'] = (isset($_POST['UAM_AddURL2Mail']) ? $_POST['UAM_AddURL2Mail'] : 'false');
     276    $newconf_UAM['EMAILS_COPY_TO_ADMINS'] = (isset($_POST['UAM_Emails_Copy2Admins']) ? $_POST['UAM_Emails_Copy2Admins'] : 'false');
    276277
    277278    $conf['UserAdvManager'] = serialize($newconf_UAM);
     
    685686            'UAM_ADDURL2MAIL_TRUE'              => $conf_UAM['ADD_GALLERY_URL_TO_EMAILS']=='true' ? 'checked="checked"' : '' ,
    686687            'UAM_ADDURL2MAIL_FALSE'             => $conf_UAM['ADD_GALLERY_URL_TO_EMAILS']=='false' ? 'checked="checked"' : '' ,
     688                                                'UAM_ADMINS_COPY_TRUE'              => $conf_UAM['EMAILS_COPY_TO_ADMINS']=='true' ? 'checked="checked"' : '' ,
     689                                                'UAM_ADMINS_COPY_FALSE'             => $conf_UAM['EMAILS_COPY_TO_ADMINS']=='false' ? 'checked="checked"' : '' ,
    687690            'UAM_ERROR_REPORTS1'                => $UAM_Exclusionlist_Error,
    688691            'UAM_ERROR_REPORTS2'                => $UAM_Illegal_Flag_Error1,
  • extensions/UserAdvManager/trunk/admin/template/global.tpl

    r26947 r30776  
    774774 
    775775    <div id="Config5" class="instructionBlockContent" style="display:none">
     776      <p class="new_in_version">{'UAM_NewFeature'|@translate}</p>
     777      <div class="uam_new">
     778        <ul>
     779          <li>
     780            <label class="cluetip" title="{'UAM_Admins_Copy'|translate}|{'UAM_Admins_Copy_d'|translate}">
     781              {'UAM_Admins_Copy'|@translate}
     782            </label>
     783         
     784            <label for="UAM_Admins_Copy_false"><input id="UAM_Admins_Copy_false" type="radio" value="false" {$UAM_ADMINS_COPY_FALSE} name="UAM_Emails_Copy2Admins"/>
     785              {'UAM_Disable'|@translate}
     786            </label>
     787            <label for="UAM_Admins_Copy_true"><input id="UAM_Admins_Copy_true" type="radio" value="true" {$UAM_ADMINS_COPY_TRUE} name="UAM_Emails_Copy2Admins"/>
     788              {'UAM_Enable'|@translate}
     789            </label>
     790          </li>
     791        </ul>
     792      </div>
    776793        <ul>
    777794          <li>
  • extensions/UserAdvManager/trunk/include/functions.inc.php

    r26934 r30776  
    12391239          )
    12401240        );
     1241
     1242      // Send a copy to admins
     1243      if ((isset($conf_UAM['EMAILS_COPY_TO_ADMINS']) and $conf_UAM['EMAILS_COPY_TO_ADMINS'] == 'true'))
     1244      {
     1245        UAM_Copy2Admins($subject,$content_confirmation);
     1246      }
    12411247    }
    12421248    // Do not add gallery URL at the end of the email
     
    12561262          )
    12571263        );
     1264
     1265      // Send a copy to admins
     1266      if ((isset($conf_UAM['EMAILS_COPY_TO_ADMINS']) and $conf_UAM['EMAILS_COPY_TO_ADMINS'] == 'true'))
     1267      {
     1268        UAM_Copy2Admins($subject,$content_confirmation);
     1269      }
    12581270    }
    12591271    // By default do not add gallery URL at the end of the email
     
    12731285          )
    12741286        );
     1287
     1288      // Send a copy to admins
     1289      if ((isset($conf_UAM['EMAILS_COPY_TO_ADMINS']) and $conf_UAM['EMAILS_COPY_TO_ADMINS'] == 'true'))
     1290      {
     1291        UAM_Copy2Admins($subject,$content_confirmation);
     1292      }
    12751293    }
    12761294        }
     
    12951313          )
    12961314        );
     1315
     1316      // Send a copy to admins
     1317      if ((isset($conf_UAM['EMAILS_COPY_TO_ADMINS']) and $conf_UAM['EMAILS_COPY_TO_ADMINS'] == 'true'))
     1318      {
     1319        UAM_Copy2Admins($subject,$content_info);
     1320      }
    12971321    }
    12981322    // Do not add gallery URL at the end of the email
     
    13121336          )
    13131337        );
     1338
     1339      // Send a copy to admins
     1340      if ((isset($conf_UAM['EMAILS_COPY_TO_ADMINS']) and $conf_UAM['EMAILS_COPY_TO_ADMINS'] == 'true'))
     1341      {
     1342        UAM_Copy2Admins($subject,$content_info);
     1343      }
    13141344    }
    13151345    // By default do not add gallery URL at the end of the email
     
    13291359          )
    13301360        );
     1361
     1362      // Send a copy to admins
     1363      if ((isset($conf_UAM['EMAILS_COPY_TO_ADMINS']) and $conf_UAM['EMAILS_COPY_TO_ADMINS'] == 'true'))
     1364      {
     1365        UAM_Copy2Admins($subject,$content_info);
     1366      }
    13311367    }
    13321368        }
     
    15001536        )
    15011537      );
     1538
     1539    // Send a copy to admins
     1540    if ((isset($conf_UAM['EMAILS_COPY_TO_ADMINS']) and $conf_UAM['EMAILS_COPY_TO_ADMINS'] == 'true'))
     1541    {
     1542      UAM_Copy2Admins($subject,$content);
     1543    }
    15021544  }
    15031545  // Do not add gallery URL at the end of the email
     
    15171559        )
    15181560      );
     1561
     1562    // Send a copy to admins
     1563    if ((isset($conf_UAM['EMAILS_COPY_TO_ADMINS']) and $conf_UAM['EMAILS_COPY_TO_ADMINS'] == 'true'))
     1564    {
     1565      UAM_Copy2Admins($subject,$content);
     1566    }
    15191567  }
    15201568  // By default do not add gallery URL at the end of the email
     
    15341582        )
    15351583      );
     1584
     1585    // Send a copy to admins
     1586    if ((isset($conf_UAM['EMAILS_COPY_TO_ADMINS']) and $conf_UAM['EMAILS_COPY_TO_ADMINS'] == 'true'))
     1587    {
     1588      UAM_Copy2Admins($subject,$content);
     1589    }
    15361590  }
    15371591
     
    16301684        )
    16311685      );
     1686
     1687    // Send a copy to admins
     1688    if ((isset($conf_UAM['EMAILS_COPY_TO_ADMINS']) and $conf_UAM['EMAILS_COPY_TO_ADMINS'] == 'true'))
     1689    {
     1690      UAM_Copy2Admins($subject,$content);
     1691    }
    16321692  }
    16331693  // Do not add gallery URL at the end of the email
     
    16471707        )
    16481708      );
     1709
     1710    // Send a copy to admins
     1711    if ((isset($conf_UAM['EMAILS_COPY_TO_ADMINS']) and $conf_UAM['EMAILS_COPY_TO_ADMINS'] == 'true'))
     1712    {
     1713      UAM_Copy2Admins($subject,$content);
     1714    }
    16491715  }
    16501716  // By default do not add gallery URL at the end of the email
     
    16641730        )
    16651731      );
     1732
     1733    // Send a copy to admins
     1734    if ((isset($conf_UAM['EMAILS_COPY_TO_ADMINS']) and $conf_UAM['EMAILS_COPY_TO_ADMINS'] == 'true'))
     1735    {
     1736      UAM_Copy2Admins($subject,$content);
     1737    }
    16661738  }
    16671739
     
    17831855        )
    17841856      );
     1857
     1858    // Send a copy to admins
     1859    if ((isset($conf_UAM['EMAILS_COPY_TO_ADMINS']) and $conf_UAM['EMAILS_COPY_TO_ADMINS'] == 'true'))
     1860    {
     1861      UAM_Copy2Admins($subject,$content);
     1862    }
    17851863  }
    17861864  // Do not add gallery URL at the end of the email
     
    18001878        )
    18011879      );
     1880
     1881    // Send a copy to admins
     1882    if ((isset($conf_UAM['EMAILS_COPY_TO_ADMINS']) and $conf_UAM['EMAILS_COPY_TO_ADMINS'] == 'true'))
     1883    {
     1884      UAM_Copy2Admins($subject,$content);
     1885    }
    18021886  }
    18031887  // By default do not add gallery URL at the end of the email
     
    18171901        )
    18181902      );
     1903
     1904    // Send a copy to admins
     1905    if ((isset($conf_UAM['EMAILS_COPY_TO_ADMINS']) and $conf_UAM['EMAILS_COPY_TO_ADMINS'] == 'true'))
     1906    {
     1907      UAM_Copy2Admins($subject,$content);
     1908    }
    18191909  }
    18201910
     
    19372027        )
    19382028      );
     2029
     2030    // Send a copy to admins
     2031    if ((isset($conf_UAM['EMAILS_COPY_TO_ADMINS']) and $conf_UAM['EMAILS_COPY_TO_ADMINS'] == 'true'))
     2032    {
     2033      UAM_Copy2Admins($subject,$content);
     2034    }
    19392035  }
    19402036  // Do not add gallery URL at the end of the email
     
    19542050        )
    19552051      );
     2052
     2053    // Send a copy to admins
     2054    if ((isset($conf_UAM['EMAILS_COPY_TO_ADMINS']) and $conf_UAM['EMAILS_COPY_TO_ADMINS'] == 'true'))
     2055    {
     2056      UAM_Copy2Admins($subject,$content);
     2057    }
    19562058  }
    19572059  // By defaukt do not add gallery URL at the end of the email
     
    19712073        )
    19722074      );
     2075
     2076    // Send a copy to admins
     2077    if ((isset($conf_UAM['EMAILS_COPY_TO_ADMINS']) and $conf_UAM['EMAILS_COPY_TO_ADMINS'] == 'true'))
     2078    {
     2079      UAM_Copy2Admins($subject,$content);
     2080    }
    19732081  }
    19742082
     
    30653173
    30663174/**
     3175 * UAM_Copy2Admins
     3176 * Send a copy of user's email to admins
     3177 *
     3178 * Param : email subject and content
     3179 */
     3180function UAM_Copy2Admins($subject,$content)
     3181{
     3182  $adminsubject = "[Admins Copy] - ".$subject;
     3183
     3184  pwg_mail_admins(
     3185    array(
     3186      'content' => $content,
     3187      'content_format' => 'text/plain',
     3188      'subject' => $adminsubject,
     3189    )
     3190  );
     3191}
     3192
     3193/**
    30673194 * SetValidated
    30683195 * Set UAM_validated field to true in #_users table
  • extensions/UserAdvManager/trunk/include/upgradedb.inc.php

    r25092 r30776  
    863863  pwg_query($q);
    864864}
     865
     866
     867/* upgrade from 2.51.x to 2.70.3 */
     868/* ***************************** */
     869function upgrade_2510_2703()
     870{
     871  global $conf;
     872 
     873  load_language('plugin.lang', UAM_PATH);
     874
     875  // Upgrading options
     876  // -----------------
     877  $query = '
     878SELECT value
     879  FROM '.CONFIG_TABLE.'
     880WHERE param = "UserAdvManager"
     881;';
     882
     883  $result = pwg_query($query);
     884  $conf_UAM = pwg_db_fetch_assoc($result);
     885   
     886  $Newconf_UAM = unserialize($conf_UAM['value']);
     887
     888  // Add "send a copy of all emails to admins" new option
     889  $Newconf_UAM['EMAILS_COPY_TO_ADMINS'] = 'false';
     890
     891  $update_conf = serialize($Newconf_UAM);
     892
     893  conf_update_param('UserAdvManager', pwg_db_real_escape_string($update_conf));
     894}
    865895?>
  • extensions/UserAdvManager/trunk/language/en_UK/help_config4.lang.php

    r30744 r30776  
    66...
    77';
     8$lang['UAM_Admins_Copy_d'] = 'By enabling this option, all administrators of the gallery will receive a copy of <b style=&quot;color: red;&quot;>all emails</b> sent by the plugin. This can be usefull to check if emails are really sent and to keep a copy in case of dispute. For example, during a registration validation or renewal.<br/><br/>Subjects of copied emails are prefixed with <b style=&quot;color: green;&quot;>&quot;[Admins Copy] - &quot;</b>';
    89$lang['UAM_infomailTitle_d'] = 'This option allows to automate sending an information email to a user when he changes his password or email address in his profile page.<br/><br/>
    910The content of the message sent is composed of a customizable part to introduce a little welcome note and a fixed part indicating the login name, password and email address of the user.';
  • extensions/UserAdvManager/trunk/language/en_UK/plugin.lang.php

    r30746 r30776  
    9292$lang['UAM_ConfirmMail_ReMail_Txt1'] = 'Customizing the reminder message <b><u>with</u></b> new regeneration of confirmation key.';
    9393$lang['UAM_ConfirmMail_ReMail_Txt2'] = 'Customizing the reminder message <b><u>without</u></b> regeneration of confirmation key.';
     94$lang['UAM_Admins_Copy'] = 'Copy of all emails to admins:';
    9495
    9596$lang['UAM_GhostTracker'] = 'Ghost visitors management (Ghost Tracker)';
     
    410411$lang['UAM_Select page size'] = 'Select page size';
    411412$lang['UAM_Select page number'] = 'Select page number';
     413
     414$lang['UAM_NewFeature'] = 'New Feature';
    412415?>
  • extensions/UserAdvManager/trunk/language/fr_FR/help_config4.lang.php

    r30744 r30776  
    66...
    77';
     8$lang['UAM_Admins_Copy_d'] = 'En activant cette option, tous les administrateurs de la galerie seront en copie de <b style=&quot;color: red;&quot;>tous les emails</b> envoyés par le plugin. Permet de vérifier que les emails sont bien envoyés et de conserver une copie en cas de litige. Par exemple, lors d\'une validation d\'inscription ou de relance.<br/><br/>Les sujets de emails en copie sont préfixés par <b style=&quot;color: green;&quot;>&quot;[Admins Copy] - &quot;</b>';
    89$lang['UAM_infomailTitle_d'] = 'Cette option permet d\'automatiser l\'envoi d\'un email d\'information à un utilisateur lorsqu\'il modifie son mot de passe ou son adresse de messagerie dans son profil.<br/><br/>
    910Le message envoyé comprend une partie fixe (login, mot de passe et adresse email de l\'utilisateur) et une partie personnalisable par un texte d\'accueil.';
  • extensions/UserAdvManager/trunk/language/fr_FR/plugin.lang.php

    r30746 r30776  
    9393$lang['UAM_ConfirmMail_ReMail_Txt1'] = 'Texte du message de rappel <b><u>avec</u></b> génération d\'une nouvelle clé de confirmation.';
    9494$lang['UAM_ConfirmMail_ReMail_Txt2'] = 'Texte du message de rappel <b><u>sans</u></b> génération d\'une nouvelle clé de confirmation.';
     95$lang['UAM_Admins_Copy'] = 'Administrateurs en copie des emails envoyés :';
    9596
    9697$lang['UAM_GhostTracker'] = 'Gestion des visiteurs fantômes (Ghost Tracker)';
     
    412413$lang['UAM_Select page size'] = 'Choisir la taille des pages';
    413414$lang['UAM_Select page number'] = 'Sélectionner une page';
     415
     416$lang['UAM_NewFeature'] = 'Nouvelle fonctionnalité';
    414417?>
  • extensions/UserAdvManager/trunk/maintain.inc.php

    r29336 r30776  
    6767    'GTREMINDER_SUBJECT'          => l10n('UAM_Default_GTReminder_Subject'),
    6868    'ADMINVALIDATIONMAIL_SUBJECT' => l10n('UAM_Default_AdminValidationMail_Subject'),
    69     'ADD_GALLERY_URL_TO_EMAILS'   => 'false'
     69    'ADD_GALLERY_URL_TO_EMAILS'   => 'false',
     70    'EMAILS_COPY_TO_ADMINS'       => 'false'
    7071  );
    7172 
     
    404405    {
    405406    /* upgrade from version 2.50.x to 2.51.0 */
    406     /* *************************************** */
     407    /* ************************************* */
    407408      upgrade_2500_2510();
     409    }
     410
     411    if (version_compare($conf['UserAdvManager_Version'], '2.70.3') < 0)
     412    {
     413    /* upgrade from version 2.51.0 to 2.70.3 */
     414    /* ************************************* */
     415      upgrade_2510_2703();
    408416    }
    409417  }
Note: See TracChangeset for help on using the changeset viewer.