function _shoutbox_is_user_owned in Shoutbox 7
Same name and namespace in other branches
- 5 shoutbox.module \_shoutbox_is_user_owned()
- 6.2 shoutbox.module \_shoutbox_is_user_owned()
- 6 shoutbox.module \_shoutbox_is_user_owned()
- 7.2 shoutbox.module \_shoutbox_is_user_owned()
Determine if the current user owns the $shout.
Parameters
$shout: The shout object that we want to check.
Return value
True if the shout is owned by the current user.
2 calls to _shoutbox_is_user_owned()
- shoutbox_display_posts in ./
shoutbox.module - Output existing shoutbox posts as html.
- _shoutbox_user_access in ./
shoutbox.module - This function is necessary because even if a user has permission (according to the user_access function), they still should not have some permissions, such as moderating their own posts, etc.
File
- ./
shoutbox.module, line 990 - Shoutbox module displays a block for users to create short messages for the whole site. Uses AHAH to update the database and display content.
Code
function _shoutbox_is_user_owned($shout) {
global $user;
$user_owned = FALSE;
if ($shout->uid > 0 && $shout->uid == $user->uid) {
$user_owned = TRUE;
}
elseif ($shout->uid == 0 && $user->uid == 0) {
if ($shout->sid == session_id()) {
$user_owned = TRUE;
}
elseif (empty($shout->sid) && !empty($shout->hostname)) {
$user_owned = $shout->hostname == ip_address();
}
}
return $user_owned;
}