Getting all databases which a sql logon can connect
You should be able to do something like this:

EXECUTE AS login = 'loginname';

SELECT name
FROM sys.databases
WHERE HAS_DBACCESS(name) = 1;

REVERT;


For reference see EXECUTE AS and HAS_DBACCESS