Index: /extensions/NBC_UserAdvManager/branches/2.20/changelog.txt.php
===================================================================
--- /extensions/NBC_UserAdvManager/branches/2.20/changelog.txt.php (revision 9135)
+++ /extensions/NBC_UserAdvManager/branches/2.20/changelog.txt.php (revision 9136)
@@ -219,4 +219,13 @@
Add of Latvian (lv_LV) translation (Thx to Aivars Baldone)
+**************************************************************
+***** Plugin history (branch 2.20 - Piwigo 2.2 compliant)*****
+**************************************************************
+-- 2.20.0 : Compliance with Piwigo 2.2
+ Bug 1666 fixed - Customizing "lost password" email
+ Bug 2072 fixed - Remove sort on "difference in days" in user tracking tab
+ Bug 2140 fixed - English sentence corrections
+ Bug
+
*/
?>
Index: /extensions/NBC_UserAdvManager/branches/2.20/include/functions.inc.php
===================================================================
--- /extensions/NBC_UserAdvManager/branches/2.20/include/functions.inc.php (revision 9135)
+++ /extensions/NBC_UserAdvManager/branches/2.20/include/functions.inc.php (revision 9136)
@@ -636,4 +636,32 @@
}
+
+/**
+ * Triggered on render_lost_password_mail_content
+ *
+ * Adds a customized text in lost password email content
+ * Added text is inserted before users login name and new password
+ *
+ * @param : Standard Piwigo email content
+ *
+ * @return : Customized content added to standard content
+ *
+ */
+function UAM_lost_password_mail_content($infos)
+{
+ global $conf;
+
+ load_language('plugin.lang', UAM_PATH);
+
+ $conf_UAM = unserialize($conf['UserAdvManager']);
+
+ if (isset($conf_UAM[29]) and $conf_UAM[29] == 'true')
+ {
+ $infos = $conf_UAM[30]."\n"."\n".$infos;
+ }
+ return $infos;
+}
+
+
/**
* Triggered on user_comment_check
Index: /extensions/NBC_UserAdvManager/branches/2.20/include/upgradedb.inc.php
===================================================================
--- /extensions/NBC_UserAdvManager/branches/2.20/include/upgradedb.inc.php (revision 9135)
+++ /extensions/NBC_UserAdvManager/branches/2.20/include/upgradedb.inc.php (revision 9136)
@@ -312,3 +312,49 @@
pwg_query($query);
}
+
+
+/* upgrade from 2.16.x to 2.20.0 */
+/* ***************************** */
+function upgrade_216_220()
+{
+ global $conf;
+
+ $uam_new_version = "2.20.0";
+
+ // Upgrading options
+ $query = '
+SELECT value
+ FROM '.CONFIG_TABLE.'
+WHERE param = "UserAdvManager"
+;';
+
+ $result = pwg_query($query);
+ $conf_UAM = pwg_db_fetch_assoc($result);
+
+ $Newconf_UAM = unserialize($conf_UAM['value']);
+
+ $Newconf_UAM[29] = 'false';
+ $Newconf_UAM[30] = 'You have requested a password reset on our gallery. Please, find below your new connection settings.';
+
+ $update_conf = serialize($Newconf_UAM);
+
+ $query = '
+UPDATE '.CONFIG_TABLE.'
+SET value="'.addslashes($update_conf).'"
+WHERE param="UserAdvManager"
+LIMIT 1
+;';
+
+ pwg_query($query);
+
+ // Update plugin version
+ $query = '
+UPDATE '.CONFIG_TABLE.'
+SET value="'.$uam_new_version.'"
+WHERE param="UserAdvManager_Version"
+LIMIT 1
+;';
+
+ pwg_query($query);
+}
?>
Index: /extensions/NBC_UserAdvManager/branches/2.20/main.inc.php
===================================================================
--- /extensions/NBC_UserAdvManager/branches/2.20/main.inc.php (revision 9135)
+++ /extensions/NBC_UserAdvManager/branches/2.20/main.inc.php (revision 9136)
@@ -49,4 +49,6 @@
add_event_handler('login_success', 'UAM_LoginTasks');
+// Adding customized text to lost password email
+add_event_handler('render_lost_password_mail_content', 'UAM_lost_password_mail_content');
// *** Important ! This is necessary to make email exclusion work in admin's users management panel ***
Index: /extensions/NBC_UserAdvManager/branches/2.20/maintain.inc.php
===================================================================
--- /extensions/NBC_UserAdvManager/branches/2.20/maintain.inc.php (revision 9135)
+++ /extensions/NBC_UserAdvManager/branches/2.20/maintain.inc.php (revision 9136)
@@ -26,5 +26,5 @@
Best regards,
-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_!');
+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_!','false','You have requested a password reset on our gallery. Please, find below your new connection settings.');
$q = '
@@ -196,4 +196,21 @@
}
+/* Check for upgrade from 2.16 to 2.20 */
+/* *********************************** */
+ $query = '
+SELECT value
+ FROM '.CONFIG_TABLE.'
+WHERE param = "UserAdvManager_Version"
+;';
+
+ $data = pwg_db_fetch_assoc(pwg_query($query));
+
+ if ($data['value'] != '2.20.0')
+ {
+ /* upgrade from branch 2.16 to 2.20 */
+ /* ******************************** */
+ upgrade_216_220();
+ }
+
load_conf_from_db('param like \'UserAdvManager\\_%\'');
}