No known problems

Secure Permissions

Last modified: November 22, 2009 - 19:07

Secure Permissions disables the user interface for creating and assigning roles and permissions.

Secure Permissions is an advanced security module for Drupal 7. It disables the Roles and Permissions editing screens and lets all user roles and permissions be handled through code. This adds an extra layer of security, as the site's permission can no longer be misconfigured accidentally.

This module was inspired the security paradigm of the Plone platform. See, in particular, 'Problem A2: Broken Access Control' in the Plone documentation.

----
1. Use case

This module is designed for cases where you want control of Roles and
Permissions only in a development environment. When fully enabled, this module
will make it so that the live site cannot have its permissions modified, except
through code.

It may be sufficient for most users to simply enable this module on the live
site, and to disable it when it is no longer needed.

----
2. Installation

Before installing this module you should configure the site Roles and
Permissions as you see fit. After installing and configuring this module,
changes to these settings can only be made through code.

On installation this module will have two immediate effects:

Custom Node Template

Last modified: November 22, 2009 - 09:22

Purpose

The primary purpose of this module is to provide a simple way to customize the display of specific nodes. It is not intended to overlap functionality that can best be done directly through your theme or with another module. In particular, if you are trying to customize the display of ALL nodes of a particular content type, this is probably best done through your theme (or perhaps with another helper module like Contemplate).

If you have not arrived at this handbook page from the Custom Node Template module page, you may also wish to read the description of the project on the Custom Node Template project page.

Why Use This Module?

In general, this module would most likely be useful for overriding or customizing the display of node on a node-by-node basis or to provide such options to those who don't have access or the ability to customize a theme. It can still be useful for advanced users and developers as well when it is not convenient, feasible, or efficient to customize a theme to achieve the same functionality. For example, one could add some addition code for node template suggestions into the template.php file and add node-NodeID.tpl.php files to a theme. But this isn't not very efficient if you are overriding or customizing the display of a number of nodes in the same way. This module would allow you to add one customized node template into your theme and then select this template for the several nodes in question.

Please also see the Use Cases section at the bottom of this page for additional information to help you decide if this module would be useful.

Chat invites

Last modified: November 19, 2009 - 16:29

The "Manage this chat" fieldset contains an "Invite a user to this chat" widget. Use this to invite users to a chat.

An invited user will see a message on the next page they view, letting them know which chat they have been invited to by whom.

Modules can act on invites, so invites could lead to anything that can be coded in a Drupal module.

Private chats

Last modified: November 19, 2009 - 16:24

Chats can be made private, such that only users explicitly invited to a chat will be able to participate.

When a chat is created, check the "make chat private" checkbox.

Once the chat is loaded, use the "Add a user to this chat:" widget in the "Manage this chat" field set to add users.

You can also make the chat public from the "Manage this chat" area.

If the chat is not already public, there is a "Make chat public" button in the "Manage this chat" area.

Chatroom APIs

Last modified: November 19, 2009 - 15:15

hooks

The chatroom module exposes various hooks to allow other modules to integrate with it in a clean manner.

hook_chatroom_chat_invites_notify

<?php
/**
* Notify a user of pending chat invites.
*
* @param mixed $chat_user
* @param mixed $invites
* @return void
*/
function chatroom_chat_notify_user_of_invites($chat_user, $invites) {
  foreach (
module_implements('chatroom_chat_invites_notify') as $module) {
   
$function = $module . '_chatroom_chat_invites_notify';
   
$function($chat_user, $invites);
  }
 
$sql = "UPDATE {chatroom_chat_invite} SET notified = 1 WHERE cciid IN (" . db_placeholders(array_keys($invites)) . ')';
 
db_query($sql, array_keys($invites));
}
?>

hook_chatroom_chat_invite_accepted

<?php
/**
* Update an invite and set it to accepted.
*
* @param mixed $node
* @param mixed $chat_user
* @return void
*/
function chatroom_chat_accept_invite($node, $chat_user) {
 
$sql = "UPDATE {chatroom_chat_invite} SET accepted = 1 WHERE nid = %d AND invitee_uid = %d";
 
db_query($sql, $node->nid, $chat_user->uid);
  foreach (
module_implements('chatroom_chat_invite_accepted') as $module) {
   
$function = $module . '_chatroom_chat_invite_accepted';
   
$function($node, $chat_user);
  }
}
?>

hook_chatroom_chat_invite_created

Configuration

Last modified: November 19, 2009 - 14:43

Input format

Chat message will be filtered according to the input format you select for the chat node.

To integrate Smiley support, simply install the Smiley module and setup a filter with the smiley formatter in it.

Kick and ban messages

When users are kicked out or banned from chats, you can set the message displayed to them here.

Update frequency

How often the chat client polls the server for new messages. If you are worried about too many chats impacting server performance, set this to a bigger number than 1, which is the default.

Idle time

How many seconds between each message before a last message time is shown in the chat.

Maximum users

Set a non-zero value here if you wish to limit the number of users in a given chat.

Old messages

How many old messages to display when first entering a chat.

Syndicate content
 
 

Drupal is a registered trademark of Dries Buytaert.