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

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

Serving Software Downloads in 956 Categories, Downloaded 50.376.404 Times

Suppress Teasers 6.x-1.1

  Date Added: June 12, 2013  |  Visits: 511

Suppress Teasers

Report Broken Link
Printer Friendly Version


Product Homepage
Download (40 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
USER REVIEWS
More Reviews or Write Review


SUPPRESS TEASERS RELATED
Modules  -  SMS paid content 0.1
In order to allow a user to review the restricted content, individual access passwords are generated.InstallationUnpack and upload it to the /wp-content/plugins/ directory.Activate the plugin through the 'Plugins' menu in WordPress. Requirements:...
 
Modules  -  Domain Rules 6.x-1.0
Adding Rules module actions related to Domain Access module.Allowing automation of different actions needed to create/modify/delete domains.First version includes:# rules_action_create_domain - create new domain using given arguments#...
10 KB  
Modules  -  OG Access Admins 6.x-1.0-beta2
The OG Access Admins module allows to restrict permissions to change audience/visibility of posts belonging to a group to only administrators of this group.This feature to restrict access control to group admins only seems to have been very often...
10 KB  
Modules  -  Card Access Services CAS Connect 1.0
Card Access Services CAS Connect - CAS Connect module for osCommerce
 
Modules  -  Comment Dialogue 5.x-1.1
Timer defines a CCK field type for a timer, which can be started, stopped and reset via timer button controls or workflow actions. Timer fields can be shown in real-time with DHTML or only updated on page refresh. Timer button controls can be...
10 KB  
Modules  -  Node Menu Parent 6.x-1.1
The Node Menu Parent module extends the "default menu for content" setting provided by the core menu module by allowing a specific menu item to be selected (not just a top-level menu) per content type.ExampleImagine we're creating a site for a...
10 KB  
Modules  -  Node to Word 6.x-1.0
The Node to Word module simply provides two links in the links area of nodes of the enabled content types. These links are: * Save as Word * Save as textThis module is in development, but it is also in production use and is stable. Some admin...
10 KB  
Database Tools  -  Itzam 3.1.1
Itzam its a library that creates and manipulates files containing variable-length, random access records. Information is referenced by a user-defined key value; indexes may be combined with or separate from data. Itzam is a deliberately...
348.16 KB  
Utilities  -  Corner Bowl Disk Monitor (formerly DiskMonitor) 10.0.0.81
Disk Monitor is a network wide disk monitoring tool enabling IT to centrally manage free disk space, content and access. Monitor free disk space, SMART predictive failure notifications and directory sizes. Generate reports such as: largest files,...
 
Database Tools  -  Data Base Process 0.1
This script can access records ang manage MySQL database tables. It can connect to MySQL database, execute queries, retrieve results into arrays or objects and execute SELECT, INSERT, UPDATE and DELETE queries from parameters.The script can also...
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