Block users access the network through the direct link


I have a multisite network

Using Hacks in function.php of my theme I took several things from the control panel of users of blogging.

But I discovered that it is still possible to access via the direct link, example:

Any idea to block this access code, being possible only for superadmin access?

I look forward