[support] Hiding admin section / log in ?
sinkingfish
sinkingfish at gmail.com
Wed Jun 10 20:02:32 UTC 2009
ok so I was having a bit of a look about and thought of this :
create a page notd and add the code below with the php input format.
<?php
if (!$user->uid) {
print drupal_get_form('user_login');
} else {
drupal_goto('/admin');
}
?>
but the site doesn't redirect to admin, it redirects to the user's history
page :(
sinkingfish wrote:
>
> Thanks for the reply. Just a few q's :)
>
> If I disable the log in for on the admin screens. How do I then gain
> access to the site? Would you be better displaying the login on a specific
> page? eg www.example.com/cms ? Can you set a theme for different node,
> i.e. garland (my admin theme) to the path /cms
>
> I'm just starting out using Drupal but so far I'm loving it
>
>
>
> Seth Freach wrote:
>>
>> 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
>>>
>> --
>> [ Drupal support list | http://lists.drupal.org/ ]
>>
>>
>
>
--
View this message in context: http://www.nabble.com/Hiding-admin-section---log-in---tp23964571p23969911.html
Sent from the Drupal - Support mailing list archive at Nabble.com.
More information about the support
mailing list