Index: /extensions/UserAdvManager/trunk/admin/UAM_admin.php
===================================================================
--- /extensions/UserAdvManager/trunk/admin/UAM_admin.php	(revision 21074)
+++ /extensions/UserAdvManager/trunk/admin/UAM_admin.php	(revision 21075)
@@ -179,5 +179,5 @@
     // Check if [Kdays] flag is used in a legal way (ConfirmMail Time out have to be set)
     // ----------------------------------------------------------------------------------
-    if (isset($conf_UAM_ConfirmMail[0]) and $conf_UAM_ConfirmMail[0] == 'false' and preg_match('#\[Kdays\]#i',$_POST['UAM_ConfirmMail_Text']) != 0)
+    if (isset($conf_UAM_ConfirmMail['CONFIRMMAIL_TIMEOUT']) and $conf_UAM_ConfirmMail['CONFIRMMAIL_TIMEOUT'] == 'false' and preg_match('#\[Kdays\]#i',$_POST['UAM_ConfirmMail_Text']) != 0)
     {
       $UAM_Illegal_Flag_Error1 = true;
@@ -187,57 +187,55 @@
     // Save global UAM configuration
     // -----------------------------
-    $newconf_UAM = array(
-      $_POST['UAM_Mail_Info'],
-      $_POST['UAM_Confirm_Mail'],
-      (isset($_POST['UAM_No_Confirm_Group'])?$_POST['UAM_No_Confirm_Group']:''),
-      (isset($_POST['UAM_Validated_Group'])?$_POST['UAM_Validated_Group']:''),
-      (isset($_POST['UAM_Validated_Status'])?$_POST['UAM_Validated_Status']:''),
-      $_POST['UAM_Username_Char'],
-      $_POST['UAM_Username_List'],
-      (isset($_POST['UAM_No_Confirm_Status'])?$_POST['UAM_No_Confirm_Status']:''),
-      $_POST['UAM_MailInfo_Text'],
-      $_POST['UAM_ConfirmMail_Text'],
-      $_POST['UAM_MailExclusion'],
-      $_POST['UAM_MailExclusion_List'],
-      $_POST['UAM_Password_Enforced'],
-      $_POST['UAM_Password_Score'],
-      $_POST['UAM_AdminPassword_Enforced'],
-      $_POST['UAM_GhostUser_Tracker'],
-      $_POST['UAM_GhostTracker_DayLimit'],
-      $_POST['UAM_GhostTracker_ReminderText'],
-      $_POST['UAM_Add_LastVisit_Column'],
-      $_POST['UAM_Admin_ConfMail'],
-      $_POST['UAM_RedirToProfile'],
-      $_POST['UAM_GTAuto'],
-      $_POST['UAM_GTAutoMail'],
-      $_POST['UAM_GTAutoDelText'],
-      $_POST['UAM_GTAutoMailText'],
-      (isset($_POST['UAM_Downgrade_Group'])?$_POST['UAM_Downgrade_Group']:''),
-      (isset($_POST['UAM_Downgrade_Status'])?$_POST['UAM_Downgrade_Status']:''),
-      $_POST['UAM_AdminValidationMail_Text'],
-      $_POST['UAM_CustomPasswRetr'],
-      $_POST['UAM_CustomPasswRetr_Text'],
-      $_POST['UAM_USRAuto'],
-      $_POST['UAM_USRAutoDelText'],
-      $_POST['UAM_USRAutoMail'],
-      $_POST['UAM_Stuffs'],
-      $_POST['UAM_HidePassw'],
-      (isset($_POST['UAM_No_Valid_Level'])?$_POST['UAM_No_Valid_Level']:''),
-      (isset($_POST['UAM_Valid_Level'])?$_POST['UAM_Valid_Level']:''),
-      (isset($_POST['UAM_Downgrade_Level'])?$_POST['UAM_Downgrade_Level']:''),
-      $_POST['UAM_PwdReset'],
-      $_POST['UAM_RejectConnexion'],
-      $_POST['UAM_CustomRejectConnexion_Text'],
-      $_POST['UAM_ConfirmMail_Subject'],
-      $_POST['UAM_ConfirmMail_Remail_Subject'],
-      $_POST['UAM_InfoMail_Subject'],
-      $_POST['UAM_GTAutoMail_Subject'],
-      $_POST['UAM_GTReminder_Subject'],
-      $_POST['UAM_AdminValidationMail_Subject'],
-    );
+    $newconf_UAM['MAIL_INFO'] = (isset($_POST['UAM_Mail_Info']) ? $_POST['UAM_Mail_Info'] : 'false');
+    $newconf_UAM['CONFIRM_MAIL'] = (isset($_POST['UAM_Confirm_Mail']) ? $_POST['UAM_Confirm_Mail'] : 'false');
+    $newconf_UAM['NO_CONFIRM_GROUP'] = (isset($_POST['UAM_No_Confirm_Group']) ? $_POST['UAM_No_Confirm_Group'] : '');
+    $newconf_UAM['VALIDATED_GROUP'] = (isset($_POST['UAM_Validated_Group']) ? $_POST['UAM_Validated_Group'] : '');
+    $newconf_UAM['VALIDATED_STATUS'] = (isset($_POST['UAM_Validated_Status'])?$_POST['UAM_Validated_Status'] : '');
+    $newconf_UAM['USERNAME_CHAR'] = $_POST['UAM_Username_Char'];
+    $newconf_UAM['USERNAME_CHAR_LIST'] = (isset($_POST['UAM_Username_List']) ? $_POST['UAM_Username_List'] : '');
+    $newconf_UAM['NO_CONFIRM_STATUS'] = (isset($_POST['UAM_No_Confirm_Status']) ? $_POST['UAM_No_Confirm_Status'] : '');
+    $newconf_UAM['MAILINFO_TEXT'] = (isset($_POST['UAM_MailInfo_Text']) ? $_POST['UAM_MailInfo_Text'] : l10n('UAM_Default_InfoMail_Txt'));
+    $newconf_UAM['CONFIRMMAIL_TEXT'] = (isset($_POST['UAM_ConfirmMail_Text']) ? $_POST['UAM_ConfirmMail_Text'] : l10n('UAM_Default_ConfirmMail_Txt'));
+    $newconf_UAM['MAILEXCLUSION'] = (isset($_POST['UAM_MailExclusion']) ? $_POST['UAM_MailExclusion'] : 'false');
+    $newconf_UAM['MAILEXCLUSION_LIST'] = (isset($_POST['UAM_MailExclusion_List']) ? $_POST['UAM_MailExclusion_List'] : '');
+    $newconf_UAM['PASSWORDENF'] = (isset($_POST['UAM_Password_Enforced']) ? $_POST['UAM_Password_Enforced'] : 'false');
+    $newconf_UAM['PASSWORD_SCORE'] = (isset($_POST['UAM_Password_Score']) ? $_POST['UAM_Password_Score'] : '100');
+    $newconf_UAM['ADMINPASSWENF'] = (isset($_POST['UAM_AdminPassword_Enforced']) ? $_POST['UAM_AdminPassword_Enforced'] : 'false');
+    $newconf_UAM['GHOSTRACKER'] = (isset($_POST['UAM_GhostUser_Tracker']) ? $_POST['UAM_GhostUser_Tracker'] : 'false');
+    $newconf_UAM['GHOSTRACKER_DAYLIMIT'] = (isset($_POST['UAM_GhostTracker_DayLimit']) ? $_POST['UAM_GhostTracker_DayLimit'] : '10');
+    $newconf_UAM['GHOSTRACKER_REMINDERTEXT'] = (isset($_POST['UAM_GhostTracker_ReminderText']) ? $_POST['UAM_GhostTracker_ReminderText'] : l10n('UAM_Default_GhstReminder_Txt'));
+    $newconf_UAM['ADDLASTVISIT'] = (isset($_POST['UAM_Add_LastVisit_Column']) ? $_POST['UAM_Add_LastVisit_Column'] : 'false');
+    $newconf_UAM['ADMINCONFMAIL'] = (isset($_POST['UAM_Admin_ConfMail']) ? $_POST['UAM_Admin_ConfMail'] : 'false');
+    $newconf_UAM['REDIRTOPROFILE'] = (isset($_POST['UAM_RedirToProfile']) ? $_POST['UAM_RedirToProfile'] : 'false');
+    $newconf_UAM['GTAUTO'] = (isset($_POST['UAM_GTAuto']) ? $_POST['UAM_GTAuto'] : 'false');
+    $newconf_UAM['GTAUTOMAIL'] = (isset($_POST['UAM_GTAutoMail']) ? $_POST['UAM_GTAutoMail'] : 'false');
+    $newconf_UAM['GTAUTODEL'] = (isset($_POST['UAM_GTAutoDelText']) ? $_POST['UAM_GTAutoDelText'] : l10n('UAM_Default_GhstDeletion_Txt'));
+    $newconf_UAM['GTAUTOMAILTEXT'] = (isset($_POST['UAM_GTAutoMailText']) ? $_POST['UAM_GTAutoMailText'] : l10n('UAM_Default_GhstDemotion_Txt'));
+    $newconf_UAM['DOWNGRADE_GROUP'] = (isset($_POST['UAM_Downgrade_Group']) ? $_POST['UAM_Downgrade_Group'] : '');
+    $newconf_UAM['DOWNGRADE_STATUS'] = (isset($_POST['UAM_Downgrade_Status']) ? $_POST['UAM_Downgrade_Status'] : '');
+    $newconf_UAM['ADMINVALIDATIONMAIL'] = (isset($_POST['UAM_AdminValidationMail_Text']) ? $_POST['UAM_AdminValidationMail_Text'] : l10n('UAM_Default_AdminValidation_Txt'));
+    $newconf_UAM['CUSTOMPASSWRETR'] = (isset($_POST['UAM_CustomPasswRetr']) ? $_POST['UAM_CustomPasswRetr'] : 'false');
+    $newconf_UAM['CUSTOMPASSWRETR_TEXT'] = (isset($_POST['UAM_CustomPasswRetr_Text']) ? $_POST['UAM_CustomPasswRetr_Text'] : l10n('UAM_Default_PwdRequest_Txt'));
+    $newconf_UAM['USRAUTO'] = (isset($_POST['UAM_USRAuto']) ? $_POST['UAM_USRAuto'] : 'false');
+    $newconf_UAM['USRAUTODEL'] = (isset($_POST['UAM_USRAutoDelText']) ? $_POST['UAM_USRAutoDelText'] : l10n('UAM_Default_ValidationTimeout_Txt'));
+    $newconf_UAM['USRAUTOMAIL'] = (isset($_POST['UAM_USRAutoMail']) ? $_POST['UAM_USRAutoMail'] : 'false');
+    $newconf_UAM['STUFFS'] = (isset($_POST['UAM_Stuffs']) ? $_POST['UAM_Stuffs'] : 'false');
+    $newconf_UAM['HIDEPASSW'] = (isset($_POST['UAM_HidePassw']) ? $_POST['UAM_HidePassw'] : 'false');
+    $newconf_UAM['NO_VALID_LEVEL'] = (isset($_POST['UAM_No_Valid_Level']) ? $_POST['UAM_No_Valid_Level'] : '');
+    $newconf_UAM['VALID_LEVEL'] = (isset($_POST['UAM_Valid_Level']) ? $_POST['UAM_Valid_Level'] : '');
+    $newconf_UAM['DOWNGRADE_LEVEL'] = (isset($_POST['UAM_Downgrade_Level']) ? $_POST['UAM_Downgrade_Level'] : '');
+    $newconf_UAM['PWDRESET'] = (isset($_POST['UAM_PwdReset']) ? $_POST['UAM_PwdReset'] : 'false');
+    $newconf_UAM['REJECTCONNECT'] = (isset($_POST['UAM_RejectConnexion']) ? $_POST['UAM_RejectConnexion'] : 'false');
+    $newconf_UAM['REJECTCONNECT_TEXT'] = (isset($_POST['UAM_CustomRejectConnexion_Text']) ? $_POST['UAM_CustomRejectConnexion_Text'] : l10n('UAM_Default_RejectConnexion_Txt'));
+    $newconf_UAM['CONFIRMMAIL_SUBJECT'] = (isset($_POST['UAM_ConfirmMail_Subject']) ? $_POST['UAM_ConfirmMail_Subject'] : l10n('UAM_Default_ConfirmMail_Subject'));
+    $newconf_UAM['CONFIRMMAIL_REMAIL_SUBJECT'] = (isset($_POST['UAM_ConfirmMail_Remail_Subject']) ? $_POST['UAM_ConfirmMail_Remail_Subject'] : l10n('UAM_Default_ConfirmMail_Remail_Subject'));
+    $newconf_UAM['INFOMAIL_SUBJECT'] = (isset($_POST['UAM_InfoMail_Subject']) ? $_POST['UAM_InfoMail_Subject'] : l10n('UAM_Default_InfoMail_Subject'));
+    $newconf_UAM['GTAUTOMAIL_SUBJECT'] = (isset($_POST['UAM_GTAutoMail_Subject']) ? $_POST['UAM_GTAutoMail_Subject'] : l10n('UAM_Default_GTAutoMail_Subject'));
+    $newconf_UAM['GTREMINDER_SUBJECT'] = (isset($_POST['UAM_GTReminder_Subject']) ? $_POST['UAM_GTReminder_Subject'] : l10n('UAM_Default_GTReminder_Subject'));
+    $newconf_UAM['ADMINVALIDATIONMAIL_SUBJECT'] = (isset($_POST['UAM_AdminValidationMail_Subject']) ? $_POST['UAM_AdminValidationMail_Subject'] : l10n('UAM_Default_AdminValidationMail_Subject'));
 
     $conf['UserAdvManager'] = serialize($newconf_UAM);
 
-    conf_update_param('UserAdvManager', pwg_db_real_escape_string($conf['UserAdvManager']));
+    conf_update_param('UserAdvManager', pwg_db_real_escape_string($conf['UserAdvManager'])); 
 
     // Email confirmation settings
@@ -253,10 +251,10 @@
     // Check if [Kdays] flag is used in a legal way (ConfirmMail Time out have to be set)
     // ----------------------------------------------------------------------------------
-    if (isset($conf_UAM_ConfirmMail[0]) and $conf_UAM_ConfirmMail[0] == 'false' and preg_match('#\[Kdays\]#i',$_POST['UAM_ConfirmMail_ReMail_Txt1']) == 1)
+    if (isset($conf_UAM_ConfirmMail['CONFIRMMAIL_TIMEOUT']) and $conf_UAM_ConfirmMail['CONFIRMMAIL_TIMEOUT'] == 'false' and preg_match('#\[Kdays\]#i',$_POST['UAM_ConfirmMail_ReMail_Txt1']) == 1)
     {
       $UAM_Illegal_Flag_Error2 = true;
       array_push($page['errors'], l10n('UAM_Error_Using_illegal_flag'));
     }
-    elseif (isset($conf_UAM_ConfirmMail[0]) and $conf_UAM_ConfirmMail[0] == 'false' and preg_match('#\[Kdays\]#i',$_POST['UAM_ConfirmMail_ReMail_Txt2']) == 1)
+    elseif (isset($conf_UAM_ConfirmMail['CONFIRMMAIL_TIMEOUT']) and $conf_UAM_ConfirmMail['CONFIRMMAIL_TIMEOUT'] == 'false' and preg_match('#\[Kdays\]#i',$_POST['UAM_ConfirmMail_ReMail_Txt2']) == 1)
     {
       $UAM_Illegal_Flag_Error3 = true;
@@ -266,13 +264,11 @@
     // Save ConfirmMail settings
     // -------------------------
-    $newconf_UAM_ConfirmMail = array (
-      $_POST['UAM_ConfirmMail_TimeOut'],
-      $_POST['UAM_ConfirmMail_Delay'],
-      $_POST['UAM_ConfirmMail_ReMail_Txt1'],
-      $_POST['UAM_ConfirmMail_Remail'],
-      $_POST['UAM_ConfirmMail_ReMail_Txt2'],
-      $_POST['UAM_ConfirmMail_Custom_Txt1'],
-      $_POST['UAM_ConfirmMail_Custom_Txt2']
-    );
+    $newconf_UAM_ConfirmMail['CONFIRMMAIL_TIMEOUT'] = (isset($_POST['UAM_ConfirmMail_TimeOut']) ? $_POST['UAM_ConfirmMail_TimeOut'] : 'false');
+    $newconf_UAM_ConfirmMail['CONFIRMMAIL_DELAY'] = (isset($_POST['UAM_ConfirmMail_Delay']) ? $_POST['UAM_ConfirmMail_Delay'] : '5');
+    $newconf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL_TXT1'] = (isset($_POST['UAM_ConfirmMail_ReMail_Txt1']) ? $_POST['UAM_ConfirmMail_ReMail_Txt1'] : l10n('UAM_Default_CfmMail_Remail_Txt1'));
+    $newconf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL'] = (isset($_POST['UAM_ConfirmMail_Remail']) ? $_POST['UAM_ConfirmMail_Remail'] : 'false');
+    $newconf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL_TXT2'] = (isset($_POST['UAM_ConfirmMail_ReMail_Txt2']) ? $_POST['UAM_ConfirmMail_ReMail_Txt2'] : l10n('UAM_Default_CfmMail_Remail_Txt2'));
+    $newconf_UAM_ConfirmMail['CONFIRMMAIL_CUSTOM_TXT1'] = (isset($_POST['UAM_ConfirmMail_Custom_Txt1']) ? $_POST['UAM_ConfirmMail_Custom_Txt1'] : l10n('UAM_Default_CfmMail_Custom_Txt1'));
+    $newconf_UAM_ConfirmMail['CONFIRMMAIL_CUSTOM_TXT2'] = (isset($_POST['UAM_ConfirmMail_Custom_Txt2']) ? $_POST['UAM_ConfirmMail_Custom_Txt2'] : l10n('UAM_Default_CfmMail_Custom_Txt2'));
 
     $conf['UserAdvManager_ConfirmMail'] = serialize($newconf_UAM_ConfirmMail);
@@ -363,15 +359,15 @@
     $groups[$row['id']] = $row['name'];
     //configuration value for unvalidated users
-    if (isset($conf_UAM[2]) and $conf_UAM[2] == $row['id'])
+    if (isset($conf_UAM['NO_CONFIRM_GROUP']) and $conf_UAM['NO_CONFIRM_GROUP'] == $row['id'])
     {
       $No_Valid = $row['id'];
     }
     //configuration value for validated users
-    if (isset($conf_UAM[3]) and $conf_UAM[3] == $row['id'])
+    if (isset($conf_UAM['VALIDATED_GROUP']) and $conf_UAM['VALIDATED_GROUP'] == $row['id'])
     {
       $Valid = $row['id'];
     }
     //configuration value for downgrade users
-    if (isset($conf_UAM[25]) and $conf_UAM[25] == $row['id'])
+    if (isset($conf_UAM['DOWNGRADE_GROUP']) and $conf_UAM['DOWNGRADE_GROUP'] == $row['id'])
     {
       $Downgrade = $row['id'];
@@ -421,5 +417,5 @@
   {
 	  $status_options[$status] = l10n('user_status_'.$status);
-	  if (isset($conf_UAM[7]) and $conf_UAM[7] == $status)
+	  if (isset($conf_UAM['NO_CONFIRM_STATUS']) and $conf_UAM['NO_CONFIRM_STATUS'] == $status)
 	  {
 	    $No_Valid_Status = $status;
@@ -442,5 +438,5 @@
   {
     $status_options[$status] = l10n('user_status_'.$status);
-    if (isset($conf_UAM[4]) and $conf_UAM[4] == $status)
+    if (isset($conf_UAM['VALIDATED_STATUS']) and $conf_UAM['VALIDATED_STATUS'] == $status)
     {
       $Valid_Status = $status;
@@ -463,5 +459,5 @@
   {
     $status_options[$status] = l10n('user_status_'.$status);
-    if (isset($conf_UAM[26]) and $conf_UAM[26] == $status)
+    if (isset($conf_UAM['DOWNGRADE_STATUS']) and $conf_UAM['DOWNGRADE_STATUS'] == $status)
     {
       $Downgrade_Status = $status;
@@ -492,5 +488,5 @@
   {
     $level_options[$level] = l10n(sprintf('Level %d', $level));
-    if (isset($conf_UAM[35]) and $conf_UAM[35] == $level)
+    if (isset($conf_UAM['NO_VALID_LEVEL']) and $conf_UAM['NO_VALID_LEVEL'] == $level)
     {
       $No_Valid_Level = $level;
@@ -513,5 +509,5 @@
   {
     $level_options[$level] = l10n(sprintf('Level %d', $level));
-    if (isset($conf_UAM[36]) and $conf_UAM[36] == $level)
+    if (isset($conf_UAM['VALID_LEVEL']) and $conf_UAM['VALID_LEVEL'] == $level)
     {
       $Valid_Level = $level;
@@ -534,5 +530,5 @@
   {
     $level_options[$level] = l10n(sprintf('Level %d', $level));
-    if (isset($conf_UAM[37]) and $conf_UAM[37] == $level)
+    if (isset($conf_UAM['DOWNGRADE_LEVEL']) and $conf_UAM['DOWNGRADE_LEVEL'] == $level)
     {
       $Downgrade_Level = $level;
@@ -578,71 +574,71 @@
             'UAM_DUMP_DOWNLOAD'                 => $dump_download,
             'UAM_THEME'                         => $UAM_theme,
-						'UAM_MAIL_INFO_TRUE'                => $conf_UAM[0]=='true' ?  'checked="checked"' : '' ,
-						'UAM_MAIL_INFO_FALSE'               => $conf_UAM[0]=='false' ?  'checked="checked"' : '' ,
-						'UAM_MAILINFO_TEXT'                 => $conf_UAM[8],
-						'UAM_USERNAME_CHAR_TRUE'            => $conf_UAM[5]=='true' ?  'checked="checked"' : '' ,
-						'UAM_USERNAME_CHAR_FALSE'           => $conf_UAM[5]=='false' ?  'checked="checked"' : '' ,
-						'UAM_USERNAME_CHAR_LIST'            => $conf_UAM[6],
-						'UAM_CONFIRM_MAIL_TRUE'             => $conf_UAM[1]=='true' ?  'checked="checked"' : '' ,
-						'UAM_CONFIRM_MAIL_FALSE'            => $conf_UAM[1]=='false' ?  'checked="checked"' : '' ,
-            'UAM_CONFIRM_MAIL_LOCAL'            => $conf_UAM[1]=='local' ?  'checked="checked"' : '' ,
-						'UAM_CONFIRMMAIL_TEXT'              => $conf_UAM[9],
-						'UAM_No_Confirm_Group'              => $conf_UAM[2],
-						'UAM_Validated_Group'               => $conf_UAM[3],
-						'UAM_No_Confirm_Status'             => $conf_UAM[7],
-						'UAM_Validated_Status'              => $conf_UAM[4],
-						'UAM_MAILEXCLUSION_TRUE'            => $conf_UAM[10]=='true' ?  'checked="checked"' : '' ,
-						'UAM_MAILEXCLUSION_FALSE'           => $conf_UAM[10]=='false' ?  'checked="checked"' : '' ,
-						'UAM_MAILEXCLUSION_LIST'            => $conf_UAM[11],
-						'UAM_PASSWORDENF_TRUE'              => $conf_UAM[12]=='true' ?  'checked="checked"' : '' ,
-						'UAM_PASSWORDENF_FALSE'             => $conf_UAM[12]=='false' ?  'checked="checked"' : '' ,
-						'UAM_PASSWORD_SCORE'                => $conf_UAM[13],
-            'UAM_ADMINPASSWENF_TRUE'            => $conf_UAM[14]=='true' ?  'checked="checked"' : '' ,
-						'UAM_ADMINPASSWENF_FALSE'           => $conf_UAM[14]=='false' ?  'checked="checked"' : '' ,
-            'UAM_GHOSTRACKER_TRUE'              => $conf_UAM[15]=='true' ?  'checked="checked"' : '' ,
-						'UAM_GHOSTRACKER_FALSE'             => $conf_UAM[15]=='false' ?  'checked="checked"' : '' ,
-            'UAM_GHOSTRACKER_DAYLIMIT'          => $conf_UAM[16],
-            'UAM_GHOSTRACKER_REMINDERTEXT'      => $conf_UAM[17],
-            'UAM_ADDLASTVISIT_TRUE'             => $conf_UAM[18]=='true' ?  'checked="checked"' : '' ,
-            'UAM_ADDLASTVISIT_FALSE'            => $conf_UAM[18]=='false' ?  'checked="checked"' : '' ,
-            'UAM_ADMINCONFMAIL_TRUE'            => $conf_UAM[19]=='true' ?  'checked="checked"' : '' ,
-            'UAM_ADMINCONFMAIL_FALSE'           => $conf_UAM[19]=='false' ?  'checked="checked"' : '' ,
-            'UAM_REDIRTOPROFILE_TRUE'           => $conf_UAM[20]=='true' ?  'checked="checked"' : '' ,
-            'UAM_REDIRTOPROFILE_FALSE'          => $conf_UAM[20]=='false' ?  'checked="checked"' : '' ,
-            'UAM_GTAUTO_TRUE'                   => $conf_UAM[21]=='true' ?  'checked="checked"' : '' ,
-            'UAM_GTAUTO_FALSE'                  => $conf_UAM[21]=='false' ?  'checked="checked"' : '' ,
-            'UAM_GTAUTOMAIL_TRUE'               => $conf_UAM[22]=='true' ?  'checked="checked"' : '' ,
-            'UAM_GTAUTOMAIL_FALSE'              => $conf_UAM[22]=='false' ?  'checked="checked"' : '' ,
-            'UAM_GTAUTODEL_TEXT'                => $conf_UAM[23],
-            'UAM_GTAUTOMAILTEXT'                => $conf_UAM[24],
-						'UAM_Downgrade_Group'               => $conf_UAM[25],
-						'UAM_Downgrade_Status'              => $conf_UAM[26],
-            'UAM_ADMINVALIDATIONMAIL_TEXT'      => $conf_UAM[27],
-            'UAM_CUSTOMPASSWRETR_TRUE'          => $conf_UAM[28]=='true' ?  'checked="checked"' : '' ,
-            'UAM_CUSTOMPASSWRETR_FALSE'         => $conf_UAM[28]=='false' ?  'checked="checked"' : '' ,
-            'UAM_CUSTOMPASSWRETR_TEXT'          => $conf_UAM[29],
-            'UAM_USRAUTO_TRUE'                  => $conf_UAM[30]=='true' ?  'checked="checked"' : '' ,
-            'UAM_USRAUTO_FALSE'                 => $conf_UAM[30]=='false' ?  'checked="checked"' : '' ,
-            'UAM_USRAUTODEL_TEXT'               => $conf_UAM[31],
-            'UAM_USRAUTOMAIL_TRUE'              => $conf_UAM[32]=='true' ?  'checked="checked"' : '' ,
-            'UAM_USRAUTOMAIL_FALSE'             => $conf_UAM[32]=='false' ?  'checked="checked"' : '' ,
-            'UAM_STUFFS_TRUE'                   => $conf_UAM[33]=='true' ?  'checked="checked"' : '' ,
-            'UAM_STUFFS_FALSE'                  => $conf_UAM[33]=='false' ?  'checked="checked"' : '' ,
-            'UAM_HIDEPASSW_TRUE'                => $conf_UAM[34]=='true' ?  'checked="checked"' : '' ,
-            'UAM_HIDEPASSW_FALSE'               => $conf_UAM[34]=='false' ?  'checked="checked"' : '' ,
-						'UAM_NO_VALID_LEVEL'                => $conf_UAM[35],
-						'UAM_VALID_LEVEL'                   => $conf_UAM[36],
-            'UAM_DOWNGRADE_LEVEL'               => $conf_UAM[37],
-            'UAM_PWDRESET_TRUE'                 => $conf_UAM[38]=='true' ?  'checked="checked"' : '' ,
-            'UAM_PWDRESET_FALSE'                => $conf_UAM[38]=='false' ?  'checked="checked"' : '' ,
-            'UAM_REJECTCONNECT_TRUE'            => $conf_UAM[39]=='true' ?  'checked="checked"' : '' ,
-            'UAM_REJECTCONNECT_FALSE'           => $conf_UAM[39]=='false' ?  'checked="checked"' : '' ,
-            'UAM_REJECTCONNECT_TEXT'            => $conf_UAM[40],
-            'UAM_CONFIRMMAIL_SUBJECT'           => $conf_UAM[41],
-            'UAM_CONFIRMMAIL_REMAIL_SUBJECT'    => $conf_UAM[42],
-            'UAM_INFOMAIL_SUBJECT'              => $conf_UAM[43],
-            'UAM_GTAUTOMAIL_SUBJECT'            => $conf_UAM[44],
-            'UAM_GTREMINDER_SUBJECT'            => $conf_UAM[45],
-            'UAM_ADMINVALIDATIONMAIL_SUBJECT'   => $conf_UAM[46],
+						'UAM_MAIL_INFO_TRUE'                => $conf_UAM['MAIL_INFO']=='true' ? 'checked="checked"' : '' ,
+						'UAM_MAIL_INFO_FALSE'               => $conf_UAM['MAIL_INFO']=='false' ? 'checked="checked"' : '' ,
+						'UAM_MAILINFO_TEXT'                 => $conf_UAM['MAILINFO_TEXT'],
+						'UAM_USERNAME_CHAR_TRUE'            => $conf_UAM['USERNAME_CHAR']=='true' ? 'checked="checked"' : '' ,
+						'UAM_USERNAME_CHAR_FALSE'           => $conf_UAM['USERNAME_CHAR']=='false' ? 'checked="checked"' : '' ,
+						'UAM_USERNAME_CHAR_LIST'            => $conf_UAM['USERNAME_CHAR_LIST'],
+						'UAM_CONFIRM_MAIL_TRUE'             => $conf_UAM['CONFIRM_MAIL']=='true' ? 'checked="checked"' : '' ,
+						'UAM_CONFIRM_MAIL_FALSE'            => $conf_UAM['CONFIRM_MAIL']=='false' ? 'checked="checked"' : '' ,
+            'UAM_CONFIRM_MAIL_LOCAL'            => $conf_UAM['CONFIRM_MAIL']=='local' ? 'checked="checked"' : '' ,
+						'UAM_CONFIRMMAIL_TEXT'              => $conf_UAM['CONFIRMMAIL_TEXT'],
+						'UAM_No_Confirm_Group'              => $conf_UAM['NO_CONFIRM_GROUP'],
+						'UAM_Validated_Group'               => $conf_UAM['VALIDATED_GROUP'],
+						'UAM_No_Confirm_Status'             => $conf_UAM['NO_CONFIRM_STATUS'],
+						'UAM_Validated_Status'              => $conf_UAM['VALIDATED_STATUS'],
+						'UAM_MAILEXCLUSION_TRUE'            => $conf_UAM['MAILEXCLUSION']=='true' ? 'checked="checked"' : '' ,
+						'UAM_MAILEXCLUSION_FALSE'           => $conf_UAM['MAILEXCLUSION']=='false' ? 'checked="checked"' : '' ,
+						'UAM_MAILEXCLUSION_LIST'            => $conf_UAM['MAILEXCLUSION_LIST'],
+						'UAM_PASSWORDENF_TRUE'              => $conf_UAM['PASSWORDENF']=='true' ? 'checked="checked"' : '' ,
+						'UAM_PASSWORDENF_FALSE'             => $conf_UAM['PASSWORDENF']=='false' ? 'checked="checked"' : '' ,
+						'UAM_PASSWORD_SCORE'                => $conf_UAM['PASSWORD_SCORE'],
+            'UAM_ADMINPASSWENF_TRUE'            => $conf_UAM['ADMINPASSWENF']=='true' ? 'checked="checked"' : '' ,
+						'UAM_ADMINPASSWENF_FALSE'           => $conf_UAM['ADMINPASSWENF']=='false' ? 'checked="checked"' : '' ,
+            'UAM_GHOSTRACKER_TRUE'              => $conf_UAM['GHOSTRACKER']=='true' ? 'checked="checked"' : '' ,
+						'UAM_GHOSTRACKER_FALSE'             => $conf_UAM['GHOSTRACKER']=='false' ? 'checked="checked"' : '' ,
+            'UAM_GHOSTRACKER_DAYLIMIT'          => $conf_UAM['GHOSTRACKER_DAYLIMIT'],
+            'UAM_GHOSTRACKER_REMINDERTEXT'      => $conf_UAM['GHOSTRACKER_REMINDERTEXT'],
+            'UAM_ADDLASTVISIT_TRUE'             => $conf_UAM['ADDLASTVISIT']=='true' ? 'checked="checked"' : '' ,
+            'UAM_ADDLASTVISIT_FALSE'            => $conf_UAM['ADDLASTVISIT']=='false' ? 'checked="checked"' : '' ,
+            'UAM_ADMINCONFMAIL_TRUE'            => $conf_UAM['ADMINCONFMAIL']=='true' ? 'checked="checked"' : '' ,
+            'UAM_ADMINCONFMAIL_FALSE'           => $conf_UAM['ADMINCONFMAIL']=='false' ? 'checked="checked"' : '' ,
+            'UAM_REDIRTOPROFILE_TRUE'           => $conf_UAM['REDIRTOPROFILE']=='true' ? 'checked="checked"' : '' ,
+            'UAM_REDIRTOPROFILE_FALSE'          => $conf_UAM['REDIRTOPROFILE']=='false' ? 'checked="checked"' : '' ,
+            'UAM_GTAUTO_TRUE'                   => $conf_UAM['GTAUTO']=='true' ? 'checked="checked"' : '' ,
+            'UAM_GTAUTO_FALSE'                  => $conf_UAM['GTAUTO']=='false' ? 'checked="checked"' : '' ,
+            'UAM_GTAUTOMAIL_TRUE'               => $conf_UAM['GTAUTOMAIL']=='true' ? 'checked="checked"' : '' ,
+            'UAM_GTAUTOMAIL_FALSE'              => $conf_UAM['GTAUTOMAIL']=='false' ? 'checked="checked"' : '' ,
+            'UAM_GTAUTODEL_TEXT'                => $conf_UAM['GTAUTODEL'],
+            'UAM_GTAUTOMAILTEXT'                => $conf_UAM['GTAUTOMAILTEXT'],
+						'UAM_Downgrade_Group'               => $conf_UAM['DOWNGRADE_GROUP'],
+						'UAM_Downgrade_Status'              => $conf_UAM['DOWNGRADE_STATUS'],
+            'UAM_ADMINVALIDATIONMAIL_TEXT'      => $conf_UAM['ADMINVALIDATIONMAIL'],
+            'UAM_CUSTOMPASSWRETR_TRUE'          => $conf_UAM['CUSTOMPASSWRETR']=='true' ? 'checked="checked"' : '' ,
+            'UAM_CUSTOMPASSWRETR_FALSE'         => $conf_UAM['CUSTOMPASSWRETR']=='false' ? 'checked="checked"' : '' ,
+            'UAM_CUSTOMPASSWRETR_TEXT'          => $conf_UAM['CUSTOMPASSWRETR_TEXT'],
+            'UAM_USRAUTO_TRUE'                  => $conf_UAM['USRAUTO']=='true' ? 'checked="checked"' : '' ,
+            'UAM_USRAUTO_FALSE'                 => $conf_UAM['USRAUTO']=='false' ? 'checked="checked"' : '' ,
+            'UAM_USRAUTODEL_TEXT'               => $conf_UAM['USRAUTODEL'],
+            'UAM_USRAUTOMAIL_TRUE'              => $conf_UAM['USRAUTOMAIL']=='true' ? 'checked="checked"' : '' ,
+            'UAM_USRAUTOMAIL_FALSE'             => $conf_UAM['USRAUTOMAIL']=='false' ? 'checked="checked"' : '' ,
+            'UAM_STUFFS_TRUE'                   => $conf_UAM['STUFFS']=='true' ? 'checked="checked"' : '' ,
+            'UAM_STUFFS_FALSE'                  => $conf_UAM['STUFFS']=='false' ? 'checked="checked"' : '' ,
+            'UAM_HIDEPASSW_TRUE'                => $conf_UAM['HIDEPASSW']=='true' ? 'checked="checked"' : '' ,
+            'UAM_HIDEPASSW_FALSE'               => $conf_UAM['HIDEPASSW']=='false' ? 'checked="checked"' : '' ,
+						'UAM_NO_VALID_LEVEL'                => $conf_UAM['NO_VALID_LEVEL'],
+						'UAM_VALID_LEVEL'                   => $conf_UAM['VALID_LEVEL'],
+            'UAM_DOWNGRADE_LEVEL'               => $conf_UAM['DOWNGRADE_LEVEL'],
+            'UAM_PWDRESET_TRUE'                 => $conf_UAM['PWDRESET']=='true' ? 'checked="checked"' : '' ,
+            'UAM_PWDRESET_FALSE'                => $conf_UAM['PWDRESET']=='false' ? 'checked="checked"' : '' ,
+            'UAM_REJECTCONNECT_TRUE'            => $conf_UAM['REJECTCONNECT']=='true' ? 'checked="checked"' : '' ,
+            'UAM_REJECTCONNECT_FALSE'           => $conf_UAM['REJECTCONNECT']=='false' ? 'checked="checked"' : '' ,
+            'UAM_REJECTCONNECT_TEXT'            => $conf_UAM['REJECTCONNECT_TEXT'],
+            'UAM_CONFIRMMAIL_SUBJECT'           => $conf_UAM['CONFIRMMAIL_SUBJECT'],
+            'UAM_CONFIRMMAIL_REMAIL_SUBJECT'    => $conf_UAM['CONFIRMMAIL_REMAIL_SUBJECT'],
+            'UAM_INFOMAIL_SUBJECT'              => $conf_UAM['INFOMAIL_SUBJECT'],
+            'UAM_GTAUTOMAIL_SUBJECT'            => $conf_UAM['GTAUTOMAIL_SUBJECT'],
+            'UAM_GTREMINDER_SUBJECT'            => $conf_UAM['GTREMINDER_SUBJECT'],
+            'UAM_ADMINVALIDATIONMAIL_SUBJECT'   => $conf_UAM['ADMINVALIDATIONMAIL_SUBJECT'],
 						'UAM_PASSWORD_TEST_SCORE'           => $UAM_Password_Test_Score,
             'UAM_ERROR_REPORTS1'                => $UAM_Exclusionlist_Error,
@@ -651,13 +647,13 @@
             'UAM_ERROR_REPORTS4'                => $UAM_Illegal_Flag_Error3,
             'UAM_EMAIL_MANDATORY'               => $UAM_Email_Mandatory_Check,
-						'UAM_CONFIRMMAIL_TIMEOUT_TRUE'      => $conf_UAM_ConfirmMail[0]=='true' ?  'checked="checked"' : '' ,
-						'UAM_CONFIRMMAIL_TIMEOUT_FALSE'     => $conf_UAM_ConfirmMail[0]=='false' ?  'checked="checked"' : '' ,
-						'UAM_CONFIRMMAIL_DELAY'             => $conf_UAM_ConfirmMail[1],
-            'UAM_CONFIRMMAIL_REMAIL_TRUE'       => $conf_UAM_ConfirmMail[3]=='true' ? 'checked="checked"' : '',
-            'UAM_CONFIRMMAIL_REMAIL_FALSE'      => $conf_UAM_ConfirmMail[3]=='false' ? 'checked="checked"' : '',
-            'UAM_CONFIRMMAIL_REMAIL_TXT1'       => $conf_UAM_ConfirmMail[2],
-            'UAM_CONFIRMMAIL_REMAIL_TXT2'       => $conf_UAM_ConfirmMail[4],
-            'UAM_CONFIRMMAIL_CUSTOM_TXT1'       => $conf_UAM_ConfirmMail[5],
-            'UAM_CONFIRMMAIL_CUSTOM_TXT2'       => $conf_UAM_ConfirmMail[6],
+						'UAM_CONFIRMMAIL_TIMEOUT_TRUE'      => $conf_UAM_ConfirmMail['CONFIRMMAIL_TIMEOUT']=='true' ? 'checked="checked"' : '' ,
+						'UAM_CONFIRMMAIL_TIMEOUT_FALSE'     => $conf_UAM_ConfirmMail['CONFIRMMAIL_TIMEOUT']=='false' ? 'checked="checked"' : '' ,
+						'UAM_CONFIRMMAIL_DELAY'             => $conf_UAM_ConfirmMail['CONFIRMMAIL_DELAY'],
+            'UAM_CONFIRMMAIL_REMAIL_TRUE'       => $conf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL']=='true' ? 'checked="checked"' : '',
+            'UAM_CONFIRMMAIL_REMAIL_FALSE'      => $conf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL']=='false' ? 'checked="checked"' : '',
+            'UAM_CONFIRMMAIL_REMAIL_TXT1'       => $conf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL_TXT1'],
+            'UAM_CONFIRMMAIL_REMAIL_TXT2'       => $conf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL_TXT2'],
+            'UAM_CONFIRMMAIL_CUSTOM_TXT1'       => $conf_UAM_ConfirmMail['CONFIRMMAIL_CUSTOM_TXT1'],
+            'UAM_CONFIRMMAIL_CUSTOM_TXT2'       => $conf_UAM_ConfirmMail['CONFIRMMAIL_CUSTOM_TXT2'],
     )
   );
@@ -669,5 +665,5 @@
     // Username without forbidden keys
     // -------------------------------
-    if ( isset($conf_UAM[5]) and $conf_UAM[5] == 'true' )
+    if ( isset($conf_UAM['USERNAME_CHAR']) and $conf_UAM['USERNAME_CHAR'] == 'true' )
 	  {
       $query = '
@@ -689,5 +685,5 @@
     // Email without forbidden domain
     // ------------------------------
-    if ( isset($conf_UAM[10]) and $conf_UAM[10] == 'true' )
+    if ( isset($conf_UAM['MAILEXCLUSION']) and $conf_UAM['MAILEXCLUSION'] == 'true' )
     {
       $query = '
@@ -700,5 +696,5 @@
       while($row = pwg_db_fetch_assoc($result))
       {
-        $conf_MailExclusion = preg_split("/[\s,]+/",$conf_UAM[11]);
+        $conf_MailExclusion = preg_split("/[\s,]+/",$conf_UAM['MAILEXCLUSION_LIST']);
         for ($i = 0 ; $i < count($conf_MailExclusion) ; $i++)
         {
@@ -755,5 +751,5 @@
   $conf_UAM = unserialize($conf['UserAdvManager']);
   
-  if (isset($conf_UAM[18]) and $conf_UAM[18]=='true')
+  if (isset($conf_UAM['ADDLASTVISIT']) and $conf_UAM['ADDLASTVISIT']=='true')
   {
 // +-----------------------------------------------------------------------+
@@ -805,17 +801,17 @@
     		$deltadays = floor($deltasecs / 86400);// Convert result from seconds to days
   
-        if (isset($conf_UAM[15]) and $conf_UAM[15]=='true' and !empty($conf_UAM[16]))
+        if (isset($conf_UAM['GHOSTRACKER']) and $conf_UAM['GHOSTRACKER']=='true' and !empty($conf_UAM['GHOSTRACKER_DAYLIMIT']))
     		{
-          if ($deltadays <= ($conf_UAM[16]/2))
+          if ($deltadays <= ($conf_UAM['GHOSTRACKER_DAYLIMIT']/2))
       		{
             $display = 'green';
       		}
 
-          if (($deltadays > ($conf_UAM[16]/2)) and ($deltadays < $conf_UAM[16]))
+          if (($deltadays > ($conf_UAM['GHOSTRACKER_DAYLIMIT']/2)) and ($deltadays < $conf_UAM['GHOSTRACKER_DAYLIMIT']))
       		{
             $display = 'orange';
       		}
 
-      		if ($deltadays >= $conf_UAM[16])
+      		if ($deltadays >= $conf_UAM['GHOSTRACKER_DAYLIMIT'])
       		{
             $display = 'red';
@@ -885,5 +881,5 @@
   $conf_UAM_ConfirmMail = unserialize($conf['UserAdvManager_ConfirmMail']);
 	
-  if (isset($conf_UAM[1]) and ($conf_UAM[1]=='true' or $conf_UAM[1]=='local'))
+  if (isset($conf_UAM['CONFIRM_MAIL']) and ($conf_UAM['CONFIRM_MAIL']=='true' or $conf_UAM['CONFIRM_MAIL']=='local'))
   {
 // +-----------------------------------------------------------------------+
@@ -1351,7 +1347,7 @@
     $Confirm_Local = "";
     
-    if ($conf_UAM[1] == 'local')
-    {
-      $Confirm_Local = $conf_UAM[1];
+    if ($conf_UAM['CONFIRM_MAIL'] == 'local')
+    {
+      $Confirm_Local = $conf_UAM['CONFIRM_MAIL'];
     }
     else
@@ -1404,5 +1400,5 @@
   $conf_UAM = unserialize($conf['UserAdvManager']);
 	
-  if (isset($conf_UAM[16]) and $conf_UAM[15]=='true')
+  if (isset($conf_UAM['GHOSTRACKER_DAYLIMIT']) and $conf_UAM['GHOSTRACKER']=='true')
   {
 // +-----------------------------------------------------------------------+
Index: /extensions/UserAdvManager/trunk/changelog.txt.php
===================================================================
--- /extensions/UserAdvManager/trunk/changelog.txt.php	(revision 21074)
+++ /extensions/UserAdvManager/trunk/changelog.txt.php	(revision 21075)
@@ -376,4 +376,11 @@
             Update tr_TR, thanks to : hakanselcuk
 
+-- 2.50.0 : Compliance with Piwigo 2.5
+            Bug 2764 fixed - Code refactory : Change config variables to assoc array and $_POST vars control before writing conf in database - Thx to flop25 for his advices ;-)
+            Update fr_FR
+            Update de_DE, thanks to : stephy
+            Update tr_TR, thanks to : hakanselcuk and LazBoy
+            Update it_IT, thanks to : Ericnet
+            
 */
 ?>
Index: /extensions/UserAdvManager/trunk/include/functions.inc.php
===================================================================
--- /extensions/UserAdvManager/trunk/include/functions.inc.php	(revision 21074)
+++ /extensions/UserAdvManager/trunk/include/functions.inc.php	(revision 21075)
@@ -40,5 +40,5 @@
  
   // Check mandatory email address for email exclusion
-  if (!$conf['obligatory_user_mail_address'] and $conf_UAM[10] == 'true')
+  if (!$conf['obligatory_user_mail_address'] and $conf_UAM['MAILEXCLUSION'] == 'true')
   {
     array_push($page['warnings'], l10n('UAM_mail_exclusion_error'));
@@ -64,5 +64,5 @@
   if (!is_admin() and !is_a_guest() and $user['username'] != "16" and $user['username'] != "18")
   {
-    if ((isset($conf_UAM[15]) and $conf_UAM[15] == 'true') or (isset($conf_UAM[18]) and $conf_UAM[18] == 'true'))
+    if ((isset($conf_UAM['GHOSTRACKER']) and $conf_UAM['GHOSTRACKER'] == 'true') or (isset($conf_UAM['ADDLASTVISIT']) and $conf_UAM['ADDLASTVISIT'] == 'true'))
     {
       $userid = get_userid($user['username']);
@@ -103,5 +103,5 @@
 
     // Perform user logout after registration if not validated
-    if ((isset($conf_UAM[39]) and $conf_UAM[39] == 'true') and !UAM_UsrReg_Verif($user['id']) and !is_admin() and !is_webmaster() )
+    if ((isset($conf_UAM['REJECTCONNECT']) and $conf_UAM['REJECTCONNECT'] == 'true') and !UAM_UsrReg_Verif($user['id']) and !is_admin() and !is_webmaster() )
     {
       invalidate_user_cache();
@@ -141,5 +141,5 @@
     //Bug 2829 fix not working - if (isset($page['page']) and ($page['page'] != 'user_list'))
     //{
-      if (isset($conf_UAM[1]) and $conf_UAM[1] == 'local')
+      if (isset($conf_UAM['CONFIRM_MAIL']) and $conf_UAM['CONFIRM_MAIL'] == 'local')
       {
         // This is to set user to "waiting" group or status and without ConfirMail until admin validation
@@ -157,11 +157,11 @@
       // Sending registration confirmation by email
       // ------------------------------------------
-      elseif (isset($conf_UAM[1]) and $conf_UAM[1] == 'true')
-      {
-        if (is_admin() and isset($conf_UAM[19]) and $conf_UAM[19] == 'true')
+      elseif (isset($conf_UAM['CONFIRM_MAIL']) and $conf_UAM['CONFIRM_MAIL'] == 'true')
+      {
+        if (is_admin() and isset($conf_UAM['ADMINCONFMAIL']) and $conf_UAM['ADMINCONFMAIL'] == 'true')
         {
           SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], true); 
         }
-        elseif (is_admin() and isset($conf_UAM[19]) and $conf_UAM[19] == 'false')
+        elseif (is_admin() and isset($conf_UAM['ADMINCONFMAIL']) and $conf_UAM['ADMINCONFMAIL'] == 'false')
         {
           SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], false);
@@ -217,5 +217,5 @@
     // Password enforcement control
     // ----------------------------
-    if (isset($conf_UAM[12]) and $conf_UAM[12] == 'true' and !empty($conf_UAM[13]))
+    if (isset($conf_UAM['PASSWORDENF']) and $conf_UAM['PASSWORDENF'] == 'true' and !empty($conf_UAM['PASSWORD_SCORE']))
     {
       if (!empty($user['password']) and !is_admin())
@@ -223,19 +223,19 @@
         $PasswordCheck = testpassword($user['password']);
   
-        if ($PasswordCheck < $conf_UAM[13])
+        if ($PasswordCheck < $conf_UAM['PASSWORD_SCORE'])
         {
           $message = get_l10n_args('UAM_reg_err_login4_%s', $PasswordCheck);
-          $lang['reg_err_pass'] = l10n_args($message).$conf_UAM[13];
+          $lang['reg_err_pass'] = l10n_args($message).$conf_UAM['PASSWORD_SCORE'];
           array_push($errors, $lang['reg_err_pass']);
         }
       }
-      else if (!empty($user['password']) and is_admin() and isset($conf_UAM[14]) and $conf_UAM[14] == 'true')
+      else if (!empty($user['password']) and is_admin() and isset($conf_UAM['ADMINPASSWENF']) and $conf_UAM['ADMINPASSWENF'] == 'true')
       {
         $PasswordCheck = testpassword($user['password']);
   
-        if ($PasswordCheck < $conf_UAM[13])
+        if ($PasswordCheck < $conf_UAM['PASSWORD_SCORE'])
         {
           $message = get_l10n_args('UAM_reg_err_login4_%s', $PasswordCheck);
-          $lang['reg_err_pass'] = l10n_args($message).$conf_UAM[13];
+          $lang['reg_err_pass'] = l10n_args($message).$conf_UAM['PASSWORD_SCORE'];
           array_push($errors, $lang['reg_err_pass']);
         }
@@ -245,7 +245,7 @@
     // Username without forbidden keys
     // -------------------------------
-    if (isset($conf_UAM[5]) and $conf_UAM[5] == 'true' and !empty($user['username']) and ValidateUsername($user['username']) and !is_admin())
-    {
-      $lang['reg_err_login1'] = l10n('UAM_reg_err_login2')."'".$conf_UAM[6]."'";
+    if (isset($conf_UAM['USERNAME_CHAR']) and $conf_UAM['USERNAME_CHAR'] == 'true' and !empty($user['username']) and ValidateUsername($user['username']) and !is_admin())
+    {
+      $lang['reg_err_login1'] = l10n('UAM_reg_err_login2')."'".$conf_UAM['USERNAME_CHAR_LIST']."'";
       array_push($errors, $lang['reg_err_login1']);
     }
@@ -253,7 +253,7 @@
     // Email without forbidden domains
     // -------------------------------
-    if (isset($conf_UAM[10]) and $conf_UAM[10] == 'true' and !empty($user['email']) and ValidateEmailProvider($user['email']) and !is_admin())
-    {
-      $lang['reg_err_login1'] = l10n('UAM_reg_err_login5')."'".$conf_UAM[11]."'";
+    if (isset($conf_UAM['MAILEXCLUSION']) and $conf_UAM['MAILEXCLUSION'] == 'true' and !empty($user['email']) and ValidateEmailProvider($user['email']) and !is_admin())
+    {
+      $lang['reg_err_login1'] = l10n('UAM_reg_err_login5')."'".$conf_UAM['MAILEXCLUSION_LIST']."'";
       array_push($errors, $lang['reg_err_login1']);
     }
@@ -274,5 +274,5 @@
   // Update first redirection parameter
   // ----------------------------------
-  if ((isset($conf_UAM[20]) and $conf_UAM[20] == 'true'))
+  if ((isset($conf_UAM['REDIRTOPROFILE']) and $conf_UAM['REDIRTOPROFILE'] == 'true'))
   {
     $user_idsOK = array();
@@ -292,5 +292,5 @@
   // Special message display for password reset
   // ------------------------------------------
-  if ((isset($conf_UAM[38]) and $conf_UAM[38] == 'true'))
+  if ((isset($conf_UAM['PWDRESET']) and $conf_UAM['PWDRESET'] == 'true'))
   {
     if (UAM_check_pwgreset($user['id']))
@@ -306,9 +306,9 @@
     // Email without forbidden domains
     // -------------------------------
-    if (isset($conf_UAM[10]) and $conf_UAM[10] == 'true' and !empty($_POST['mail_address']))
+    if (isset($conf_UAM['MAILEXCLUSION']) and $conf_UAM['MAILEXCLUSION'] == 'true' and !empty($_POST['mail_address']))
     {
       if (ValidateEmailProvider($_POST['mail_address']))
       {
-        $template->append('errors', l10n('UAM_reg_err_login5')."'".$conf_UAM[11]."'");
+        $template->append('errors', l10n('UAM_reg_err_login5')."'".$conf_UAM['MAILEXCLUSION_LIST']."'");
         unset($_POST['validate']);
       }
@@ -317,5 +317,5 @@
     // Password reset control
     // ----------------------
-    if (isset($conf_UAM[38]) and $conf_UAM[38] == 'true' and UAM_check_pwgreset($user['id']))
+    if (isset($conf_UAM['PWDRESET']) and $conf_UAM['PWDRESET'] == 'true' and UAM_check_pwgreset($user['id']))
     {
       // if password not changed then pwdreset field = true else pwdreset field = false
@@ -341,12 +341,12 @@
       // Password enforcement control
       // ----------------------------
-      if (isset($conf_UAM[12]) and $conf_UAM[12] == 'true' and !empty($conf_UAM[13]))
+      if (isset($conf_UAM['PASSWORDENF']) and $conf_UAM['PASSWORDENF'] == 'true' and !empty($conf_UAM['PASSWORD_SCORE']))
       {
         $PasswordCheck = testpassword($_POST['use_new_pwd']);
 
-        if ($PasswordCheck < $conf_UAM[13])
+        if ($PasswordCheck < $conf_UAM['PASSWORD_SCORE'])
         {
           $message = get_l10n_args('UAM_reg_err_login4_%s', $PasswordCheck);
-          $template->append('errors', l10n_args($message).$conf_UAM[13]);
+          $template->append('errors', l10n_args($message).$conf_UAM['PASSWORD_SCORE']);
           unset($_POST['use_new_pwd']);
           unset($_POST['validate']);
@@ -357,5 +357,5 @@
     // Sending registration confirmation by email
     // ------------------------------------------
-    if ((isset($conf_UAM[1]) and $conf_UAM[1] == 'true') or (isset($conf_UAM[1]) and $conf_UAM[1] == 'local'))
+    if ((isset($conf_UAM['CONFIRM_MAIL']) and $conf_UAM['CONFIRM_MAIL'] == 'true') or (isset($conf_UAM['CONFIRM_MAIL']) and $conf_UAM['CONFIRM_MAIL'] == 'local'))
     {
       $confirm_mail_need = false;
@@ -373,5 +373,5 @@
         // This is to send a new validation key
         // ------------------------------------
-        if ($_POST['mail_address'] != $current_email and (isset($conf_UAM[1]) and $conf_UAM[1] == 'true'))
+        if ($_POST['mail_address'] != $current_email and (isset($conf_UAM['CONFIRM_MAIL']) and $conf_UAM['CONFIRM_MAIL'] == 'true'))
         {
           SetPermission($user['id']);// Set to "waiting" group or status until user validation
@@ -382,5 +382,5 @@
         // This is to set the user to "waiting" group or status until admin validation
         // ---------------------------------------------------------------------------
-        elseif ($_POST['mail_address'] != $current_email and (isset($conf_UAM[1]) and $conf_UAM[1] == 'local'))
+        elseif ($_POST['mail_address'] != $current_email and (isset($conf_UAM['CONFIRM_MAIL']) and $conf_UAM['CONFIRM_MAIL'] == 'local'))
         {
           SetPermission($user['id']);// Set to "waiting" group or status until admin validation
@@ -390,5 +390,5 @@
       }
 
-      if (((!empty($_POST['use_new_pwd']) and (isset($conf_UAM[0]) and $conf_UAM[0] == 'true')) or $confirm_mail_need))
+      if (((!empty($_POST['use_new_pwd']) and (isset($conf_UAM['MAIL_INFO']) and $conf_UAM['MAIL_INFO'] == 'true')) or $confirm_mail_need))
       {
         $query = '
@@ -423,5 +423,5 @@
   // Performing GhostTracker scheduled tasks
   // ---------------------------------------
-  if ((isset($conf_UAM[21]) and $conf_UAM[21] == 'true'))
+  if ((isset($conf_UAM['GTAUTO']) and $conf_UAM['GTAUTO'] == 'true'))
   {
     UAM_GT_ScheduledTasks();
@@ -430,5 +430,5 @@
   // Performing User validation scheduled tasks
   // ------------------------------------------
-  if ((isset($conf_UAM[30]) and $conf_UAM[30] == 'true'))
+  if ((isset($conf_UAM['USRAUTO']) and $conf_UAM['USRAUTO'] == 'true'))
   {
     UAM_USR_ScheduledTasks();
@@ -436,9 +436,9 @@
 
   // Avoid login into public galleries until registration confirmation is done
-  if ((isset($conf_UAM[39]) and $conf_UAM[39] == 'false') or ((isset($conf_UAM[39]) and $conf_UAM[39] == 'true') and UAM_UsrReg_Verif($user['id'])) or  (!is_admin() and !is_webmaster()))
+  if ((isset($conf_UAM['REJECTCONNECT']) and $conf_UAM['REJECTCONNECT'] == 'false') or ((isset($conf_UAM['REJECTCONNECT']) and $conf_UAM['REJECTCONNECT'] == 'true') and UAM_UsrReg_Verif($user['id'])) or  (!is_admin() and !is_webmaster()))
   {
     // Performing redirection to profile page on first login
     // -----------------------------------------------------
-    if ((isset($conf_UAM[20]) and $conf_UAM[20] == 'true'))
+    if ((isset($conf_UAM['REDIRTOPROFILE']) and $conf_UAM['REDIRTOPROFILE'] == 'true'))
     {
       $query ='
@@ -459,5 +459,5 @@
     // Performing redirection to profile page for password reset
     // ---------------------------------------------------------
-    if ((isset($conf_UAM[38]) and $conf_UAM[38] == 'true'))
+    if ((isset($conf_UAM['PWDRESET']) and $conf_UAM['PWDRESET'] == 'true'))
     {
       $query ='
@@ -477,5 +477,5 @@
     }
   }
-  elseif ((isset($conf_UAM[39]) and $conf_UAM[39] == 'true') and !UAM_UsrReg_Verif($user['id']) and !is_admin() and !is_webmaster())
+  elseif ((isset($conf_UAM['REJECTCONNECT']) and $conf_UAM['REJECTCONNECT'] == 'true') and !UAM_UsrReg_Verif($user['id']) and !is_admin() and !is_webmaster())
   {
     // Logged-in user cleanup, session destruction and redirected to custom page
@@ -543,5 +543,5 @@
   // Auto group, status or privacy level downgrade and autodeletion if user already reminded
   // ---------------------------------------------------------------------------------------
-  if ((isset($conf_UAM[21]) and $conf_UAM[21] == 'true') and ((isset($conf_UAM[25]) and $conf_UAM[25] <> -1) or (isset($conf_UAM[26]) and $conf_UAM[26] <> -1) or (isset($conf_UAM[37]) and $conf_UAM[37] <> -1)))
+  if ((isset($conf_UAM['GTAUTO']) and $conf_UAM['GTAUTO'] == 'true') and ((isset($conf_UAM['DOWNGRADE_GROUP']) and $conf_UAM['DOWNGRADE_GROUP'] <> -1) or (isset($conf_UAM['DOWNGRADE_STATUS']) and $conf_UAM['DOWNGRADE_STATUS'] <> -1) or (isset($conf_UAM['DOWNGRADE_LEVEL']) and $conf_UAM['DOWNGRADE_LEVEL'] <> -1)))
   {
     if (count($collection) > 0)
@@ -625,5 +625,5 @@
             // Delete user from all groups
             // ---------------------------
-            if ($conf_UAM[2] <> -1 and $conf_UAM[3] <> -1)
+            if ($conf_UAM['NO_CONFIRM_GROUP'] <> -1 and $conf_UAM['VALIDATED_GROUP'] <> -1)
             {
             		$query = '
@@ -631,7 +631,7 @@
 WHERE user_id = '.$user_id.'
   AND (
-    group_id = '.$conf_UAM[2].'
+    group_id = '.$conf_UAM['NO_CONFIRM_GROUP'].'
   OR 
-    group_id = '.$conf_UAM[3].'
+    group_id = '.$conf_UAM['VALIDATED_GROUP'].'
   )
 ;';
@@ -641,9 +641,9 @@
             // Change user status
             // ------------------
-            if ($conf_UAM[26] <> -1)
+            if ($conf_UAM['DOWNGRADE_STATUS'] <> -1)
             {
               $query = '
 UPDATE '.USER_INFOS_TABLE.'
-SET status = "'.$conf_UAM[26].'"
+SET status = "'.$conf_UAM['DOWNGRADE_STATUS'].'"
 WHERE user_id = '.$user_id.'
 ;';
@@ -653,5 +653,5 @@
             // Change user group
             // -----------------
-            if ($conf_UAM[25] <> -1)
+            if ($conf_UAM['DOWNGRADE_GROUP'] <> -1)
             {
               $query = '
@@ -659,5 +659,5 @@
   (user_id, group_id)
 VALUES
-  ('.$user_id.', "'.$conf_UAM[25].'")
+  ('.$user_id.', "'.$conf_UAM['DOWNGRADE_GROUP'].'")
 ;';
               pwg_query($query);
@@ -666,9 +666,9 @@
             // Change user privacy level
             // -------------------------
-            if ($conf_UAM[37] <> -1)
+            if ($conf_UAM['DOWNGRADE_LEVEL'] <> -1)
             {
               $query = '
 UPDATE '.USER_INFOS_TABLE.'
-SET level = "'.$conf_UAM[37].'"
+SET level = "'.$conf_UAM['DOWNGRADE_LEVEL'].'"
 WHERE user_id = '.$user_id.'
 ;';
@@ -678,5 +678,5 @@
             // Auto send email notification on group / status downgrade
             // --------------------------------------------------------
-            if (isset($conf_UAM[22]) and $conf_UAM[22] == 'true')
+            if (isset($conf_UAM['GTAUTOMAIL']) and $conf_UAM['GTAUTOMAIL'] == 'true')
             {
               // Set reminder true
@@ -754,5 +754,5 @@
   // Unvalidated accounts auto email sending and autodeletion if user already reminded
   // ---------------------------------------------------------------------------------
-  if ((isset($conf_UAM[30]) and $conf_UAM[30] == 'true'))
+  if ((isset($conf_UAM['USRAUTO']) and $conf_UAM['USRAUTO'] == 'true'))
   {
     if (count($collection) > 0)
@@ -782,5 +782,5 @@
         // If never reminded before, send reminder and set reminder True
         // -------------------------------------------------------------
-        if (!$reminder and isset($conf_UAM[32]) and $conf_UAM[32] == 'true')
+        if (!$reminder and isset($conf_UAM['USRAUTOMAIL']) and $conf_UAM['USRAUTOMAIL'] == 'true')
         {
           $typemail = 1;
@@ -836,5 +836,5 @@
           // If never reminded before, send reminder and set reminder True
           // -------------------------------------------------------------
-          if (!$reminder and isset($conf_UAM[32]) and $conf_UAM[32] == 'true')
+          if (!$reminder and isset($conf_UAM['USRAUTOMAIL']) and $conf_UAM['USRAUTOMAIL'] == 'true')
           {
             $typemail = 1;
@@ -884,7 +884,7 @@
       // Email without forbidden domains
       // -------------------------------
-      if (isset($conf_UAM[10]) and $conf_UAM[10] == 'true' and !empty($_POST['email']) and ValidateEmailProvider($_POST['email']))
-      {
-        $template->append('errors', l10n('UAM_reg_err_login5')."'".$conf_UAM[11]."'");
+      if (isset($conf_UAM['MAILEXCLUSION']) and $conf_UAM['MAILEXCLUSION'] == 'true' and !empty($_POST['email']) and ValidateEmailProvider($_POST['email']))
+      {
+        $template->append('errors', l10n('UAM_reg_err_login5')."'".$conf_UAM['MAILEXCLUSION_LIST']."'");
         unset($_POST['submit_add']);
       }
@@ -915,5 +915,5 @@
 
     // Connexion rejected until validation
-    if (isset($conf_UAM[40]) and !empty($conf_UAM[40]) and $_GET['UAM_msg']=="rejected")
+    if (isset($conf_UAM['REJECTCONNECT_TEXT']) and !empty($conf_UAM['REJECTCONNECT_TEXT']) and $_GET['UAM_msg']=="rejected")
     {
       // Management of Extension flags ([mygallery], [myurl])
@@ -926,7 +926,7 @@
       if (function_exists('get_user_language_desc'))
       {
-        $custom_text = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[40]));
-      }
-      else $custom_text = l10n(preg_replace($patterns, $replacements, $conf_UAM[40]));
+        $custom_text = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM['REJECTCONNECT_TEXT']));
+      }
+      else $custom_text = l10n(preg_replace($patterns, $replacements, $conf_UAM['REJECTCONNECT_TEXT']));
 
       $page["errors"][]=$custom_text;
@@ -934,5 +934,5 @@
 
     // User account deleted after validation deadline - Triggered by any other user
-    elseif (isset($conf_UAM[23]) and !empty($conf_UAM[23]) and $_GET['UAM_msg']=="deleted")
+    elseif (isset($conf_UAM['GTAUTODEL']) and !empty($conf_UAM['GTAUTODEL']) and $_GET['UAM_msg']=="deleted")
     {
       // Management of Extension flags ([mygallery], [myurl]) - [username] flag can't be used here
@@ -945,7 +945,7 @@
       if (function_exists('get_user_language_desc'))
       {
-        $custom_text = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[23]));
-      }
-      else $custom_text = l10n(preg_replace($patterns, $replacements, $conf_UAM[23]));
+        $custom_text = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM['GTAUTODEL']));
+      }
+      else $custom_text = l10n(preg_replace($patterns, $replacements, $conf_UAM['GTAUTODEL']));
 
       $page["errors"][]=$custom_text;
@@ -953,5 +953,5 @@
 
     // User account deleted after validation deadline - Triggered by user himself
-    elseif (isset($conf_UAM[31]) and !empty($conf_UAM[31]) and $_GET['UAM_msg']=="deleted")
+    elseif (isset($conf_UAM['USRAUTODEL']) and !empty($conf_UAM['USRAUTODEL']) and $_GET['UAM_msg']=="deleted")
     {
       // Management of Extension flags ([mygallery], [myurl]) - [username] flag can't be used here
@@ -964,7 +964,7 @@
       if (function_exists('get_user_language_desc'))
       {
-        $custom_text = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[31]));
-      }
-      else $custom_text = l10n(preg_replace($patterns, $replacements, $conf_UAM[31]));
+        $custom_text = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM['USRAUTODEL']));
+      }
+      else $custom_text = l10n(preg_replace($patterns, $replacements, $conf_UAM['USRAUTODEL']));
 
       $page["errors"][]=$custom_text;
@@ -1000,5 +1000,5 @@
     if (VerifyConfirmMail($key))
     {
-      if (isset($conf_UAM[1]) and $conf_UAM[1] == 'local')
+      if (isset($conf_UAM['CONFIRM_MAIL']) and $conf_UAM['CONFIRM_MAIL'] == 'local')
       {
         validation_mail($userid);
@@ -1030,5 +1030,5 @@
       }
 
-      if (isset($conf_UAM_ConfirmMail[5]) and !empty($conf_UAM_ConfirmMail[5]))
+      if (isset($conf_UAM_ConfirmMail['CONFIRMMAIL_CUSTOM_TXT1']) and !empty($conf_UAM_ConfirmMail['CONFIRMMAIL_CUSTOM_TXT1']))
       {
         // Management of Extension flags ([username], [mygallery], [myurl])
@@ -1043,9 +1043,9 @@
         if (function_exists('get_user_language_desc'))
         {
-          $custom_text = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM_ConfirmMail[5]));
+          $custom_text = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM_ConfirmMail['CONFIRMMAIL_CUSTOM_TXT1']));
         }
         else
         {
-          $custom_text = l10n(preg_replace($patterns, $replacements, $conf_UAM_ConfirmMail[5]));
+          $custom_text = l10n(preg_replace($patterns, $replacements, $conf_UAM_ConfirmMail['CONFIRMMAIL_CUSTOM_TXT1']));
         }
         $page['infos'][]=$custom_text;
@@ -1054,5 +1054,5 @@
     else
     {
-      if (isset($conf_UAM_ConfirmMail[6]) and !empty($conf_UAM_ConfirmMail[6]))
+      if (isset($conf_UAM_ConfirmMail['CONFIRMMAIL_CUSTOM_TXT2']) and !empty($conf_UAM_ConfirmMail['CONFIRMMAIL_CUSTOM_TXT2']))
       {
         // Management of Extension flags ([username], [mygallery], [myurl])
@@ -1067,9 +1067,9 @@
         if (function_exists('get_user_language_desc'))
         {
-          $custom_text = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM_ConfirmMail[6]));
+          $custom_text = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM_ConfirmMail['CONFIRMMAIL_CUSTOM_TXT2']));
         }
         else
         {
-          $custom_text = l10n(preg_replace($patterns, $replacements, $conf_UAM_ConfirmMail[6]));
+          $custom_text = l10n(preg_replace($patterns, $replacements, $conf_UAM_ConfirmMail['CONFIRMMAIL_CUSTOM_TXT2']));
         }
 
@@ -1100,5 +1100,5 @@
   $conf_UAM = unserialize($conf['UserAdvManager']);
 
-  if (isset($conf_UAM[28]) and $conf_UAM[28] == 'true')
+  if (isset($conf_UAM['CUSTOMPASSWRETR']) and $conf_UAM['CUSTOMPASSWRETR'] == 'true')
   {
     // Management of Extension flags ([mygallery], [myurl])
@@ -1108,5 +1108,5 @@
     $replacements[] = get_gallery_home_url();
 
-    $infos = preg_replace($patterns, $replacements, $conf_UAM[29])."\n"."\n".$infos;
+    $infos = preg_replace($patterns, $replacements, $conf_UAM['CUSTOMPASSWRETR_TEXT'])."\n"."\n".$infos;
   }
   return $infos;
@@ -1162,5 +1162,5 @@
   {
     case 1: // Confirmation email on user registration - Without information email (already managed by Piwigo)
-      if (isset($conf_UAM[41]) and !empty($conf_UAM[41]))
+      if (isset($conf_UAM['CONFIRMMAIL_SUBJECT']) and !empty($conf_UAM['CONFIRMMAIL_SUBJECT']))
       {
         // Management of Extension flags ([username], [mygallery])
@@ -1173,7 +1173,7 @@
         if (function_exists('get_user_language_desc'))
         {
-          $subject = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[41]))."\n\n";
-        }
-        else $subject = l10n(preg_replace($patterns, $replacements, $conf_UAM[41]))."\n\n"; 
+          $subject = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM['CONFIRMMAIL_SUBJECT']))."\n\n";
+        }
+        else $subject = l10n(preg_replace($patterns, $replacements, $conf_UAM['CONFIRMMAIL_SUBJECT']))."\n\n"; 
       }
 
@@ -1181,5 +1181,5 @@
 
     case 2: // Confirmation email on user profile update - With information email if modification done in user profile
-      if (isset($conf_UAM[41]) and !empty($conf_UAM[41]))
+      if (isset($conf_UAM['CONFIRMMAIL_SUBJECT']) and !empty($conf_UAM['CONFIRMMAIL_SUBJECT']))
       {
         // Management of Extension flags ([username], [mygallery])
@@ -1192,12 +1192,12 @@
         if (function_exists('get_user_language_desc'))
         {
-          $subject = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[41]))."\n\n";
-        }
-        else $subject = l10n(preg_replace($patterns, $replacements, $conf_UAM[41]))."\n\n"; 
+          $subject = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM['CONFIRMMAIL_SUBJECT']))."\n\n";
+        }
+        else $subject = l10n(preg_replace($patterns, $replacements, $conf_UAM['CONFIRMMAIL_SUBJECT']))."\n\n"; 
       }
 
       $password = !empty($password) ? $password : l10n('UAM_empty_pwd');
 
-      if (isset($conf_UAM[8]) and !empty($conf_UAM[8]))
+      if (isset($conf_UAM['MAILINFO_TEXT']) and !empty($conf_UAM['MAILINFO_TEXT']))
       {
         // Management of Extension flags ([username], [mygallery], [myurl])
@@ -1212,12 +1212,12 @@
         if (function_exists('get_user_language_desc'))
         {
-          $infos1_perso = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[8]))."\n\n";
-        }
-        else $infos1_perso = l10n(preg_replace($patterns, $replacements, $conf_UAM[8]))."\n\n"; 
-      }
-
-      if (isset($conf_UAM[0]) and $conf_UAM[0] == 'true')
-      {
-        if (isset($conf_UAM[34]) and $conf_UAM[34] == 'true') // Allow display of clear password in email
+          $infos1_perso = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM['MAILINFO_TEXT']))."\n\n";
+        }
+        else $infos1_perso = l10n(preg_replace($patterns, $replacements, $conf_UAM['MAILINFO_TEXT']))."\n\n"; 
+      }
+
+      if (isset($conf_UAM['MAIL_INFO']) and $conf_UAM['MAIL_INFO'] == 'true')
+      {
+        if (isset($conf_UAM['HIDEPASSW']) and $conf_UAM['HIDEPASSW'] == 'true') // Allow display of clear password in email
         {
           $infos1 = array(
@@ -1243,5 +1243,5 @@
 
     case 3: // Only information email send to user if checked
-      if (isset($conf_UAM[43]) and !empty($conf_UAM[43]))
+      if (isset($conf_UAM['INFOMAIL_SUBJECT']) and !empty($conf_UAM['INFOMAIL_SUBJECT']))
       {
         // Management of Extension flags ([username], [mygallery])
@@ -1254,12 +1254,12 @@
         if (function_exists('get_user_language_desc'))
         {
-          $subject = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[43]))."\n\n";
-        }
-        else $subject = l10n(preg_replace($patterns, $replacements, $conf_UAM[43]))."\n\n"; 
+          $subject = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM['INFOMAIL_SUBJECT']))."\n\n";
+        }
+        else $subject = l10n(preg_replace($patterns, $replacements, $conf_UAM['INFOMAIL_SUBJECT']))."\n\n"; 
       }
 
       $password = !empty($password) ? $password : l10n('UAM_no_update_pwd');
 
-      if (isset($conf_UAM[8]) and !empty($conf_UAM[8]))
+      if (isset($conf_UAM['MAILINFO_TEXT']) and !empty($conf_UAM['MAILINFO_TEXT']))
       {
         // Management of Extension flags ([username], [mygallery], [myurl])
@@ -1274,12 +1274,12 @@
         if (function_exists('get_user_language_desc'))
         {
-          $infos1_perso = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[8]))."\n\n";
-        }
-        else $infos1_perso = l10n(preg_replace($patterns, $replacements, $conf_UAM[8]))."\n\n"; 
-      }
-
-      if (isset($conf_UAM[0]) and $conf_UAM[0] == 'true')
-      {
-        if (isset($conf_UAM[34]) and $conf_UAM[34] == 'true') // Allow display of clear password in email
+          $infos1_perso = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM['MAILINFO_TEXT']))."\n\n";
+        }
+        else $infos1_perso = l10n(preg_replace($patterns, $replacements, $conf_UAM['MAILINFO_TEXT']))."\n\n"; 
+      }
+
+      if (isset($conf_UAM['MAIL_INFO']) and $conf_UAM['MAIL_INFO'] == 'true')
+      {
+        if (isset($conf_UAM['HIDEPASSW']) and $conf_UAM['HIDEPASSW'] == 'true') // Allow display of clear password in email
         {
           $infos1 = array(
@@ -1305,5 +1305,5 @@
   }
 
-  if (isset($conf_UAM[1]) and ($conf_UAM[1] == 'true' or $conf_UAM[1] == 'local')  and $confirm) // Add confirmation link ?
+  if (isset($conf_UAM['CONFIRM_MAIL']) and ($conf_UAM['CONFIRM_MAIL'] == 'true' or $conf_UAM['CONFIRM_MAIL'] == 'local')  and $confirm) // Add confirmation link ?
   {
     $infos2 = array(
@@ -1312,5 +1312,5 @@
     );
 
-    if (isset($conf_UAM[9]) and !empty($conf_UAM[9])) // Add personal text in confirmation email ?
+    if (isset($conf_UAM['CONFIRMMAIL_TEXT']) and !empty($conf_UAM['CONFIRMMAIL_TEXT'])) // Add personal text in confirmation email ?
     {
       // Management of Extension flags ([username], [mygallery], [myurl], [Kdays])
@@ -1323,15 +1323,15 @@
       $replacements[] = get_gallery_home_url();
 
-      if (isset($conf_UAM_ConfirmMail[0]) and $conf_UAM_ConfirmMail[0] == 'true') // [Kdays] replacement only if related option is active
+      if (isset($conf_UAM_ConfirmMail['CONFIRMMAIL_TIMEOUT']) and $conf_UAM_ConfirmMail['CONFIRMMAIL_TIMEOUT'] == 'true') // [Kdays] replacement only if related option is active
       {
         $patterns[] = '#\[Kdays\]#i';
-        $replacements[] = $conf_UAM_ConfirmMail[1];
+        $replacements[] = $conf_UAM_ConfirmMail['CONFIRMMAIL_DELAY'];
       }
 
       if (function_exists('get_user_language_desc'))
       {
-        $infos2_perso = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[9]))."\n\n";
-      }
-      else $infos2_perso = l10n(preg_replace($patterns, $replacements, $conf_UAM[9]))."\n\n";
+        $infos2_perso = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM['CONFIRMMAIL_TEXT']))."\n\n";
+      }
+      else $infos2_perso = l10n(preg_replace($patterns, $replacements, $conf_UAM['CONFIRMMAIL_TEXT']))."\n\n";
     }
   }
@@ -1339,5 +1339,5 @@
 // Sending the email with subject and contents
 // -------------------------------------------
-		if (isset($conf_UAM[1]) and $conf_UAM[1] == 'local')
+		if (isset($conf_UAM['CONFIRM_MAIL']) and $conf_UAM['CONFIRM_MAIL'] == 'local')
 		{
   		switch_lang_to(get_default_language());
@@ -1470,5 +1470,5 @@
   {
     case 1: //Generating email content for remind with a new key
-      if (isset($conf_UAM[42]) and !empty($conf_UAM[42]))
+      if (isset($conf_UAM['CONFIRMMAIL_REMAIL_SUBJECT']) and !empty($conf_UAM['CONFIRMMAIL_REMAIL_SUBJECT']))
       {
         // Management of Extension flags ([username], [mygallery])
@@ -1481,10 +1481,10 @@
         if (function_exists('get_user_language_desc'))
         {
-          $subject = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[42]))."\n\n";
-        }
-        else $subject = l10n(preg_replace($patterns, $replacements, $conf_UAM[42]))."\n\n"; 
-      }
-
-      if (isset($conf_UAM_ConfirmMail[2]) and !empty($conf_UAM_ConfirmMail[2]) and isset($conf_UAM_ConfirmMail[3]) and $conf_UAM_ConfirmMail[3] == 'true' and $confirm)
+          $subject = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM['CONFIRMMAIL_REMAIL_SUBJECT']))."\n\n";
+        }
+        else $subject = l10n(preg_replace($patterns, $replacements, $conf_UAM['CONFIRMMAIL_REMAIL_SUBJECT']))."\n\n"; 
+      }
+
+      if (isset($conf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL_TXT1']) and !empty($conf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL_TXT1']) and isset($conf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL']) and $conf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL'] == 'true' and $confirm)
       {
     		// Management of Extension flags ([username], [mygallery], [myurl], [Kdays])
@@ -1497,15 +1497,15 @@
         $replacements[] = get_gallery_home_url();
 
-        if (isset($conf_UAM_ConfirmMail[0]) and $conf_UAM_ConfirmMail[0] == 'true') // [Kdays] replacement only if related option is active
+        if (isset($conf_UAM_ConfirmMail['CONFIRMMAIL_TIMEOUT']) and $conf_UAM_ConfirmMail['CONFIRMMAIL_TIMEOUT'] == 'true') // [Kdays] replacement only if related option is active
         {
           $patterns[] = '#\[Kdays\]#i';
-          $replacements[] = $conf_UAM_ConfirmMail[1];
+          $replacements[] = $conf_UAM_ConfirmMail['CONFIRMMAIL_DELAY'];
         }
 
         if (function_exists('get_user_language_desc'))
         {
-          $infos1 = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM_ConfirmMail[2]))."\n\n";
-        }
-				else $infos1 = l10n(preg_replace($patterns, $replacements, $conf_UAM_ConfirmMail[2]))."\n\n";
+          $infos1 = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL_TXT1']))."\n\n";
+        }
+				else $infos1 = l10n(preg_replace($patterns, $replacements, $conf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL_TXT1']))."\n\n";
 
         $infos2 = array
@@ -1528,5 +1528,5 @@
 
     case 2: //Generating email content for remind without a new key
-      if (isset($conf_UAM[42]) and !empty($conf_UAM[42]))
+      if (isset($conf_UAM['CONFIRMMAIL_REMAIL_SUBJECT']) and !empty($conf_UAM['CONFIRMMAIL_REMAIL_SUBJECT']))
       {
         // Management of Extension flags ([username], [mygallery])
@@ -1539,10 +1539,10 @@
         if (function_exists('get_user_language_desc'))
         {
-          $subject = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[42]))."\n\n";
-        }
-        else $subject = l10n(preg_replace($patterns, $replacements, $conf_UAM[42]))."\n\n"; 
-      }
-
-      if (isset($conf_UAM_ConfirmMail[4]) and !empty($conf_UAM_ConfirmMail[4]) and isset($conf_UAM_ConfirmMail[3]) and $conf_UAM_ConfirmMail[3] == 'true' and !$confirm)
+          $subject = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM['CONFIRMMAIL_REMAIL_SUBJECT']))."\n\n";
+        }
+        else $subject = l10n(preg_replace($patterns, $replacements, $conf_UAM['CONFIRMMAIL_REMAIL_SUBJECT']))."\n\n"; 
+      }
+
+      if (isset($conf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL_TXT2']) and !empty($conf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL_TXT2']) and isset($conf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL']) and $conf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL'] == 'true' and !$confirm)
       {
         // Management of Extension flags ([username], [mygallery], [myurl], [Kdays])
@@ -1555,15 +1555,15 @@
         $replacements[] = get_gallery_home_url();
 
-        if (isset($conf_UAM_ConfirmMail[0]) and $conf_UAM_ConfirmMail[0] == 'true') // [Kdays] replacement only if related option is active
+        if (isset($conf_UAM_ConfirmMail['CONFIRMMAIL_TIMEOUT']) and $conf_UAM_ConfirmMail['CONFIRMMAIL_TIMEOUT'] == 'true') // [Kdays] replacement only if related option is active
         {
           $patterns[] = '#\[Kdays\]#i';
-          $replacements[] = $conf_UAM_ConfirmMail[1];
+          $replacements[] = $conf_UAM_ConfirmMail['CONFIRMMAIL_DELAY'];
         }
 
         if (function_exists('get_user_language_desc'))
         {
-          $infos1 = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM_ConfirmMail[4]))."\n\n";
-        }
-        else $infos1 = l10n(preg_replace($patterns, $replacements, $conf_UAM_ConfirmMail[4]))."\n\n";
+          $infos1 = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL_TXT2']))."\n\n";
+        }
+        else $infos1 = l10n(preg_replace($patterns, $replacements, $conf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL_TXT2']))."\n\n";
       }
 
@@ -1622,5 +1622,5 @@
   load_language('plugin.lang', UAM_PATH);
 
-  if (isset($conf_UAM[45]) and !empty($conf_UAM[45]))
+  if (isset($conf_UAM['GTREMINDER_SUBJECT']) and !empty($conf_UAM['GTREMINDER_SUBJECT']))
   {
     // Management of Extension flags ([username], [mygallery])
@@ -1633,10 +1633,10 @@
     if (function_exists('get_user_language_desc'))
     {
-      $subject = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[45]))."\n\n";
-    }
-    else $subject = l10n(preg_replace($patterns, $replacements, $conf_UAM[45]))."\n\n"; 
-  }
-
-  if (isset($conf_UAM[17]) and !empty($conf_UAM[17]) and isset($conf_UAM[15]) and $conf_UAM[15] == 'true')
+      $subject = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM['GTREMINDER_SUBJECT']))."\n\n";
+    }
+    else $subject = l10n(preg_replace($patterns, $replacements, $conf_UAM['GTREMINDER_SUBJECT']))."\n\n"; 
+  }
+
+  if (isset($conf_UAM['GHOSTRACKER_REMINDERTEXT']) and !empty($conf_UAM['GHOSTRACKER_REMINDERTEXT']) and isset($conf_UAM['GHOSTRACKER']) and $conf_UAM['GHOSTRACKER'] == 'true')
   {
     // Management of Extension flags ([username], [mygallery], [myurl], [days])
@@ -1649,13 +1649,13 @@
     $replacements[] = get_gallery_home_url();
     $patterns[] = '#\[days\]#i';
-    $replacements[] = $conf_UAM[16];
+    $replacements[] = $conf_UAM['GHOSTRACKER_DAYLIMIT'];
 
     if (function_exists('get_user_language_desc'))
     {
-      $infos1 = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[17]))."\n\n";
+      $infos1 = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM['GHOSTRACKER_REMINDERTEXT']))."\n\n";
     }
     else
     {
-      $infos1 = l10n(preg_replace($patterns, $replacements, $conf_UAM[17]))."\n\n";
+      $infos1 = l10n(preg_replace($patterns, $replacements, $conf_UAM['GHOSTRACKER_REMINDERTEXT']))."\n\n";
     }
 
@@ -1719,5 +1719,5 @@
   }
 
-  if (isset($conf_UAM[44]) and !empty($conf_UAM[44]))
+  if (isset($conf_UAM['GTAUTOMAIL_SUBJECT']) and !empty($conf_UAM['GTAUTOMAIL_SUBJECT']))
   {
     // Management of Extension flags ([username], [mygallery])
@@ -1730,10 +1730,10 @@
     if (function_exists('get_user_language_desc'))
     {
-      $subject = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[44]))."\n\n";
-    }
-    else $subject = l10n(preg_replace($patterns, $replacements, $conf_UAM[44]))."\n\n"; 
-  }
-
-  if (isset($conf_UAM[24]) and !empty($conf_UAM[24]))
+      $subject = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM['GTAUTOMAIL_SUBJECT']))."\n\n";
+    }
+    else $subject = l10n(preg_replace($patterns, $replacements, $conf_UAM['GTAUTOMAIL_SUBJECT']))."\n\n"; 
+  }
+
+  if (isset($conf_UAM['GTAUTOMAILTEXT']) and !empty($conf_UAM['GTAUTOMAILTEXT']))
   {
     // Management of Extension flags ([username], [mygallery], [myurl])
@@ -1748,7 +1748,7 @@
     if (function_exists('get_user_language_desc'))
     {
-      $custom_txt = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[24]))."\n\n";
-    }
-    else $custom_txt = l10n(preg_replace($patterns, $replacements, $conf_UAM[24]))."\n\n"; 
+      $custom_txt = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM['GTAUTOMAILTEXT']))."\n\n";
+    }
+    else $custom_txt = l10n(preg_replace($patterns, $replacements, $conf_UAM['GTAUTOMAILTEXT']))."\n\n"; 
   }
 
@@ -1835,5 +1835,5 @@
   $result = pwg_db_fetch_assoc(pwg_query($query));
 
-  if (isset($conf_UAM[46]) and !empty($conf_UAM[46]))
+  if (isset($conf_UAM['ADMINVALIDATIONMAIL_SUBJECT']) and !empty($conf_UAM['ADMINVALIDATIONMAIL_SUBJECT']))
   {
     // Management of Extension flags ([username], [mygallery])
@@ -1846,10 +1846,10 @@
     if (function_exists('get_user_language_desc'))
     {
-      $subject = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[46]))."\n\n";
-    }
-    else $subject = l10n(preg_replace($patterns, $replacements, $conf_UAM[46]))."\n\n";
-  }
-
-  if (isset($conf_UAM[27]) and !empty($conf_UAM[27]))
+      $subject = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM['ADMINVALIDATIONMAIL_SUBJECT']))."\n\n";
+    }
+    else $subject = l10n(preg_replace($patterns, $replacements, $conf_UAM['ADMINVALIDATIONMAIL_SUBJECT']))."\n\n";
+  }
+
+  if (isset($conf_UAM['ADMINVALIDATIONMAIL']) and !empty($conf_UAM['ADMINVALIDATIONMAIL']))
   {
     // Management of Extension flags ([username], [mygallery], [myurl])
@@ -1863,7 +1863,7 @@
     if (function_exists('get_user_language_desc'))
     {
-      $custom_txt = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[27]))."\n\n";
-    }
-    else $custom_txt = l10n(preg_replace($patterns, $replacements, $conf_UAM[27]))."\n\n";
+      $custom_txt = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM['ADMINVALIDATIONMAIL']))."\n\n";
+    }
+    else $custom_txt = l10n(preg_replace($patterns, $replacements, $conf_UAM['ADMINVALIDATIONMAIL']))."\n\n";
   }
 
@@ -1952,7 +1952,7 @@
 WHERE user_id = '.$user_id.'
   AND (
-    group_id = '.$conf_UAM[2].'
+    group_id = '.$conf_UAM['NO_CONFIRM_GROUP'].'
   OR 
-    group_id = '.$conf_UAM[3].'
+    group_id = '.$conf_UAM['VALIDATED_GROUP'].'
   )
 ;';
@@ -1962,9 +1962,9 @@
     // Set user unvalidated status
     // ---------------------------
-    if (!is_admin() and $conf_UAM[7] <> -1)
+    if (!is_admin() and $conf_UAM['NO_CONFIRM_STATUS'] <> -1)
     {
       $query = '
 UPDATE '.USER_INFOS_TABLE.'
-SET status = "'.$conf_UAM[7].'"
+SET status = "'.$conf_UAM['NO_CONFIRM_STATUS'].'"
 WHERE user_id = '.$user_id.'
 ;';
@@ -1975,5 +1975,5 @@
     // Set user unvalidated group
     // --------------------------
-    if (!is_admin() and $conf_UAM[2] <> -1)
+    if (!is_admin() and $conf_UAM['NO_CONFIRM_GROUP'] <> -1)
     {
       $query = '
@@ -1981,5 +1981,5 @@
   (user_id, group_id)
 VALUES
-  ('.$user_id.', '.$conf_UAM[2].')
+  ('.$user_id.', '.$conf_UAM['NO_CONFIRM_GROUP'].')
 ;';
 
@@ -1989,9 +1989,9 @@
     // Set user unvalidated privacy level
     // ----------------------------------
-    if (!is_admin() and $conf_UAM[35] <> -1)
+    if (!is_admin() and $conf_UAM['NO_VALID_LEVEL'] <> -1)
     {
       $query = '
 UPDATE '.USER_INFOS_TABLE.'
-SET level = "'.$conf_UAM[35].'"
+SET level = "'.$conf_UAM['NO_VALID_LEVEL'].'"
 WHERE user_id = '.$user_id.'
 ;';
@@ -2035,7 +2035,7 @@
 WHERE user_id = '.$user_id.'
   AND (
-    group_id = '.$conf_UAM[2].'
+    group_id = '.$conf_UAM['NO_CONFIRM_GROUP'].'
   OR 
-    group_id = '.$conf_UAM[3].'
+    group_id = '.$conf_UAM['VALIDATED_GROUP'].'
   )
 ;';
@@ -2043,9 +2043,9 @@
   pwg_query($query);
 
-  if (!is_admin() and $conf_UAM[7] <> -1) // Set status
+  if (!is_admin() and $conf_UAM['NO_CONFIRM_STATUS'] <> -1) // Set status
   {
     $query = '
 UPDATE '.USER_INFOS_TABLE.'
-SET status = "'.$conf_UAM[7].'"
+SET status = "'.$conf_UAM['NO_CONFIRM_STATUS'].'"
 WHERE user_id = '.$user_id.'
 ;';
@@ -2054,5 +2054,5 @@
   }
 
-  if (!is_admin() and $conf_UAM[2] <> -1) // Set group
+  if (!is_admin() and $conf_UAM['NO_CONFIRM_GROUP'] <> -1) // Set group
   {
     $query = '
@@ -2060,5 +2060,5 @@
   (user_id, group_id)
 VALUES
-  ('.$user_id.', '.$conf_UAM[2].')
+  ('.$user_id.', '.$conf_UAM['NO_CONFIRM_GROUP'].')
 ;';
 
@@ -2066,5 +2066,5 @@
   }
 
-  if (!is_admin() and $conf_UAM[35] <> -1) // Set privacy level
+  if (!is_admin() and $conf_UAM['NO_VALID_LEVEL'] <> -1) // Set privacy level
   {
     $query = '
@@ -2072,5 +2072,5 @@
   (user_id, level)
 VALUES
-  ('.$user_id.', "'.$conf_UAM[35].'")
+  ('.$user_id.', "'.$conf_UAM['NO_VALID_LEVEL'].'")
 ;';
 
@@ -2261,5 +2261,5 @@
         // Verify Confirmmail with time limit ON
     		// -------------------------------------
-				if (isset ($conf_UAM_ConfirmMail[1]))
+				if (isset ($conf_UAM_ConfirmMail['CONFIRMMAIL_DELAY']))
         {
 				  // Dates formating and compare
@@ -2278,5 +2278,5 @@
 					// Condition with the value set for time limit
      			// -------------------------------------------
-					if ($deltadays <= $conf_UAM_ConfirmMail[1]) // If Nb of days is less than the limit set
+					if ($deltadays <= $conf_UAM_ConfirmMail['CONFIRMMAIL_DELAY']) // If Nb of days is less than the limit set
           {
             $dbnow = date("Y-m-d H:i:s");
@@ -2301,15 +2301,15 @@
 						pwg_query($query);
       
-						if ($conf_UAM[2] <> -1) // Delete user from unvalidated users group
+						if ($conf_UAM['NO_CONFIRM_GROUP'] <> -1) // Delete user from unvalidated users group
 						{
               $query = '
 DELETE FROM '.USER_GROUP_TABLE.'
 WHERE user_id = '.$data['user_id'].'
-  AND group_id = '.$conf_UAM[2].'
+  AND group_id = '.$conf_UAM['NO_CONFIRM_GROUP'].'
 ;';
 							pwg_query($query);
             }
 
-						if ($conf_UAM[3] <> -1) // Add user to validated users group 
+						if ($conf_UAM['VALIDATED_GROUP'] <> -1) // Add user to validated users group 
 						{
               $query = '
@@ -2317,14 +2317,14 @@
   (user_id, group_id)
 VALUES
-  ('.$data['user_id'].', '.$conf_UAM[3].')
+  ('.$data['user_id'].', '.$conf_UAM['VALIDATED_GROUP'].')
 ;';
 							pwg_query($query);
             }
 
-						if ($conf_UAM[4] <> -1) // Change user's status
+						if ($conf_UAM['VALIDATED_STATUS'] <> -1) // Change user's status
 						{
               $query = '
 UPDATE '.USER_INFOS_TABLE.'
-SET status = "'.$conf_UAM[4].'"
+SET status = "'.$conf_UAM['VALIDATED_STATUS'].'"
 WHERE user_id = '.$data['user_id'].'
 ;';
@@ -2332,9 +2332,9 @@
             }
 
-						if ($conf_UAM[36] <> -1) // Change user's privacy level
+						if ($conf_UAM['VALID_LEVEL'] <> -1) // Change user's privacy level
 						{
               $query = '
 UPDATE '.USER_INFOS_TABLE.'
-SET level = "'.$conf_UAM[36].'"
+SET level = "'.$conf_UAM['VALID_LEVEL'].'"
 WHERE user_id = '.$data['user_id'].'
 ;';
@@ -2356,5 +2356,5 @@
 						return true;
           }
-          elseif ($deltadays > $conf_UAM_ConfirmMail[1]) // If timelimit exeeds
+          elseif ($deltadays > $conf_UAM_ConfirmMail['CONFIRMMAIL_DELAY']) // If timelimit exeeds
           {
             return false;
@@ -2386,20 +2386,20 @@
           pwg_query($query);
 
-          if ($conf_UAM[2] <> -1) // Delete user from unvalidated users group
+          if ($conf_UAM['NO_CONFIRM_GROUP'] <> -1) // Delete user from unvalidated users group
           {
             $query = '
 DELETE FROM '.USER_GROUP_TABLE.'
 WHERE user_id = '.$data['user_id'].'
-AND group_id = '.$conf_UAM[2].'
+AND group_id = '.$conf_UAM['NO_CONFIRM_GROUP'].'
 ;';
             pwg_query($query);
           }
 
-          if ($conf_UAM[3] <> -1)
+          if ($conf_UAM['VALIDATED_GROUP'] <> -1)
           {
             $query = '
 DELETE FROM '.USER_GROUP_TABLE.'
 WHERE user_id = '.$data['user_id'].'
-AND group_id = '.$conf_UAM[3].'
+AND group_id = '.$conf_UAM['VALIDATED_GROUP'].'
 ;';
             pwg_query($query);
@@ -2409,14 +2409,14 @@
   (user_id, group_id)
 VALUES
-  ('.$data['user_id'].', '.$conf_UAM[3].')
+  ('.$data['user_id'].', '.$conf_UAM['VALIDATED_GROUP'].')
 ;';
             pwg_query($query);
           }
 
-          if ($conf_UAM[4] <> -1) // Change user's status
+          if ($conf_UAM['VALIDATED_STATUS'] <> -1) // Change user's status
           {
             $query = '
 UPDATE '.USER_INFOS_TABLE.'
-SET status = "'.$conf_UAM[4].'"
+SET status = "'.$conf_UAM['VALIDATED_STATUS'].'"
 WHERE user_id = '.$data['user_id'].'
 ;';
@@ -2424,9 +2424,9 @@
           }
 
-          if ($conf_UAM[36] <> -1) // Change user's privacy level
+          if ($conf_UAM['VALID_LEVEL'] <> -1) // Change user's privacy level
           {
             $query = '
 UPDATE '.USER_INFOS_TABLE.'
-SET level = "'.$conf_UAM[36].'"
+SET level = "'.$conf_UAM['VALID_LEVEL'].'"
 WHERE user_id = '.$data['user_id'].'
 ;';
@@ -2472,5 +2472,5 @@
 		$conf_UAM = unserialize($conf['UserAdvManager']);
 
-		if (isset($conf_UAM[1]) and $conf_UAM[1] == 'true') // Set date of validation
+		if (isset($conf_UAM['CONFIRM_MAIL']) and $conf_UAM['CONFIRM_MAIL'] == 'true') // Set date of validation
 		{
       $dbnow = date("Y-m-d H:i:s");
@@ -2484,20 +2484,20 @@
 		}
 
-		if ($conf_UAM[2] <> -1) // Delete user from waiting group
+		if ($conf_UAM['NO_CONFIRM_GROUP'] <> -1) // Delete user from waiting group
 		{
 				$query = '
 DELETE FROM '.USER_GROUP_TABLE.'
 WHERE user_id = '.$id.'
-		AND group_id = '.$conf_UAM[2].'
+		AND group_id = '.$conf_UAM['NO_CONFIRM_GROUP'].'
 ;';
 				pwg_query($query);
 		}
 
-		if ($conf_UAM[3] <> -1) // Set user's valid group
+		if ($conf_UAM['VALIDATED_GROUP'] <> -1) // Set user's valid group
 		{
       $query = '
 DELETE FROM '.USER_GROUP_TABLE.'
 WHERE user_id = '.$id.'
-		AND group_id = '.$conf_UAM[3].'
+		AND group_id = '.$conf_UAM['VALIDATED_GROUP'].'
 ;';
       pwg_query($query);
@@ -2507,14 +2507,14 @@
 		(user_id, group_id)
 VALUES
-		('.$id.', '.$conf_UAM[3].')
+		('.$id.', '.$conf_UAM['VALIDATED_GROUP'].')
 ;';
       pwg_query($query);
 		}
 
-		if ($conf_UAM[4] <> -1) // Set user's valid status
+		if ($conf_UAM['VALIDATED_STATUS'] <> -1) // Set user's valid status
 		{
       $query = '
 UPDATE '.USER_INFOS_TABLE.'
-SET status = "'.$conf_UAM[4].'"
+SET status = "'.$conf_UAM['VALIDATED_STATUS'].'"
 WHERE user_id = '.$id.'
 ;';
@@ -2522,9 +2522,9 @@
 		}
 
-		if ($conf_UAM[36] <> -1) // Set user's valid privacy level
+		if ($conf_UAM['VALID_LEVEL'] <> -1) // Set user's valid privacy level
 		{
       $query = '
 UPDATE '.USER_INFOS_TABLE.'
-SET level = "'.$conf_UAM[36].'"
+SET level = "'.$conf_UAM['VALID_LEVEL'].'"
 WHERE user_id = '.$id.'
 ;';
@@ -2556,7 +2556,7 @@
   $conf_UAM = unserialize($conf['UserAdvManager']);
 
-  if (isset($login) and isset($conf_UAM[6]) and !empty($conf_UAM[6]))
-  {
-    $conf_CharExclusion = preg_split("/,/",$conf_UAM[6]);
+  if (isset($login) and isset($conf_UAM['USERNAME_CHAR_LIST']) and !empty($conf_UAM['USERNAME_CHAR_LIST']))
+  {
+    $conf_CharExclusion = preg_split("/,/",$conf_UAM['USERNAME_CHAR_LIST']);
     for ($i = 0 ; $i < count($conf_CharExclusion) ; $i++)
     {
@@ -2615,7 +2615,7 @@
   $conf_UAM = unserialize($conf['UserAdvManager']);
 
-		if (isset($email) and isset($conf_UAM[11]) and !empty($conf_UAM[11]))
+		if (isset($email) and isset($conf_UAM['MAILEXCLUSION_LIST']) and !empty($conf_UAM['MAILEXCLUSION_LIST']))
 		{
-      $conf_MailExclusion = preg_split("/[\s,]+/",$conf_UAM[11]);
+      $conf_MailExclusion = preg_split("/[\s,]+/",$conf_UAM['MAILEXCLUSION_LIST']);
       for ($i = 0 ; $i < count($conf_MailExclusion) ; $i++)
       {
@@ -2669,6 +2669,6 @@
     ON u.'.$conf['user_fields']['id'].' = ug.user_id
 WHERE u.'.$conf['user_fields']['id'].' >= 3
-  AND (TO_DAYS(NOW()) - TO_DAYS(ui.registration_date) >= "'.$conf_UAM_ConfirmMail[1].'"
-  OR TO_DAYS(NOW()) - TO_DAYS(ui.registration_date) < "'.$conf_UAM_ConfirmMail[1].'")
+  AND (TO_DAYS(NOW()) - TO_DAYS(ui.registration_date) >= "'.$conf_UAM_ConfirmMail['CONFIRMMAIL_DELAY'].'"
+  OR TO_DAYS(NOW()) - TO_DAYS(ui.registration_date) < "'.$conf_UAM_ConfirmMail['CONFIRMMAIL_DELAY'].'")
 		AND u.UAM_validated = "false"
 ORDER BY ui.registration_date ASC
@@ -2744,5 +2744,5 @@
     ON u.'.$conf['user_fields']['id'].' = ui.user_id
 WHERE u.'.$conf['user_fields']['id'].' >= 3
-  AND (TO_DAYS(NOW()) - TO_DAYS(ui.registration_date) >= "'.$conf_UAM_ConfirmMail[1].'")
+  AND (TO_DAYS(NOW()) - TO_DAYS(ui.registration_date) >= "'.$conf_UAM_ConfirmMail['CONFIRMMAIL_DELAY'].'")
 ORDER BY ui.registration_date ASC;';
 
@@ -2783,5 +2783,5 @@
   INNER JOIN '.USER_LASTVISIT_TABLE.' AS lv
     ON u.'.$conf['user_fields']['id'].' = lv.user_id
-WHERE (TO_DAYS(NOW()) - TO_DAYS(lv.lastvisit) >= "'.$conf_UAM[16].'")
+WHERE (TO_DAYS(NOW()) - TO_DAYS(lv.lastvisit) >= "'.$conf_UAM['GHOSTRACKER_DAYLIMIT'].'")
 ORDER BY lv.lastvisit ASC;';
 
@@ -2830,5 +2830,5 @@
   INNER JOIN '.USER_LASTVISIT_TABLE.' AS lv
     ON u.'.$conf['user_fields']['id'].' = lv.user_id
-WHERE (TO_DAYS(NOW()) - TO_DAYS(lv.lastvisit) >= "'.$conf_UAM[16].'")
+WHERE (TO_DAYS(NOW()) - TO_DAYS(lv.lastvisit) >= "'.$conf_UAM['GHOSTRACKER_DAYLIMIT'].'")
 ORDER BY lv.lastvisit ASC;';
 
@@ -2940,5 +2940,5 @@
     // Condition with the value set for time limit
     // -------------------------------------------
-    if ($deltadays <= $conf_UAM_ConfirmMail[1]) // If Nb of days is less than the limit set
+    if ($deltadays <= $conf_UAM_ConfirmMail['CONFIRMMAIL_DELAY']) // If Nb of days is less than the limit set
     {
       return false;
@@ -3200,5 +3200,5 @@
     $result = pwg_query($query);
 
-    while ($row = mysql_fetch_array($result))
+    while ($row = pwg_db_fetch_assoc($result))
     {
       if ($row['UAM_pwdreset'] == 'false')
@@ -3264,11 +3264,13 @@
       $insertions .= "DROP TABLE IF EXISTS ".$ListTables[$j].";\n\n";
 
-      $array = mysql_fetch_array($res);
+      $array = pwg_db_fetch_row($res);
       $array[1] .= ";\n\n";
       $insertions .= $array[1];
 
-      $req_table = pwg_query('SELECT * FROM '.$ListTables[$j]) or die(mysql_error());
-      $nb_fields = mysql_num_fields($req_table);
-      while ($line = mysql_fetch_array($req_table))
+      $req_table = pwg_query('DESCRIBE '.$ListTables[$j].';') or die(my_error());
+      $nb_fields = pwg_db_num_rows($req_table);
+      $req_table2 = pwg_query('SELECT * FROM '.$ListTables[$j]) or die(my_error());
+
+      while ($line = pwg_db_fetch_row($req_table2))
       {
         $insertions .= 'INSERT INTO '.$ListTables[$j].' VALUES (';
@@ -3296,8 +3298,9 @@
 
   $pattern = "UserAdvManager%";
-  $req_table = pwg_query('SELECT * FROM '.CONFIG_TABLE.' WHERE param LIKE "'.$pattern.'";') or die(mysql_error());
-  $nb_fields = mysql_num_fields($req_table);
-
-  while ($line = mysql_fetch_array($req_table))
+  $req_table = pwg_query('SELECT * FROM '.CONFIG_TABLE.' WHERE param LIKE "'.$pattern.'";') or die(my_error());
+  $nb_fields = pwg_db_num_rows($req_table);
+  $nb_fields = $nb_fields - 1;  // Fix the number of fields because pwg_db_num_rows() returns a bad number
+
+  while ($line = pwg_db_fetch_row($req_table))
   {
     $insertions = 'INSERT INTO '.CONFIG_TABLE.' VALUES (';
Index: /extensions/UserAdvManager/trunk/include/upgradedb.inc.php
===================================================================
--- /extensions/UserAdvManager/trunk/include/upgradedb.inc.php	(revision 21074)
+++ /extensions/UserAdvManager/trunk/include/upgradedb.inc.php	(revision 21075)
@@ -685,5 +685,5 @@
 		$result = pwg_query($query);
 
-		while($row = mysql_fetch_array($result))
+		while($row = pwg_db_fetch_assoc($result))
 		{
 				$query = '
@@ -703,3 +703,105 @@
 		pwg_query($query);
 }
+
+
+/* upgrade from 2.41.x to 2.50.0 */
+/* ***************************** */
+function upgrade_2410_2500()
+{
+  global $conf;
+  
+  load_language('plugin.lang', UAM_PATH);
+
+  // Upgrading options - Changing config variables to assoc array
+  // ------------------------------------------------------------
+  
+  // Upgrade $conf_UAM options
+  $conf_UAM = unserialize($conf['UserAdvManager']);
+
+  $Newconf_UAM = array(
+    'MAIL_INFO'                   => $conf_UAM[0],
+    'CONFIRM_MAIL'                => $conf_UAM[1],
+    'NO_CONFIRM_GROUP'            => $conf_UAM[2],
+    'VALIDATED_GROUP'             => $conf_UAM[3],
+    'VALIDATED_STATUS'            => $conf_UAM[4],
+    'USERNAME_CHAR'               => $conf_UAM[5],
+    'USERNAME_CHAR_LIST'          => $conf_UAM[6],
+    'NO_CONFIRM_STATUS'           => $conf_UAM[7],
+    'MAILINFO_TEXT'               => $conf_UAM[8],
+    'CONFIRMMAIL_TEXT'            => $conf_UAM[9],
+    'MAILEXCLUSION'               => $conf_UAM[10],
+    'MAILEXCLUSION_LIST'          => $conf_UAM[11],
+    'PASSWORDENF'                 => $conf_UAM[12],
+    'PASSWORD_SCORE'              => $conf_UAM[13],
+    'ADMINPASSWENF'               => $conf_UAM[14],
+    'GHOSTRACKER'                 => $conf_UAM[15],
+    'GHOSTRACKER_DAYLIMIT'        => $conf_UAM[16],
+    'GHOSTRACKER_REMINDERTEXT'    => $conf_UAM[17],
+    'ADDLASTVISIT'                => $conf_UAM[18],
+    'ADMINCONFMAIL'               => $conf_UAM[19],
+    'REDIRTOPROFILE'              => $conf_UAM[20],
+    'GTAUTO'                      => $conf_UAM[21],
+    'GTAUTOMAIL'                  => $conf_UAM[22],
+    'GTAUTODEL'                   => $conf_UAM[23],
+    'GTAUTOMAILTEXT'              => $conf_UAM[24],
+    'DOWNGRADE_GROUP'             => $conf_UAM[25],
+    'DOWNGRADE_STATUS'            => $conf_UAM[26],
+    'ADMINVALIDATIONMAIL'         => $conf_UAM[27],
+    'CUSTOMPASSWRETR'             => $conf_UAM[28],
+    'CUSTOMPASSWRETR_TEXT'        => $conf_UAM[29],
+    'USRAUTO'                     => $conf_UAM[30],
+    'USRAUTODEL'                  => $conf_UAM[31],
+    'USRAUTOMAIL'                 => $conf_UAM[32],
+    'STUFFS'                      => $conf_UAM[33],
+    'HIDEPASSW'                   => $conf_UAM[34],
+    'NO_VALID_LEVEL'              => $conf_UAM[35],
+    'VALID_LEVEL'                 => $conf_UAM[36],
+    'DOWNGRADE_LEVEL'             => $conf_UAM[37],
+    'PWDRESET'                    => $conf_UAM[38],
+    'REJECTCONNECT'               => $conf_UAM[39],
+    'REJECTCONNECT_TEXT'          => $conf_UAM[40],
+    'CONFIRMMAIL_SUBJECT'         => $conf_UAM[41],
+    'CONFIRMMAIL_REMAIL_SUBJECT'  => $conf_UAM[42],
+    'INFOMAIL_SUBJECT'            => $conf_UAM[43],
+    'GTAUTOMAIL_SUBJECT'          => $conf_UAM[44],
+    'GTREMINDER_SUBJECT'          => $conf_UAM[45],
+    'ADMINVALIDATIONMAIL_SUBJECT' => $conf_UAM[46]
+  );
+
+  // unset obsolete conf
+  // -------------------
+  for ($i = 0; $i <= 46; $i++)
+  {
+    unset ($conf_UAM[$i]);
+  }
+
+  $update_conf = serialize($Newconf_UAM);
+
+  conf_update_param('UserAdvManager', pwg_db_real_escape_string($update_conf));
+
+
+  // Upgrade $conf_UAM_ConfirmMail
+  $conf_UAM_ConfirmMail = unserialize($conf['UserAdvManager_ConfirmMail']);
+
+  $Newconf_UAM_ConfirmMail = array (
+    'CONFIRMMAIL_TIMEOUT'     => $conf_UAM_ConfirmMail[0],
+    'CONFIRMMAIL_DELAY'       => $conf_UAM_ConfirmMail[1],
+    'CONFIRMMAIL_REMAIL_TXT1' => $conf_UAM_ConfirmMail[2],
+    'CONFIRMMAIL_REMAIL'      => $conf_UAM_ConfirmMail[3],
+    'CONFIRMMAIL_REMAIL_TXT2' => $conf_UAM_ConfirmMail[4],
+    'CONFIRMMAIL_CUSTOM_TXT1' => $conf_UAM_ConfirmMail[5],
+    'CONFIRMMAIL_CUSTOM_TXT2' => $conf_UAM_ConfirmMail[6]
+  );
+
+  // unset obsolete conf
+  // -------------------
+  for ($i = 0; $i <= 6; $i++)
+  {
+    unset ($conf_UAM_ConfirmMail[$i]);
+  }
+
+  $update_conf = serialize($Newconf_UAM_ConfirmMail);
+
+  conf_update_param('UserAdvManager_ConfirmMail', pwg_db_real_escape_string($update_conf));
+}
 ?>
Index: /extensions/UserAdvManager/trunk/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/UserAdvManager/trunk/language/fr_FR/plugin.lang.php	(revision 21074)
+++ /extensions/UserAdvManager/trunk/language/fr_FR/plugin.lang.php	(revision 21075)
@@ -16,6 +16,6 @@
 $lang['UAM_Err_audit_username_char'] = '<b>Ce compte contient un ou des caractères interdits :</b> ';
 $lang['UAM_Err_audit_email_forbidden'] = '<b>Ce compte contient des domaines de messagerie interdit :</b> ';
-$lang['UAM_Err_audit_advise'] = '<b>Vous avez des corrections a faire pour respecter les nouvelles règles que vous avez activées.<br>Utilisez un utilitaire de gestion de base de données pour corriger les comptes utilisateurs directement dans la table ###_USERS si nécessaire.</b><br><br>';
-$lang['UAM_reg_err_login2'] = 'le nom utilisateur ne doit pas contenir les caractère suivants : ';
+$lang['UAM_Err_audit_advise'] = '<b>Vous avez des corrections à faire pour respecter les nouvelles règles que vous avez activées.<br>Utilisez un utilitaire de gestion de base de données pour corriger les comptes utilisateurs directement dans la table ###_USERS si nécessaire.</b><br><br>';
+$lang['UAM_reg_err_login2'] = 'le nom utilisateur ne doit pas contenir les caractères suivants : ';
 $lang['UAM_reg_err_login5'] = 'L\'adresse email est issue d\'un prestataire interdit. Les prestataires d\'adresses email interdits à l\'inscription sont : ';
 $lang['UAM_empty_pwd'] = '[mot de passe vide]';
Index: /extensions/UserAdvManager/trunk/main.inc.php
===================================================================
--- /extensions/UserAdvManager/trunk/main.inc.php	(revision 21074)
+++ /extensions/UserAdvManager/trunk/main.inc.php	(revision 21075)
@@ -69,5 +69,5 @@
 // PWG_Stuffs module
 // -----------------
-if (isset($conf_UAM[33]) and $conf_UAM[33] == 'true')
+if (isset($conf_UAM['STUFFS']) and $conf_UAM['STUFFS'] == 'true')
 {
   add_event_handler('get_stuffs_modules', 'register_UAM_stuffs_module');
@@ -76,5 +76,5 @@
 // Add new feature in user_list - Password Reset
 // ---------------------------------------------
-if (isset($conf_UAM[38]) and $conf_UAM[38] == 'true')
+if (isset($conf_UAM['PWDRESET']) and $conf_UAM['PWDRESET'] == 'true')
 {
   // Add new column on user_list
Index: /extensions/UserAdvManager/trunk/maintain.inc.php
===================================================================
--- /extensions/UserAdvManager/trunk/maintain.inc.php	(revision 21074)
+++ /extensions/UserAdvManager/trunk/maintain.inc.php	(revision 21075)
@@ -20,66 +20,67 @@
 /* ****************************************************************** */
 
-  $defaultUAM = array();
-  $defaultConfirmMail = array();
-
   // Default global parameters for UserAdvManager conf
   // -------------------------------------------------
-  $defaultUAM[0] = 'false';                                         // UAM_MAIL_INFO_TRUE/FALSE
-  $defaultUAM[1] = 'false';                                         // UAM_CONFIRM_MAIL_TRUE/FALSE
-  $defaultUAM[2] = '-1';                                            // UAM_No_Confirm_Group
-  $defaultUAM[3] = '-1';                                            // UAM_Validated_Group
-  $defaultUAM[4] = '-1';                                            // UAM_Validated_Status
-  $defaultUAM[5] = 'false';                                         // UAM_USERNAME_CHAR_TRUE
-  $defaultUAM[6] = '';                                              // UAM_USERNAME_CHAR_LIST
-  $defaultUAM[7] = '-1';                                            // UAM_No_Confirm_Status
-  $defaultUAM[8] = l10n('UAM_Default_InfoMail_Txt');                // UAM_MAILINFO_TEXT
-  $defaultUAM[9] = l10n('UAM_Default_ConfirmMail_Txt');             // UAM_CONFIRMMAIL_TEXT
-  $defaultUAM[10] = 'false';                                        // UAM_MAILEXCLUSION_TRUE/FALSE
-  $defaultUAM[11] = '';                                             // UAM_MAILEXCLUSION_LIST
-  $defaultUAM[12] = 'false';                                        // UAM_PASSWORDENF_TRUE/FALSE
-  $defaultUAM[13] = '100';                                          // UAM_PASSWORD_SCORE
-  $defaultUAM[14] = 'false';                                        // UAM_ADMINPASSWENF_TRUE/FALSE
-  $defaultUAM[15] = 'false';                                        // UAM_GHOSTRACKER_TRUE/FALSE
-  $defaultUAM[16] = '10';                                           // UAM_GHOSTRACKER_DAYLIMIT
-  $defaultUAM[17] = l10n('UAM_Default_GhstReminder_Txt');           // UAM_GHOSTRACKER_REMINDERTEXT
-  $defaultUAM[18] = 'false';                                        // UAM_ADDLASTVISIT_TRUE/FALSE
-  $defaultUAM[19] = 'false';                                        // UAM_ADMINCONFMAIL_TRUE/FALSE
-  $defaultUAM[20] = 'false';                                        // UAM_REDIRTOPROFILE_TRUE/FALSE
-  $defaultUAM[21] = 'false';                                        // UAM_GTAUTO_TRUE/FALSE
-  $defaultUAM[22] = 'false';                                        // UAM_GTAUTOMAIL_TRUE/FALSE
-  $defaultUAM[23] = l10n('UAM_Default_GhstDeletion_Txt');           // UAM_GTAUTODEL_TEXT
-  $defaultUAM[24] = l10n('UAM_Default_GhstDemotion_Txt');           // UAM_GTAUTOMAILTEXT
-  $defaultUAM[25] = '-1';                                           // UAM_Downgrade_Group
-  $defaultUAM[26] = '-1';                                           // UAM_Downgrade_Status
-  $defaultUAM[27] = l10n('UAM_Default_AdminValidation_Txt');        // UAM_ADMINVALIDATIONMAIL_TEXT
-  $defaultUAM[28] = 'false';                                        // UAM_CUSTOMPASSWRETR_TRUE/FALSE
-  $defaultUAM[29] = l10n('UAM_Default_PwdRequest_Txt');             // UAM_CUSTOMPASSWRETR_TEXT
-  $defaultUAM[30] = 'false';                                        // UAM_USRAUTO_TRUE/FALSE
-  $defaultUAM[31] = l10n('UAM_Default_ValidationTimeout_Txt');      // UAM_USRAUTODEL_TEXT
-  $defaultUAM[32] = 'false';                                        // UAM_USRAUTOMAIL_TRUE/FALSE
-  $defaultUAM[33] = 'false';                                        // UAM_STUFFS_TRUE/FALSE
-  $defaultUAM[34] = 'false';                                        // UAM_HIDEPASSW_TRUE/FALSE
-  $defaultUAM[35] = '-1';                                           // UAM_NO_VALID_LEVEL
-  $defaultUAM[36] = '-1';                                           // UAM_VALID_LEVEL
-  $defaultUAM[37] = '-1';                                           // UAM_DOWNGRADE_LEVEL
-  $defaultUAM[38] = 'false';                                        // UAM_PWDRESET_TRUE/FALSE
-  $defaultUAM[39] = 'false';                                        // UAM_REJECTCONNECT_TRUE/FALSE
-  $defaultUAM[40] = l10n('UAM_Default_RejectConnexion_Txt');        // UAM_REJECTCONNECT_TEXT
-  $defaultUAM[41] = l10n('UAM_Default_ConfirmMail_Subject');        // UAM_CONFIRMMAIL_SUBJECT
-  $defaultUAM[42] = l10n('UAM_Default_ConfirmMail_Remail_Subject'); // UAM_CONFIRMMAIL_REMAIL_SUBJECT
-  $defaultUAM[43] = l10n('UAM_Default_InfoMail_Subject');           // UAM_INFOMAIL_SUBJECT
-  $defaultUAM[44] = l10n('UAM_Default_GTAutoMail_Subject');         // UAM_GTAUTOMAIL_SUBJECT
-  $defaultUAM[45] = l10n('UAM_Default_GTReminder_Subject');         // UAM_GTREMINDER_SUBJECT
-  $defaultUAM[46] = l10n('UAM_Default_AdminValidationMail_Subject');// UAM_ADMINVALIDATIONMAIL_SUBJECT
+  $defaultUAM = array(
+    'MAIL_INFO'                   => 'false',
+    'CONFIRM_MAIL'                => 'false',
+    'NO_CONFIRM_GROUP'            => '-1',
+    'VALIDATED_GROUP'             => '-1',
+    'VALIDATED_STATUS'            => '-1',
+    'USERNAME_CHAR'               => 'false',
+    'USERNAME_CHAR_LIST'          => '',
+    'NO_CONFIRM_STATUS'           => '-1',
+    'MAILINFO_TEXT'               => l10n('UAM_Default_InfoMail_Txt'),
+    'CONFIRMMAIL_TEXT'            => l10n('UAM_Default_ConfirmMail_Txt'),
+    'MAILEXCLUSION'               => 'false',
+    'MAILEXCLUSION_LIST'          => '',
+    'PASSWORDENF'                 => 'false',
+    'PASSWORD_SCORE'              => '100',
+    'ADMINPASSWENF'               => 'false',
+    'GHOSTRACKER'                 => 'false',
+    'GHOSTRACKER_DAYLIMIT'        => '10',
+    'GHOSTRACKER_REMINDERTEXT'    => l10n('UAM_Default_GhstReminder_Txt'),
+    'ADDLASTVISIT'                => 'false',
+    'ADMINCONFMAIL'               => 'false',
+    'REDIRTOPROFILE'              => 'false',
+    'GTAUTO'                      => 'false',
+    'GTAUTOMAIL'                  => 'false',
+    'GTAUTODEL'                   => l10n('UAM_Default_GhstDeletion_Txt'),
+    'GTAUTOMAILTEXT'              => l10n('UAM_Default_GhstDemotion_Txt'),
+    'DOWNGRADE_GROUP'             => '-1',
+    'DOWNGRADE_STATUS'            => '-1',
+    'ADMINVALIDATIONMAIL'         => l10n('UAM_Default_AdminValidation_Txt'),
+    'CUSTOMPASSWRETR'             => 'false',
+    'CUSTOMPASSWRETR_TEXT'        => l10n('UAM_Default_PwdRequest_Txt'),
+    'USRAUTO'                     => 'false',
+    'USRAUTODEL'                  => l10n('UAM_Default_ValidationTimeout_Txt'),
+    'USRAUTOMAIL'                 => 'false',
+    'STUFFS'                      => 'false',
+    'HIDEPASSW'                   => 'false',
+    'NO_VALID_LEVEL'              => '-1',
+    'VALID_LEVEL'                 => '-1',
+    'DOWNGRADE_LEVEL'             => '-1',
+    'PWDRESET'                    => 'false',
+    'REJECTCONNECT'               => 'false',
+    'REJECTCONNECT_TEXT'          => l10n('UAM_Default_RejectConnexion_Txt'),
+    'CONFIRMMAIL_SUBJECT'         => l10n('UAM_Default_ConfirmMail_Subject'),
+    'CONFIRMMAIL_REMAIL_SUBJECT'  => l10n('UAM_Default_ConfirmMail_Remail_Subject'),
+    'INFOMAIL_SUBJECT'            => l10n('UAM_Default_InfoMail_Subject'),
+    'GTAUTOMAIL_SUBJECT'          => l10n('UAM_Default_GTAutoMail_Subject'),
+    'GTREMINDER_SUBJECT'          => l10n('UAM_Default_GTReminder_Subject'),
+    'ADMINVALIDATIONMAIL_SUBJECT' => l10n('UAM_Default_AdminValidationMail_Subject')
+  );
   
   // Default specific parameters for UserAdvManager ConfirmMail conf
   // ---------------------------------------------------------------
-  $defaultConfirmMail[0] = 'false';                                 // UAM_CONFIRMMAIL_TIMEOUT_TRUE/FALSE
-  $defaultConfirmMail[1] = '5';                                     // UAM_CONFIRMMAIL_DELAY
-  $defaultConfirmMail[2] = l10n('UAM_Default_CfmMail_Remail_Txt1'); // UAM_CONFIRMMAIL_REMAIL_TXT1
-  $defaultConfirmMail[3] = 'false';                                 // UAM_CONFIRMMAIL_REMAIL_TRUE/FALSE
-  $defaultConfirmMail[4] = l10n('UAM_Default_CfmMail_Remail_Txt2'); // UAM_CONFIRMMAIL_REMAIL_TXT2
-  $defaultConfirmMail[5] = l10n('UAM_Default_CfmMail_Custom_Txt1'); // UAM_CONFIRMMAIL_CUSTOM_TXT1
-  $defaultConfirmMail[6] = l10n('UAM_Default_CfmMail_Custom_Txt2'); // UAM_CONFIRMMAIL_CUSTOM_TXT2
+  $defaultConfirmMail = array(
+    'CONFIRMMAIL_TIMEOUT'     => 'false',
+    'CONFIRMMAIL_DELAY'       => '5',
+    'CONFIRMMAIL_REMAIL_TXT1' => l10n('UAM_Default_CfmMail_Remail_Txt1'),
+    'CONFIRMMAIL_REMAIL'      => 'false',
+    'CONFIRMMAIL_REMAIL_TXT2' => l10n('UAM_Default_CfmMail_Remail_Txt2'),
+    'CONFIRMMAIL_CUSTOM_TXT1' => l10n('UAM_Default_CfmMail_Custom_Txt1'),
+    'CONFIRMMAIL_CUSTOM_TXT2' => l10n('UAM_Default_CfmMail_Custom_Txt2')
+  );
   
   // Set current plugin version in config table
@@ -290,6 +291,6 @@
 /* Check for upgrade from 2.12 to 2.13 */
 /* *********************************** */
-    $fields = mysql_list_fields($conf['db_base'],USER_CONFIRM_MAIL_TABLE);
-    $nb_fields = mysql_num_fields($fields); 
+    $fields = pwg_query('SHOW COLUMNS FROM '.USER_CONFIRM_MAIL_TABLE.';');
+    $nb_fields = pwg_db_num_rows($fields);
 
     if ($nb_fields < 6)
@@ -404,4 +405,11 @@
       upgrade_2400_2410();
     }
+
+    if (version_compare($conf['UserAdvManager_Version'], '2.50.0') < 0)
+    {
+    /* upgrade from version 2.41.x to 2.50.0 */
+    /* ************************************* */
+      upgrade_2410_2500();
+    }
   }
 
