X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fsecurity.php;h=684a88a516e0e95ee9dde80225609867b11eb258;hb=53590d216691a572ede5e30dbc631a6cd0669c41;hp=a71391dbaca30cc20cc44657d40b5199afeaa4ab;hpb=6695b4a203ab03941c8b3305a3e55cc02b85a5ac;p=friendica.git diff --git a/include/security.php b/include/security.php index a71391dbac..684a88a516 100644 --- a/include/security.php +++ b/include/security.php @@ -1,17 +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