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
As long as you have admin-only or approval-only registrations, what's the big deal? It's just another doorway - people are very used to them.
A
On Wed, Jun 10, 2009 at 1:27 PM, sinkingfishsinkingfish@gmail.com 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
View this message in context: http://www.nabble.com/Hiding-admin-section---log-in---tp23964571p23964571.ht... Sent from the Drupal - Support mailing list archive at Nabble.com.
-- [ Drupal support list | http://lists.drupal.org/ ]
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
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.
- 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"
- 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/ ]
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.
- 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"
- 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/ ]
/user will present a login form to anonymous users, as well.
2009/6/10 sinkingfish sinkingfish@gmail.com
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.
- 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"
- 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.ht... Sent from the Drupal - Support mailing list archive at Nabble.com.
-- [ Drupal support list | http://lists.drupal.org/ ]
You don't want the leading slash with drupal_goto
On Wed, Jun 10, 2009 at 4:02 PM, sinkingfish sinkingfish@gmail.com wrote:
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.
- 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"
- 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.ht... Sent from the Drupal - Support mailing list archive at Nabble.com.
-- [ Drupal support list | http://lists.drupal.org/ ]