Changeset 9136


Ignore:
Timestamp:
Feb 9, 2011, 9:39:22 PM (10 years ago)
Author:
Eric
Message:

Bug 1666 merged from trunk to branch 2.20

Location:
extensions/NBC_UserAdvManager/branches/2.20
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • extensions/NBC_UserAdvManager/branches/2.20/admin/UAM_admin.php

    r8841 r9136  
    105105  case 'global':
    106106
    107         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_No_Comment_Anonymous']) and isset($_POST['UAM_Password_Enforced']) and isset($_POST['UAM_AdminPassword_Enforced']) and isset($_POST['UAM_GhostUser_Tracker']) and isset($_POST['UAM_Admin_ConfMail']) and isset($_POST['UAM_RedirToProfile']) and isset($_POST['UAM_GTAuto']))
     107        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_No_Comment_Anonymous']) and isset($_POST['UAM_Password_Enforced']) and isset($_POST['UAM_AdminPassword_Enforced']) 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_CustomPasswRetr']))
    108108  {
    109109
     
    118118
    119119    $_POST['UAM_GTAutoMailText'] = str_replace('\"', '"', str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_GTAutoMailText'])));
    120    
     120
    121121    $_POST['UAM_AdminValidationMail_Text'] = str_replace('\"', '"', str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_AdminValidationMail_Text'])));
     122
     123    $_POST['UAM_CustomPasswRetr_Text'] = str_replace('\"', '"', str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_CustomPasswRetr_Text'])));
    122124
    123125    //Check if CR-LF exist at begining and end of mail exclusion list - If yes, removes them
     
    167169      (isset($_POST['UAM_Downgrade_Group'])?$_POST['UAM_Downgrade_Group']:''),
    168170      (isset($_POST['UAM_Downgrade_Status'])?$_POST['UAM_Downgrade_Status']:''),
    169       $_POST['UAM_AdminValidationMail_Text']
     171      $_POST['UAM_AdminValidationMail_Text'],
     172      $_POST['UAM_CustomPasswRetr'],
     173      $_POST['UAM_CustomPasswRetr_Text']
    170174      );
    171175
     
    405409                'UAM_Downgrade_Status'           => $conf_UAM[27],
    406410    'UAM_ADMINVALIDATIONMAIL_TEXT'   => $conf_UAM[28],
     411    'UAM_CUSTOMPASSWRETR_TRUE'       => $conf_UAM[29]=='true' ?  'checked="checked"' : '' ,
     412    'UAM_CUSTOMPASSWRETR_FALSE'      => $conf_UAM[29]=='false' ?  'checked="checked"' : '' ,
     413    'UAM_CUSTOMPASSWRETR_TEXT'       => $conf_UAM[30],
    407414                'UAM_PASSWORD_TEST_SCORE'        => $UAM_Password_Test_Score,
    408415    'UAM_ERROR_REPORTS4'             => $UAM_Exclusionlist_Error,
  • extensions/NBC_UserAdvManager/branches/2.20/admin/template/global.tpl

    r8841 r9136  
    514514            <input type="radio" value="true" {$UAM_REDIRTOPROFILE_TRUE} name="UAM_RedirToProfile">{'UAM_RedirToProfile_true'|@translate}<br><br>
    515515          </li>
     516
     517          <br><hr><br>
     518
     519          <li><label class="cluetip" title="{'UAM_CustomPasswRetrTitle'|translate}|{'UAM_CustomPasswRetrTitle_d'|translate}">{'UAM_CustomPasswRetr'|@translate}</label><br><br>
     520            <input type="radio" value="false" {$UAM_CUSTOMPASSWRETR_FALSE} name="UAM_CustomPasswRetr">{'UAM_CustomPasswRetr_false'|@translate}<br>
     521            <input type="radio" value="true" {$UAM_CUSTOMPASSWRETR_TRUE} name="UAM_CustomPasswRetr">{'UAM_CustomPasswRetr_true'|@translate}<br>
     522          <br><br>
     523            <textarea class="uam_textfields" name="UAM_CustomPasswRetr_Text" id="UAM_CustomPasswRetr_Text" rows="10" {$TAG_INPUT_ENABLED}>{$UAM_CUSTOMPASSWRETR_TEXT}</textarea>
     524          <br><br>
     525          </li>
    516526        </ul>
    517527      </fieldset>
  • extensions/NBC_UserAdvManager/branches/2.20/changelog.txt.php

    r8094 r9136  
    219219            Add of Latvian (lv_LV) translation (Thx to Aivars Baldone)
    220220
     221**************************************************************
     222***** Plugin history (branch 2.20 - Piwigo 2.2 compliant)*****
     223**************************************************************
     224-- 2.20.0 : Compliance with Piwigo 2.2
     225            Bug 1666 fixed - Customizing "lost password" email
     226            Bug 2072 fixed - Remove sort on "difference in days" in user tracking tab
     227            Bug 2140 fixed - English sentence corrections
     228            Bug
     229
    221230*/
    222231?>
  • extensions/NBC_UserAdvManager/branches/2.20/include/functions.inc.php

    r8841 r9136  
    636636}
    637637
     638
     639/**
     640 * Triggered on render_lost_password_mail_content
     641 *
     642 * Adds a customized text in lost password email content
     643 * Added text is inserted before users login name and new password
     644 *
     645 * @param : Standard Piwigo email content
     646 *
     647 * @return : Customized content added to standard content
     648 *
     649 */
     650function UAM_lost_password_mail_content($infos)
     651{
     652  global $conf;
     653 
     654  load_language('plugin.lang', UAM_PATH);
     655 
     656  $conf_UAM = unserialize($conf['UserAdvManager']);
     657 
     658  if (isset($conf_UAM[29]) and $conf_UAM[29] == 'true')
     659  {
     660    $infos = $conf_UAM[30]."\n"."\n".$infos;
     661  }
     662  return $infos;
     663}
     664
     665
    638666/**
    639667 * Triggered on user_comment_check
  • extensions/NBC_UserAdvManager/branches/2.20/include/upgradedb.inc.php

    r8092 r9136  
    312312  pwg_query($query);
    313313}
     314
     315
     316/* upgrade from 2.16.x to 2.20.0 */
     317/* ***************************** */
     318function upgrade_216_220()
     319{
     320  global $conf;
     321
     322  $uam_new_version = "2.20.0";
     323
     324  // Upgrading options
     325  $query = '
     326SELECT value
     327  FROM '.CONFIG_TABLE.'
     328WHERE param = "UserAdvManager"
     329;';
     330
     331  $result = pwg_query($query);
     332  $conf_UAM = pwg_db_fetch_assoc($result);
     333   
     334  $Newconf_UAM = unserialize($conf_UAM['value']);
     335 
     336  $Newconf_UAM[29] = 'false';
     337  $Newconf_UAM[30] = 'You have requested a password reset on our gallery. Please, find below your new connection settings.';
     338 
     339  $update_conf = serialize($Newconf_UAM);
     340   
     341  $query = '
     342UPDATE '.CONFIG_TABLE.'
     343SET value="'.addslashes($update_conf).'"
     344WHERE param="UserAdvManager"
     345LIMIT 1
     346;';
     347
     348        pwg_query($query);
     349
     350  // Update plugin version
     351  $query = '
     352UPDATE '.CONFIG_TABLE.'
     353SET value="'.$uam_new_version.'"
     354WHERE param="UserAdvManager_Version"
     355LIMIT 1
     356;';
     357 
     358  pwg_query($query);
     359}
    314360?>
  • extensions/NBC_UserAdvManager/branches/2.20/main.inc.php

    r8110 r9136  
    4949add_event_handler('login_success', 'UAM_LoginTasks');
    5050
     51// Adding customized text to lost password email
     52add_event_handler('render_lost_password_mail_content', 'UAM_lost_password_mail_content');
    5153
    5254// *** Important ! This is necessary to make email exclusion work in admin's users management panel ***
  • extensions/NBC_UserAdvManager/branches/2.20/maintain.inc.php

    r9091 r9136  
    2626Best regards,
    2727
    28 The admin of the gallery.','false','false','false','false','false','Sorry, your account has been deleted due to a too long time passed since your last visit.','Sorry, your account has been deprecated due to a too long time passed since your last visit. Please, use the following link to revalidate your account.',-1,-1,'Thank you for registering at _name_of_site_. Your account has been manually validated by _admin_. You may now log in at _link_to_site_ and make any appropriate changes to your profile. Welcome to _name_of_site_!');
     28The admin of the gallery.','false','false','false','false','false','Sorry, your account has been deleted due to a too long time passed since your last visit.','Sorry, your account has been deprecated due to a too long time passed since your last visit. Please, use the following link to revalidate your account.',-1,-1,'Thank you for registering at _name_of_site_. Your account has been manually validated by _admin_. You may now log in at _link_to_site_ and make any appropriate changes to your profile. Welcome to _name_of_site_!','false','You have requested a password reset on our gallery. Please, find below your new connection settings.');
    2929
    3030  $q = '
     
    196196  }
    197197
     198/* Check for upgrade from 2.16 to 2.20 */
     199/* *********************************** */
     200        $query = '
     201SELECT value
     202  FROM '.CONFIG_TABLE.'
     203WHERE param = "UserAdvManager_Version"
     204;';
     205
     206  $data = pwg_db_fetch_assoc(pwg_query($query));
     207 
     208  if ($data['value'] != '2.20.0')
     209  {
     210    /* upgrade from branch 2.16 to 2.20 */
     211    /* ******************************** */
     212    upgrade_216_220();
     213  }
     214
    198215load_conf_from_db('param like \'UserAdvManager\\_%\'');
    199216}
Note: See TracChangeset for help on using the changeset viewer.