Changeset 9388 for extensions


Ignore:
Timestamp:
Feb 26, 2011, 5:46:35 PM (13 years ago)
Author:
Eric
Message:

-Check if username already exists before modification

  • Final step for localisation files update : FR and EN files are up to date.
Location:
extensions/LCAS/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/LCAS/trunk/admin/LCAS_admin.php

    r9384 r9388  
    8282       
    8383        if ((isset($_POST['user-'.$lcas_UserToUpdate])) && ($_POST['user-'.$lcas_UserToUpdate] != '')) {
    84           // Vérifier si le nom n'est pas déjà pris
    85          
    86          
    87          
    88           // Mise à jour du nom
     84          // Check if username already exists
    8985          $query = '
    90             UPDATE '.USERS_TABLE.'
    91             SET username="'.addslashes($_POST['user-'.$lcas_UserToUpdate]).'"
    92             WHERE id='.$lcas_UserToUpdate.'
    93             LIMIT 1
     86            SELECT username
     87            FROM '.USERS_TABLE.'
     88            WHERE username="'.addslashes($_POST['user-'.$lcas_UserToUpdate]).'"
    9489            ;';
    9590
    96           pwg_query($query);
     91          $count = pwg_db_num_rows(pwg_query($query));
     92         
     93          if ($count != 0)
     94          {
     95            // Username update
     96            $query = '
     97              UPDATE '.USERS_TABLE.'
     98              SET username="'.addslashes($_POST['user-'.$lcas_UserToUpdate]).'"
     99              WHERE id='.$lcas_UserToUpdate.'
     100              LIMIT 1
     101              ;';
    97102
    98         if (isset($conf_LCAS[1]) and $conf_LCAS[1] == 'true')
    99         {
    100           LCAS_SendMail($lcas_UserToUpdate, $_POST['user-'.$lcas_UserToUpdate]);
    101         }
     103            pwg_query($query);
    102104
    103           array_push($page['infos'], l10n('LCAS_Info_userlist_username_renamed'));
     105            if (isset($conf_LCAS[1]) and $conf_LCAS[1] == 'true')
     106            {
     107              LCAS_SendMail($lcas_UserToUpdate, $_POST['user-'.$lcas_UserToUpdate]);
     108            }
     109
     110            array_push($page['infos'], l10n('LCAS_Info_userlist_username_renamed'));
     111          }
     112          else
     113          {
     114            // Username already exists
     115            array_push($page['errors'], l10n('LCAS_Err_Userlist_New_Username_Exists'));
     116          }
    104117        }
    105118        else {
  • extensions/LCAS/trunk/language/en_UK/plugin.lang.php

    r9384 r9388  
    33global $lang;
    44
    5 $lang['LCAS_Tab_Global'] = 'Configuration';
    65$lang['LCAS_Title_Tab'] = 'Login Case Accents Sensitivity';
    76$lang['LCAS_SubTitle_Global'] = 'Plugin configuration';
    87
    98$lang['LCAS_Title_Global'] = 'Setting the sensitivity';
    10 
    119
    1210$lang['LCAS option'] = 'LCAS option:';
     
    1917$lang['Personalized not allowed tooltip'] = 'No array $conf[\'LCAS_replacement_set\'][0] is defined';
    2018
    21 $lang['LCAS_Accent_Sensitive'] = 'Accents insensivity:';
    22 
    23 $lang['LCAS_currentPWGConfigHeader'] = 'Current Piwigo\'s setting';
    24 
    2519$lang['LCAS_Support_txt'] = 'The official support on this plugin is only on these Piwigo\'s forum topics:<br>
    2620<a href="http://fr.piwigo.org/forum/viewtopic.php?pid=158565" onclick="window.open(this.href);return false;">French forum - http://fr.piwigo.org/forum/viewtopic.php?id=ToDefine</a>
     
    2923Also available, the project\'s bugtracker: <a href="http://piwigo.org/bugs/" onclick="window.open(this.href);return false;">http://piwigo.org/bugs/</a>';
    3024
    31 
    32 
    33 $lang['LCAS_Tab_UserList'] = 'Users validation';
    34 $lang['LCAS_SubTitle_UserList'] = 'Users check';
    35 
    3625$lang['LCAS_UserList_Title'] = 'Users requiring changes';
    37 
    3826
    3927$lang['LCAS_Info_userlist_username_renamed'] = 'The user name has been updated.';
    4028$lang['LCAS_Err_Userlist_Empty_New_Username'] = 'The user name can\'t be blank.';
     29$lang['LCAS_Err_Userlist_New_Username_Exists'] = 'The user name already exists.';
    4130
    4231$lang['LCAS_Compare_value_h'] = 'Comparison';
    4332$lang['LCAS_Update_h'] = 'Change';
    44 $lang['LCAS_Notify_h'] = 'Notify';
    4533
    4634$lang['LCAS_Update_User'] = 'Update';
    47 $lang['LCAS_Send_Email'] = 'Email sent';
    4835
    4936$lang['LCAS_No_User'] = 'No problems found for current users';
    50 
    5137
    5238$lang['LCAS_save_config'] = 'Settings saved<br>Please check any duplicate users in the following table.';
     
    5440$lang['submit'] = 'Save settings';
    5541
     42$lang['LCAS_Mail'] = 'Notification par email';
    5643$lang['LCAS_MailText'] = 'Customizing email notification';
    5744
    5845$lang['LCAS_PluginSupport'] = 'Official plugin support';
    59 
    60 $lang['LCAS_Mail'] = 'Notification par email';
    6146
    6247$lang['LCAS_DisableOption'] = ' Disable (default value)';
  • extensions/LCAS/trunk/language/fr_FR/plugin.lang.php

    r9384 r9388  
    33global $lang;
    44
    5 $lang['LCAS_Tab_Global'] = 'Configuration';
    65$lang['LCAS_Title_Tab'] = 'Login Case Accents Sensitivity';
    76$lang['LCAS_SubTitle_Global'] = 'Configuration du plugin';
    87
    98$lang['LCAS_Title_Global'] = 'Paramétrage de la sensibilité';
    10 
    119
    1210$lang['LCAS option'] = 'Option LCAS :';
     
    1917$lang['Personalized not allowed tooltip'] = 'Pas de tableau $conf[\'LCAS_replacement_set\'][0] de défini';
    2018
    21 $lang['conf[insensitive_case_logon] is true'] = '$conf[\'insensitive_case_logon\'] vaut true';
    22 $lang['conf[insensitive_case_logon] is false'] = '$conf[\'insensitive_case_logon\'] vaut false';
    23 
    24 $lang['LCAS_currentPWGConfigHeader'] = 'Paramètre actuel de Piwigo';
    25 
    2619$lang['LCAS_Support_txt'] = 'Le support officiel sur ce plugin se fait exclusivement sur ces fils du forum Piwigo:<br>
    2720<a href="http://fr.piwigo.org/forum/viewtopic.php?pid=158565" onclick="window.open(this.href);return false;">Forum français - http://fr.piwigo.org/forum/viewtopic.php?id=ToDefine</a>
     
    3023Egalement disponible, le bugtracker du projet: <a href="http://piwigo.org/bugs/" onclick="window.open(this.href);return false;">http://piwigo.org/bugs/</a>';
    3124
    32 
    33 
    34 $lang['LCAS_Tab_UserList'] = 'Validation des utilisateurs';
    35 $lang['LCAS_SubTitle_UserList'] = 'Vérification des utilisateurs';
    36 
    3725$lang['LCAS_UserList_Title'] = 'Utilisateurs nécessitant des modifications';
    38 
    3926
    4027$lang['LCAS_Info_userlist_username_renamed'] = 'Le nom de l\'utilisateur a été mis à jour.';
    4128$lang['LCAS_Err_Userlist_Empty_New_Username'] = 'Le nom de l\'utilisateur ne peut être vide.';
     29$lang['LCAS_Err_Userlist_New_Username_Exists'] = 'Le nom de l\'utilisateur existe déjà.';
    4230
    4331$lang['LCAS_Compare_value_h'] = 'Comparaison';
    4432$lang['LCAS_Update_h'] = 'Modifier';
    45 $lang['LCAS_Notify_h'] = 'Notifier';
    4633
    4734$lang['LCAS_Update_User'] = 'Mettre &agrave; jour';
    48 $lang['LCAS_Send_Email'] = 'Envoyer email';
    4935
    5036$lang['LCAS_No_User'] = 'Aucun problème détecté pour les utilisateurs actuels';
    51 
    5237
    5338$lang['LCAS_save_config'] = 'Paramètres enregistrés<br>Veuillez vérifier les éventuels utilisateurs problématiques dans le tableau ci-dessous';
     
    5540$lang['submit'] = 'Sauvegarder les paramètres';
    5641
     42$lang['LCAS_Mail'] = 'Notification par email';
    5743$lang['LCAS_MailText'] = 'Personnalisation de la notification par email';
    5844
    5945$lang['LCAS_PluginSupport'] = 'Support officiel du plugin';
    60 
    61 $lang['LCAS_Mail'] = 'Notification par email';
    6246
    6347$lang['LCAS_DisableOption'] = ' Désactiver (valeur par défaut)';
Note: See TracChangeset for help on using the changeset viewer.