In Cairo there were two registration topics.
One called TWikiRegistration and one called TWikiRegistrationPub.
The Pub had no login name field and it asked for a password which TWiki stored in a password file.
The non-Pub had an extra login name field and it did not ask for password.
The idea was that if you had an Internet public site you would remove the TWikiRegistration topic and change the name of TWikiRegistrationPub to TWikiRegistration.
This was confusing. Dakar does this better by having only one TWikiRegistration topic with an IF that only shows the username when the configure parameter $cfg{Register}{AllowLoginName} is set.
Unfortunately the password fields are not conditionally shown.
In reality these fields should not be included when cfg{PasswordManager} is set to None. But this is not an available IF condition.
However - it is hard to imagine an installation where you have different login names and WikiNames and still let TWiki store a password in a .htpasswd file when you register. I would say that it would be very safe to assume that when you do have a login name TWiki should not prompt for a password to be set. NOTE that the password fields in the registration form are used to SET the password. Not to authenticate the registration.
Making TWiki.TWikiRegistration with an additional IF to add password field when $cfg{Register}{AllowLoginName} is not set will make in my view a well working solution - which gives the same function as we had with the two topics in Cairo. Some may later implement the code to make the IF linked to {PasswordManager} but as long as we only have the HtPasswdUser/!ApacheHtPasswdUser shipping with TWiki I see little reason for hurrying this now.
I have attached a diff that implements the conditional password fields and I have taken care not to alter any MAKETEXT.
KJL
Checked in your patch in SVN 8525
CC