New generate function super than search_for_login

Purpose to introduce this new function is enable search by ldap attribute, for example by cn when called, but the login attribute can set to email/employeeid.