Change Login Form:Username to Select Text
Yes we can do it using function hook_form_alter(&amp;$form, &amp;$form_state, $form_id) {}

Just include this function in template.php of your theme or in you module.

If you theme name is "testtheme" then replace hook with you theme name(testtheme). 

OR 
you can include it in your custom module. If you have custom module with name "testmod"  then just add this code in your module and replace the hook with your module name (testmod)

function **hook**_custom_form_alter(&amp;$form, $form_state, $form_id){

    //Get the users  from database or keep it static according to requirement
    $users  =   array("user1"=&gt;"User 1","user2"=&gt;"User 2","user3"=&gt;"User 3");
    if($form_id=="user_login"){
    $form['name']['#type'] = "select";
    $form['name']['#options'] = $users;
    $form['name']['#required'] = true;
   $form['name']['#size']='auto';

    }


    }


Don't forget to clear drupal cache.
Hope it will help!