[support] Hiding admin section / log in ?

Seth Freach sfreach at gmail.com
Wed Jun 10 19:19:29 UTC 2009


Brian,

Are you wanting to only hide the login block? If so, either of the below 
relatively quick options should work for you. Do which ever works best 
for your needs, you don't need to do both.

1) via the clicking in the browser:
 - go to ?q=admin/build/block/configure/user/0
 - in the "Page specific visibility settings" section, select the first 
option: "show on every except..."
 - in the pages: text block in that section, enter 2 lines:
     admin
     admin/*
 - click "save block"

2) via theme code:
 - in your theme's directory, find a file named 'block.tpl.php'
 - copy that to a new file named 'block-user-0.tpl.php'
 - add the following code near the top of the new file:
<?php
if (arg(0) == 'admin' && !$user->uid) {
  return;
}
?>

Or are you looking to deliver a 404 message at the /admin path to 
anonymous visitors? If this is your need, you'd be better off doing it 
in module code, rather than at the theme layer.

Seth

sinkingfish wrote:
> Hi
>
> I'm wondering to hide the admin zone, so if someone goes to
> www.example.com/admin they aren't presented with a login to my site. I've
> been looking around and can't find anything on this, surly this would be a
> common issue.
>
> Any hints and tips welcome.
>
> Brian
>   


More information about the support mailing list