- public static function getAccountType(array $contact)
- {
- // There are several fields that indicate that the contact or user is a forum
- // "page-flags" is a field in the user table,
- // "forum" and "prv" are used in the contact table. They stand for User::PAGE_FLAGS_COMMUNITY and User::PAGE_FLAGS_PRVGROUP.
- if ((isset($contact['page-flags']) && (intval($contact['page-flags']) == User::PAGE_FLAGS_COMMUNITY))
- || (isset($contact['page-flags']) && (intval($contact['page-flags']) == User::PAGE_FLAGS_PRVGROUP))
- || (isset($contact['forum']) && intval($contact['forum']))
- || (isset($contact['prv']) && intval($contact['prv']))
- || (isset($contact['community']) && intval($contact['community']))
- ) {
- $type = self::TYPE_COMMUNITY;
- } else {
- $type = self::TYPE_PERSON;
- }
-
- // The "contact-type" (contact table) and "account-type" (user table) are more general then the chaos from above.
- if (isset($contact["contact-type"])) {
- $type = $contact["contact-type"];
- }
-
- if (isset($contact["account-type"])) {
- $type = $contact["account-type"];
- }
-