Index: extensions/UserAdvManager/branches/2.20/admin/template/ghosttracker.tpl
===================================================================
--- extensions/UserAdvManager/branches/2.20/admin/template/ghosttracker.tpl	(revision 10019)
+++ extensions/UserAdvManager/branches/2.20/admin/template/ghosttracker.tpl	(revision 10145)
@@ -1,4 +1,4 @@
 {combine_script id='jquery' path='themes/default/js/jquery.min.js'}
-{combine_script id='jquery.cluetip' require='jquery' path='themes/default/js/plugins/jquery.cluetip.packed.js'}
+{combine_script id='jquery.cluetip' require='jquery' path='themes/default/js/plugins/jquery.cluetip.js'}
 {combine_script id='jquery.tablesorter' require='jquery' path=$UAM_PATH|@cat:'admin/template/js/jquery.tablesorter.min.js'}
 {combine_script id='jquery.tablesorter.pager' require='jquery' path=$UAM_PATH|@cat:'admin/template/js/jquery.tablesorter.pager.js'}
Index: extensions/UserAdvManager/branches/2.20/admin/template/global.tpl
===================================================================
--- extensions/UserAdvManager/branches/2.20/admin/template/global.tpl	(revision 10019)
+++ extensions/UserAdvManager/branches/2.20/admin/template/global.tpl	(revision 10145)
@@ -1,4 +1,4 @@
 {combine_script id='jquery' path='themes/default/js/jquery.min.js'}
-{combine_script id='jquery.cluetip' require='jquery' path='themes/default/js/plugins/jquery.cluetip.packed.js'}
+{combine_script id='jquery.cluetip' require='jquery' path='themes/default/js/plugins/jquery.cluetip.js'}
 
 {combine_css path= $UAM_PATH|@cat:'admin/template/uam.css'}
@@ -35,5 +35,5 @@
   if (typeof(headerId)=='string')
   {ldelim}
-   if ( headerId.length>  1)
+   if (headerId.length > 1)
        blockToggleDisplay(headerId, contentId) ;
       document.getElementById("nb_para").value =headerId ;
Index: extensions/UserAdvManager/branches/2.20/admin/template/uam.css
===================================================================
--- extensions/UserAdvManager/branches/2.20/admin/template/uam.css	(revision 10019)
+++ extensions/UserAdvManager/branches/2.20/admin/template/uam.css	(revision 10145)
@@ -28,9 +28,5 @@
 }
 
-legend.cluetip
-{
-  font-weight:bold;
-}
-
+/* Bloc expand-collapse instructions */
 .instructionBlock
 {
@@ -40,5 +36,4 @@
 }
 
-/* Bloc expand-collapse instructions */
 .instructionBlockHeaderCollapsed, .instructionBlockHeaderExpanded
 {
Index: extensions/UserAdvManager/branches/2.20/admin/template/userlist.tpl
===================================================================
--- extensions/UserAdvManager/branches/2.20/admin/template/userlist.tpl	(revision 10019)
+++ extensions/UserAdvManager/branches/2.20/admin/template/userlist.tpl	(revision 10145)
@@ -1,4 +1,4 @@
 {combine_script id='jquery' path='themes/default/js/jquery.min.js'}
-{combine_script id='jquery.cluetip' require='jquery' path='themes/default/js/plugins/jquery.cluetip.packed.js'}
+{combine_script id='jquery.cluetip' require='jquery' path='themes/default/js/plugins/jquery.cluetip.js'}
 {combine_script id='jquery.tablesorter' require='jquery' path=$UAM_PATH|@cat:'admin/template/js/jquery.tablesorter.min.js'}
 {combine_script id='jquery.tablesorter.pager' require='jquery' path=$UAM_PATH|@cat:'admin/template/js/jquery.tablesorter.pager.js'}
Index: extensions/UserAdvManager/branches/2.20/admin/template/usermanager.tpl
===================================================================
--- extensions/UserAdvManager/branches/2.20/admin/template/usermanager.tpl	(revision 10019)
+++ extensions/UserAdvManager/branches/2.20/admin/template/usermanager.tpl	(revision 10145)
@@ -1,4 +1,4 @@
 {combine_script id='jquery' path='themes/default/js/jquery.min.js'}
-{combine_script id='jquery.cluetip' require='jquery' path='themes/default/js/plugins/jquery.cluetip.packed.js'}
+{combine_script id='jquery.cluetip' require='jquery' path='themes/default/js/plugins/jquery.cluetip.js'}
 {combine_script id='jquery.tablesorter' require='jquery' path=$UAM_PATH|@cat:'admin/template/js/jquery.tablesorter.min.js'}
 {combine_script id='jquery.tablesorter.pager' require='jquery' path=$UAM_PATH|@cat:'admin/template/js/jquery.tablesorter.pager.js'}
Index: extensions/UserAdvManager/branches/2.20/changelog.txt.php
===================================================================
--- extensions/UserAdvManager/branches/2.20/changelog.txt.php	(revision 10019)
+++ extensions/UserAdvManager/branches/2.20/changelog.txt.php	(revision 10145)
@@ -234,4 +234,7 @@
             Bug 2203 fixed - [username] special flag is not supported in lost password email customization
 
+-- 2.20.1 : Bug 2254 fixed - Plugin installation crashes when installing from scratch
+            Bug 2255 fixed - Error in jQuery path
+
 */
 ?>
Index: extensions/UserAdvManager/branches/2.20/include/functions.inc.php
===================================================================
--- extensions/UserAdvManager/branches/2.20/include/functions.inc.php	(revision 10019)
+++ extensions/UserAdvManager/branches/2.20/include/functions.inc.php	(revision 10145)
@@ -2,4 +2,5 @@
 include_once (UAM_PATH.'include/constants.php');
 load_language('plugin.lang', UAM_PATH);
+
 
 /**
@@ -25,4 +26,5 @@
   return $menu;
 }
+
 
 /**
@@ -78,4 +80,5 @@
 }
 
+
 /**
  * Triggered on register_user
@@ -132,4 +135,5 @@
 }
 
+
 /**
  * Triggered on delete_user
@@ -146,4 +150,5 @@
   DeleteRedir($user_id);
 }
+
 
 /**
@@ -208,4 +213,5 @@
   }
 }
+
 
 /**
@@ -309,4 +315,5 @@
 }
 
+
 /**
  * Triggered on login_success
@@ -548,4 +555,5 @@
 }
 
+
 /**
  * Triggered on UAM_LoginTasks()
@@ -768,4 +776,5 @@
   return $comment_action;
 }
+
 
 /**
@@ -916,17 +925,8 @@
   ));
 
-// **********************
-// Email sending debugger
-// This is only to trace 
-// the send of emails for
-// debugging             
-// **********************
-//$content = (isset($infos1) ? $infos1_perso.l10n_args($infos1)."\n\n" : "").(isset($infos2) ? $infos2_perso.l10n_args($infos2)."\n\n" : "").get_absolute_root_url();   
-//MailLog($email,$subject,$content,$language);
-// **********************
-
 // Switching back to default language
 switch_lang_back();
 }
+
 
 /**
@@ -1034,17 +1034,8 @@
   ));
 
-// **********************
-// Email sending debugger
-// This is only to trace 
-// the send of emails for
-// debugging             
-// **********************
-//$content = ($infos1."\n\n").(isset($infos2) ? l10n_args($infos2)."\n\n" : "").get_absolute_root_url();
-//MailLog($email,$subject,$content,$language);
-// **********************
-
 // Switching back to default language
 switch_lang_back();
 }
+
 
 /**
@@ -1107,17 +1098,8 @@
   ));
 
-// **********************
-// Email sending debugger
-// This is only to trace 
-// the send of emails for
-// debugging             
-// **********************
-//$content = $infos1.get_absolute_root_url();  
-//MailLog($email,$subject,$content,$language);
-// **********************
-
 // Switching back to default language
 switch_lang_back();
 }
+
 
 /**
@@ -1199,17 +1181,8 @@
   ));
 
-// **********************
-// Email sending debugger
-// This is only to trace 
-// the send of emails for
-// debugging             
-// **********************
-//$content = ($custom_txt.l10n_args($infos1)."\n\n".l10n_args($infos2)."\n\n").get_absolute_root_url();   
-//MailLog($email,$subject,$content,$language);
-// **********************
-
 // Switching back to default language
 switch_lang_back();
 }
+
 
 /**
@@ -1291,18 +1264,8 @@
   ));
 
-// **********************
-// Email sending debugger
-// This is only to trace 
-// the send of emails for
-// debugging             
-// **********************
-//$email = $result['mail_address'];
-//$content = (l10n_args($infos)."\n\n".$custom_txt);   
-//MailLog($email,$subject,$content,$language);
-// **********************
-
 // Switching back to default language
 switch_lang_back();
 }
+
 
 /**
@@ -1328,4 +1291,5 @@
   }
 }
+
 
 /**
@@ -1402,4 +1366,5 @@
 }
 
+
 /**
  * Function called from main.inc.php to set group to new users if manual validation is set
@@ -1448,4 +1413,5 @@
 }
 
+
 /**
  * Function called from UAM_admin.php to reset validation key
@@ -1484,4 +1450,5 @@
 }
 
+
 /**
  * Function called from functions.inc.php to reset last visit date after sending a reminder
@@ -1530,4 +1497,5 @@
   pwg_query($query);
 }
+
 
 /**
@@ -1560,4 +1528,5 @@
   pwg_query($query);
 }
+
 
 /**
@@ -1737,4 +1706,5 @@
 }
 
+
 /**
  * Function called from UAM_admin.php to force users validation by admin
@@ -1842,4 +1812,5 @@
 }
 
+
 /**
  * Function called from main.inc.php - Check if username matches forbidden caracters
@@ -1873,4 +1844,5 @@
   }
 }
+
 
 /**
@@ -1906,4 +1878,5 @@
   }
 }
+
 
 /**
@@ -2002,4 +1975,5 @@
 }
 
+
 /**
  * Function called from functions.inc.php - Get all users who haven't validate their registration in configured time
@@ -2038,4 +2012,5 @@
 	return $users;
 }
+
 
 /**
@@ -2167,4 +2142,5 @@
 }
 
+
 /**
  * Function called from UAM_admin.php - to determine who is expired or not and giving a different display color
@@ -2299,4 +2275,5 @@
 }
 
+
 /**
  * Function called from maintain.inc.php - to check if database upgrade is needed
@@ -2313,16 +2290,4 @@
 }
 
-// Email sending debugger function
-function MailLog($to, $subject, $content, $language)
-{
-   $fo=fopen (UAM_PATH.'admin/maillog.txt','a') ;
-   fwrite($fo,"======================\n") ;
-   fwrite($fo,'le ' . date('D, d M Y H:i:s') . "\r\n");
-   fwrite($fo,$to . "\n" . $subject . "\r\n") ;
-   fwrite($fo, "\n" . $content . "\r\n") ;
-   fwrite($fo, 'Langue : '."\n" . $language . "\r\n") ;
-   fclose($fo) ;
-   //return mail ($to,$subject) ;
-}
 
 /**
@@ -2379,4 +2344,9 @@
 
 
+/**
+ * Delete obsolete files on plugin upgrade
+ * Obsolete files are listed in file obsolete.list
+ *
+ */
 function clean_obsolete_files()
 {
@@ -2397,4 +2367,5 @@
 }
 
+
 /**
  * UAM_check_profile - Thx to LucMorizur
@@ -2429,3 +2400,21 @@
   return $v;
 }
+
+
+/**
+ * Useful for debugging - 4 vars can be set
+ * Output result to log.txt file
+ *
+ */
+function UAMLog($var1, $var2, $var3, $var4)
+{
+   $fo=fopen (UAM_PATH.'log.txt','a') ;
+   fwrite($fo,"======================\n") ;
+   fwrite($fo,'le ' . date('D, d M Y H:i:s') . "\r\n");
+   fwrite($fo,$var1 ."\r\n") ;
+   fwrite($fo,$var2 ."\r\n") ;
+   fwrite($fo,$var3 ."\r\n") ;
+   fwrite($fo,$var4 ."\r\n") ;
+   fclose($fo) ;
+}
 ?>
Index: extensions/UserAdvManager/branches/2.20/include/upgradedb.inc.php
===================================================================
--- extensions/UserAdvManager/branches/2.20/include/upgradedb.inc.php	(revision 10019)
+++ extensions/UserAdvManager/branches/2.20/include/upgradedb.inc.php	(revision 10145)
@@ -19,4 +19,28 @@
 // |       Upgrading database from old plugin versions        |
 // +----------------------------------------------------------+
+
+
+/* *************************************** */
+/* Update plugin version in conf table     */
+/* Used everytime a new version is updated */
+/* even if no database upgrade is needed   */
+/* *************************************** */
+function UAM_version_update()
+{  
+  // Get current plugin version
+  $plugin =  PluginInfos(UAM_PATH);
+  $version = $plugin['version'];
+  
+  // Update plugin version 
+  $query = '
+UPDATE '.CONFIG_TABLE.'
+SET value="'.$version.'"
+WHERE param="UserAdvManager_Version"
+LIMIT 1
+;';
+
+  pwg_query($query);
+}
+
 
 /* upgrade from branch 2.10 to 2.11 */
@@ -153,4 +177,5 @@
 }
 
+
 /* upgrade from branch 2.14 to 2.15 */
 /* ******************************** */
@@ -202,4 +227,5 @@
     upgrade_2153_2154();
 }
+
 
 /* upgrade from 2.15.3 to 2.15.4 */
@@ -263,4 +289,5 @@
 }
 
+
 /* upgrade from 2.15.x to 2.16.0 */
 /* ***************************** */
@@ -316,6 +343,4 @@
   global $conf;
 
-  $uam_new_version = "2.20.0";
-
   // Upgrading options
   $query = '
@@ -348,15 +373,7 @@
 	pwg_query($query);
 
-  // Update plugin version 
-  $query = '
-UPDATE '.CONFIG_TABLE.'
-SET value="'.$uam_new_version.'"
-WHERE param="UserAdvManager_Version"
-LIMIT 1
-;';
-
-  pwg_query($query);
-
-  // Create new UAM entry in plugins table 
+  // Create new UAM entry in plugins table
+  $uam_new_version = "2.20.0";
+
   $query = '
 INSERT INTO '.PLUGINS_TABLE.' (id, state, version)
Index: extensions/UserAdvManager/branches/2.20/main.inc.php
===================================================================
--- extensions/UserAdvManager/branches/2.20/main.inc.php	(revision 10019)
+++ extensions/UserAdvManager/branches/2.20/main.inc.php	(revision 10145)
@@ -2,5 +2,5 @@
 /*
 Plugin Name: UserAdvManager
-Version: 2.20.0
+Version: 2.20.1
 Description: Renforcer la gestion des utilisateurs - Enforce users management
 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=216
Index: extensions/UserAdvManager/branches/2.20/maintain.inc.php
===================================================================
--- extensions/UserAdvManager/branches/2.20/maintain.inc.php	(revision 10019)
+++ extensions/UserAdvManager/branches/2.20/maintain.inc.php	(revision 10145)
@@ -238,13 +238,5 @@
 /* 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')
+  if (isset($conf['UserAdvManager_Version']) and $conf['UserAdvManager_Version'] != '2.16.0')
   {
     /* upgrade from branch 2.16 to 2.20 */
@@ -253,5 +245,7 @@
   }
 
-load_conf_from_db('param like \'UserAdvManager\\_%\'');
+  UAM_version_update();
+
+  load_conf_from_db('param like \'UserAdvManager\\_%\'');
 }
 
