X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fsecurity.php;h=684a88a516e0e95ee9dde80225609867b11eb258;hb=e6b538c0466fb73bc3bf781266f85f45f8b39ea3;hp=cb10770490be82e8c86637e4765435a0b75a8426;hpb=0f47ac282c30c61dbc13e42c4f53b2fc14d65593;p=friendica.git diff --git a/include/security.php b/include/security.php index cb10770490..684a88a516 100644 --- a/include/security.php +++ b/include/security.php @@ -1,23 +1,117 @@ >'; // should be impossible to match + + if(is_array($groups) && count($groups)) { + foreach($groups as $g) + $gs .= '|<' . intval($g) . '>'; + } + + $sql = sprintf( + " AND ( allow_cid = '' OR allow_cid REGEXP '<%d>' ) + AND ( deny_cid = '' OR NOT deny_cid REGEXP '<%d>' ) + AND ( allow_gid = '' OR allow_gid REGEXP '%s' ) + AND ( deny_gid = '' OR NOT deny_gid REGEXP '%s') + ", + intval($remote_user), + intval($remote_user), + dbesc($gs), + dbesc($gs) + ); + } + } + return $sql; +} \ No newline at end of file