virtualmin list-users ignores --user <username> and show all users in domain

Hello Folks!

Another issue, what is problem here ?

Listing only one user email: [root@lina scripts]# virtualmin list-users --domain ward.ing-steen.se --user kalle --email-only kalle@ward.ing-steen.se kalle@ing-steen.se nizze@ward.ing-steen.se

All users emal in doman is shown...

Status: 
Closed (fixed)

Comments

I can confirm this (mis)behavior.

I took a look at the source code of the "list-users" command, and found these lines which struck me as odd:

      next if (%usernames && !$usernames{$u->{'user'}} &&
                      !$usernames{&remove_userdom($u->{'user'}, $d)});

While the "$usernames" variable gets filled with command line parameters, I could find no other reference to "%usernames" in the code, so the problem might be related to this line? I'm not a PERL coder, but maybe an incorrect (boolean) variable / command line switch?

EDIT: After taking a CLOSER look at the code, it seems that the "--user" command line switch is only taken into account in the branch of the code that performs the output if also the "--multiline" parameter was given. Is that intentional? :) It actually does work in that case; with "--multiline", only the selected "--user" is printed.

Thanks for reporting this - I will fix this bug in the 4.02 Virtualmin release.

Automatically closed -- issue fixed for 2 weeks with no activity.