How to limit personal contact form to buddies only

bobdalob - July 8, 2008 - 11:56
Project:Buddylist
Version:5.x-1.1-beta
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

Objective: only approved buddies may send messages via a user's personal contact form.
Note: buddies require approval.

I think to start with a borrowed function like:

function _buddylistext_is_buddy($uid, $bid) {
  $isbuddy = db_result(db_query("SELECT * FROM {buddylist} WHERE uid = %d AND buddy = %d",$uid, $bid));
  return $isbuddy;
}

to generate an $isbuddy value and something like
    if (!$isbuddy) {
  $output = t('The user %name is not a buddy. You may only contact people in your buddylist.', array('%name' => $account->name));
    }

in "function contact_user_page()" but I don't know how to proceed without hacking the contact module which I think is best left untouched.

How to approach?

#1

bobdalob - July 8, 2008 - 12:05

Sorry - that's borrowed from here

 
 

Drupal is a registered trademark of Dries Buytaert.