You don't want the leading slash with drupal_goto<br><br><div class="gmail_quote">On Wed, Jun 10, 2009 at 4:02 PM, sinkingfish <span dir="ltr"><<a href="mailto:sinkingfish@gmail.com">sinkingfish@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
ok so I was having a bit of a look about and thought of this :<br>
create a page notd and add the code below with the php input format.<br>
<br>
<br>
<?php<br>
<br>
if (!$user->uid) {<br>
print drupal_get_form('user_login');<br>
} else {<br>
drupal_goto('/admin');<br>
}<br>
<br>
?><br>
<br>
<br>
but the site doesn't redirect to admin, it redirects to the user's history<br>
page :(<br>
<div><div></div><div class="h5"><br>
<br>
sinkingfish wrote:<br>
><br>
> Thanks for the reply. Just a few q's :)<br>
><br>
> If I disable the log in for on the admin screens. How do I then gain<br>
> access to the site? Would you be better displaying the login on a specific<br>
> page? eg <a href="http://www.example.com/cms" target="_blank">www.example.com/cms</a> ? Can you set a theme for different node,<br>
> i.e. garland (my admin theme) to the path /cms<br>
><br>
> I'm just starting out using Drupal but so far I'm loving it<br>
><br>
><br>
><br>
> Seth Freach wrote:<br>
>><br>
>> Brian,<br>
>><br>
>> Are you wanting to only hide the login block? If so, either of the below<br>
>> relatively quick options should work for you. Do which ever works best<br>
>> for your needs, you don't need to do both.<br>
>><br>
>> 1) via the clicking in the browser:<br>
>> - go to ?q=admin/build/block/configure/user/0<br>
>> - in the "Page specific visibility settings" section, select the first<br>
>> option: "show on every except..."<br>
>> - in the pages: text block in that section, enter 2 lines:<br>
>> admin<br>
>> admin/*<br>
>> - click "save block"<br>
>><br>
>> 2) via theme code:<br>
>> - in your theme's directory, find a file named 'block.tpl.php'<br>
>> - copy that to a new file named 'block-user-0.tpl.php'<br>
>> - add the following code near the top of the new file:<br>
>> <?php<br>
>> if (arg(0) == 'admin' && !$user->uid) {<br>
>> return;<br>
>> }<br>
>> ?><br>
>><br>
>> Or are you looking to deliver a 404 message at the /admin path to<br>
>> anonymous visitors? If this is your need, you'd be better off doing it<br>
>> in module code, rather than at the theme layer.<br>
>><br>
>> Seth<br>
>><br>
>> sinkingfish wrote:<br>
>>> Hi<br>
>>><br>
>>> I'm wondering to hide the admin zone, so if someone goes to<br>
>>> <a href="http://www.example.com/admin" target="_blank">www.example.com/admin</a> they aren't presented with a login to my site.<br>
>>> I've<br>
>>> been looking around and can't find anything on this, surly this would be<br>
>>> a<br>
>>> common issue.<br>
>>><br>
>>> Any hints and tips welcome.<br>
>>><br>
>>> Brian<br>
>>><br>
>> --<br>
>> [ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br>
>><br>
>><br>
><br>
><br>
<br>
--<br>
</div></div>View this message in context: <a href="http://www.nabble.com/Hiding-admin-section---log-in---tp23964571p23969911.html" target="_blank">http://www.nabble.com/Hiding-admin-section---log-in---tp23964571p23969911.html</a><br>
<div><div></div><div class="h5">Sent from the Drupal - Support mailing list archive at Nabble.com.<br>
<br>
--<br>
[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br>
</div></div></blockquote></div><br>