Adding existing SQL user does not list all users

  • Tested with i-MSCP 1.1.14, but according to github it also exists in the latest version:


    Following users are available:

    • myuser@localhost
    • myuser@%


    When trying to add those users to a SQL database, only one of the users is shown.


    This is probably because of line 150 in imscp/gui/public/client/sql_user_add.php

    Code
    1. if ($prevSeenName != $row['sqlu_name'] && !in_array($row['sqlu_name'], $userList)) {


    The if condition should also consider sqlu_host.

  • @MuhKuh



    Confirmed ;)

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • @MuhKuh


    Please, can you give a try by replacing the function client_generateSqlUserList() in the file gui/public/client/sql_user_add.php with:



    Thanks ;)

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Almost :)


    It gives some duplicates now if the user was already used in multiple databases

  • @MuhKuh


    Duplicate rows in the resulting HTML select element ? It's normally not possible.


    Thanks ;

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • @MuhKuh


    Confirmed. I'll review the SQL clause to avoid that ;)

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • @MuhKuh




    Thanks ;)

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206