Forums now are working with AP as well

This commit is contained in:
Michael 2019-03-14 18:44:41 +00:00
parent 4b98200315
commit cd0d6cb626
4 changed files with 82 additions and 44 deletions

View file

@ -2226,8 +2226,35 @@ class Contact extends BaseObject
return $redirect;
}
/**
* Remove a contact from all groups
*
* @param integer $contact_id
*
* @return boolean Success
*/
public static function removeFromGroups($contact_id)
{
return DBA::delete('group_member', ['contact-id' => $contact_id]);
}
/**
* Is the contact a forum?
*
* @param integer $contactid ID of the contact
*
* @return boolean "true" if it is a forum
*/
public static function isForum($contactid)
{
$fields = ['forum', 'prv'];
$condition = ['id' => $contactid];
$contact = DBA::selectFirst('contact', $fields, $condition);
if (!DBA::isResult($contact)) {
return false;
}
// Is it a forum?
return ($contact['forum'] || $contact['prv']);
}
}