Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 976 Categories, Downloaded 30.136.580 Times

Suppress Teasers 6.x-1.1

  Date Added: June 12, 2013  |  Visits: 303

Suppress Teasers

Report Broken Link
Printer Friendly Version


Product Homepage
Download (18 downloads)

ConceptThe current Drupal core defines two content types, page and story. Anyone with 'access content' permissions is able to see both the nodes these content types define, as well as the teasers that they provide.When creating modules that define new content types, the developer can set 'view' permissions inside hook_access(). However, this hook is not called when rendering teasers, and as a result, users who do not have permissions to view the node itself (but do have 'access content' permissions), will still be able to view the teaser for the node. This can be a risk to the security of the data on your site, as users may be able to see content of nodes that they shouldn't be able to see.Who this module is forThis module is useful for two groups of people: * Module developers whose modules define custom content types in which the teaser shows even though permissions haven't been granted to the user in hook_access(). * Site administrators whose sites that are showing teasers for custom content types even though the user doesn't have permissions to view the content type.BackgroundDrupal has a two step system for determining whether a user has access to the four core actions performed on nodes: create, edit, delete and view. The first step is in hook_access(), which defines access permissions for all nodes of the entire node type. This hook is called each time a user tries to perform one of the four core actions on a node. If no value is returned from this hook, the system then goes on to look at the grant system, which determines whether a user can perform one of the four core actions on a per node basis. This grants system is made up of two hooks: hook_node_access_records(), which is called whenever a node is saved, and states the circumstances under which a user can perform any of the four core actions on it, and hook_node_grants(), which is called whenever a user tries to perform any of those four core actions on a node, in the case that no value was returned from hook_access().Now where the problem arises is that calling hook_access() every time a teaser is rendered is fairly resource intensive. But calling on the grants system is much less intensive (based on how the Drupal query has been constructed). So teasers are only compared against the grants system, not hook_access(). As such, if hook_node_access_records() and hook_node_grants() are not properly defined in a module that defines a custom node type, the teaser will render, regardless of whether a user returns a value for 'view' in hook_access().SolutionIdeal SolutionThe ideal solution to the problem of teasers being rendered when they shouldn't be, is to implement hook_node_access_records() and hook_node_grants(), which is the proper Drupal method. However, these can be very difficult to understand, and there seems to be a lack of information on how to do this properly, so it can be a difficult task for many module builders. Which is where the other solution comes in:The Less Ideal SolutionThis module was created as a stop gap measure to deal with the problem. This module calls hook_access upon the rendering of each teaser and checks if the user has the permission to view the node. If they don't have permission to view the node in question, all content is stripped from the teaser, and a message is provided informing the user that they don't have permissions to view that teaser. This works for all teasers everywhere, all the time.Issues with this module * There is no way to prevent the node from rendering in the first place. So instead of the teaser not rendering at all, which would be preferable, the space where the teaser should have been is rendered with a message informing them that they do not have permissions to view the information contained (not as ideal, but still a solution to the initial problem). * Be warned that installing this module will place an additional burden on your server when rendering pages containing teasers, as it has to add a permissions check for each teaser it renders.Module usage * This module works right away upon installation. Upon installation, teasers will be suppressed without any need for configuration. * Users are shown the message "You do not have permission to view this item" for any teasers that have been suppressed. To change this message, navigate to admin/settings/suppress_teasers, and set your message there.Updates * July 6, 2009 o As requested in my issue queue, I added a message that displays when the user does not have permission to see the node, as well as the ability to change that message at admin/settings/suppress_teasers. o Japanese translation for default message added

Requirements: No special requirements
Platforms: PHP
Keyword: Actions Called Content Hook Access Hook Node Access Records Hook Node Grants Message Module Nodes Perform Permission Permissions Problem Rendering System Teaser Teasers Types
Users rating: 0/10

License: Freeware Size: 10 KB
SUPPRESS TEASERS RELATED
Modules  -  Node Access Rebuild Bonus 6.x-1.2
Small module that provides a history of the last 20 node access rebuilds at admin/content/node-settings/rebuild (i.e the "Are you sure you want to rebuild the permissions on site content?" page).
10 KB  
Modules  -  Ecommerce Node Access Product 1.0
Define nodes which have 'purchasable access'; these nodes cannot be seen by anyone except for the Author, Administrators, and anyone who purchases the relevant 'Node Access' product. 'Node Access' products grant view access to 'purchasable access'...
 
Modules  -  Node Access Arbitrator 4.7.x-1.0
The Node Access Arbitrator is an experimental module API designed to allow multiple node access systems to work together.Currently it is 4 modulesna_arbitrator This is the core API module that all of the other modules depend on. acl This is a...
20.48 KB  
E-Mail Tools  -  BoboMail 0.6pre1
BoboMail is a so called webmail application, which provides mail access through a web interface. It is distributed under the GNU GPL. See COPYING in the package or go to http://www.gnu.org for details. The first version of BoboMail was used...
296.96 KB  
Modules  -  Node Access Control 5.x--beta1 1.0
Permissions can be dynamically created in the administration interface of this module. You can turn node access control on/off for each node type (default off). When node access control is enabled for a node type, the node form will allow you to...
 
Modules  -  Node Access Control 5.x--beta1 1.0
Permissions can be dynamically created in the administration interface of this module. You can turn node access control on/off for each node type (default off). When node access control is enabled for a node type, the node form will allow you to...
 
Modules  -  Domain User Edit 6.x-1.x-de
Domain user edit is used to restrict access to edit users to only let users with the 'administer users' permission AND assigned to the same domain, using the Domain module, to edit the user.To by-pass this restriction, you can assign the new...
10 KB  
Modules  -  Node Relativity Access Control 5.x-1.3 1.0
Node Relativity Access Control restricts access to nodes that are in relativity relationships. The module gives a user access to a node and all of its children. By default, each node's author is granted this access to children and grandchildren...
 
Modules  -  OG User Roles Access 6.x-1.x-de
OG User Roles Access (OGURA) extends OGUR 4+ (OG User Roles) and introduces group roles specific node access realms.Thus you can specify assign group specific roles to a user and have per content type specific access permissions.This module...
10 KB  
Modules  -  Node access user reference 7.x-3.6
Allows you to configure a CCK User reference field so that the user whom is referenced in a node is granted access to view the node. There are also options to give the user access to edit or delete the node.This is great if you want your node...
10 KB  
NEW DOWNLOADS IN SCRIPTS, MODULES
Scripts  -  Free Ecommerce website creator 1.2
Free Ecommerce website creator is a free PHP shop creating script. This allows you to put a online shop on your own website. Create your own free ecommerce website for Your Business. Create an online shop using easyGUI online shop creator. The...
1.44 KB  
Scripts  -  MochiGames PHP Script ZDR 1.00
MochiGames PHP Script ZDR is web site, ready for use, for flash games. These flash games are downloaded automatically by "MochiGames PHP Script ZDR" from MochiGames media. The use of the games is free, you can use your own Mochi Publisher ID and...
368.54 KB  
Scripts  -  Php Chat 2.0
Add a free php site, single sign-on and multiple skins, 100% free 1. Server Modes: The chat server has paid mode and free mode. If the free chat mode, a free chat room will be assigned to your website with your domain as the room name. 2....
938.87 KB  
Scripts  -  Nibbleblog 3.0.1
Nibbleblog it's a powerful engine for creation and manipulation of BLOG's completely free. Very simple to install and configure (Only 1 step). The database used is based on XML files and this way it is not necessary to use MySQL or similar DBMS....
371.09 KB  
Scripts  -  PHP File Manager | CloudOsys 2.9b8
CloudOsys is a PHP file manager, a tool that allows your visitors upload files such as media content directly to your website. Your visitors will upload files directly to your website, where they can share and comment on them. Through cloud...
1.41 MB  
Modules  -  TinyMCE Node Picker 6.x-2.1
This module will de discontinued and replaced with Node Picker as soon as a stable release is available.TinyMCE Node Picker provides a button in TinyMCE that displays a list of links to content. Choosing a link inserts it into the editor.The...
20.48 KB  
Modules  -  Fapilicious 5.x-1.x-de
Fapilicious is a collection of FormAPI goodies.I hope to make it a repository of reusable FormAPI trickery and short cuts. Currently it has small collection of powerful FormAPI element validators.Please submit your favorite tricks as patches so we...
10 KB  
Modules  -  Donation Goals 6.x-1.x-de
The Donation Goals module lets you create nodes of the type "Donation Goal." These goals allow you to set an amount of money you'll need for whatever you're saving up for. Visitors of the site can then donate money through PayPal. Once the target...
20.48 KB  
Modules  -  Plica Twitter 1.0.1
Plica TwitterInstallation : * Download, unzip, and install plugin dir in /wp-content/plugins * Activate * All right now
10 KB  
Modules  -  Page Array 5.x-1.x-de
The pagearray module is a small (single function) helper module that can be used whenever there is a need to load the output of any Drupal path in data form. Based on the code in index.php, Page Array bypasses the theme('page') call, instead...
10 KB