function shoutbox_access_callback in Shoutbox 5
Function to handle shoutbox access callbacks that require a shout_id. Does some sanity checking on on the id and loads the shout before calling _shoutbox_user_access.
Parameters
shout_id: The shout id the action is being performed on.
permission: The permission that we want to check
Return value
Returns 1 if user should have accces, 0 otherwise.
1 call to shoutbox_access_callback()
- shoutbox_menu in ./
shoutbox.module - Implementation of hook_menu().
File
- ./
shoutbox.module, line 268 - shoutbox module displays a block for users to create short messages for thw whole site. Uses AHAH to update the database and display content.
Code
function shoutbox_access_callback($permission, $shout_id) {
$access = FALSE;
if (is_numeric($shout_id)) {
$shout = db_fetch_object(db_query('SELECT * FROM {shoutbox} WHERE shout_id = %d', $shout_id));
$access = _shoutbox_user_access($permission, $shout);
}
return $access;
}