return false;
}
+/// @TODO $groups should be array
function permissions_sql($owner_id, $remote_verified = false, $groups = null)
{
$local_user = local_user();
*/
if ($local_user && $local_user == $owner_id) {
$sql = '';
+ /**
+ * Authenticated visitor. Unless pre-verified,
+ * check that the contact belongs to this $owner_id
+ * and load the groups the visitor belongs to.
+ * If pre-verified, the caller is expected to have already
+ * done this and passed the groups into this function.
+ */
} elseif ($remote_user) {
/*
* Authenticated visitor. Unless pre-verified,
if ($remote_verified) {
$gs = '<<>>'; // should be impossible to match
- if (is_array($groups) && count($groups)) {
- foreach ($groups as $g)
+ if (is_array($groups)) {
+ foreach ($groups as $g) {
$gs .= '|<' . intval($g) . '>';
+ }
}
$sql = sprintf(