Created
January 10, 2012 04:54
-
-
Save dmuth/1587038 to your computer and use it in GitHub Desktop.
Drupal shows "create content" menu item to anonymous users
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * From my blog post at: | |
| * | |
| * http://www.dmuth.org/node/1201/drupal-shows-create-content-menu-item-anonymous-users | |
| * | |
| */ | |
| if (strstr($_SERVER["REQUEST_URI"], "/node/add")) { | |
| if (empty($user->uid)) { | |
| drupal_set_message("You must be logged in to do that"); | |
| drupal_goto("user"); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment