Manual:$wgBlockDisablesLogin

Details
If true, blocked users will not be allowed to login. When using this with a public wiki, the effect of logging out blocked users may actually be avers: unless the user's address is also blocked (e.g. auto-block), logging the user out will again allow reading and editing, just as for anonymous visitors.