diff options
Diffstat (limited to 'inc')
-rw-r--r-- | inc/media.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/inc/media.php b/inc/media.php index db1ca0d57..501d170f3 100644 --- a/inc/media.php +++ b/inc/media.php @@ -83,6 +83,20 @@ function media_metasave($id,$auth,$data){ } /** + * Check if a media item is public (eg, external URL or readable by @ALL) + * + * @author Andreas Gohr <andi@splitbrain.org> + * @param string $id the media ID or URL + * @return bool + */ +function media_ispublic($id){ + if(preg_match('/^https?:\/\//i',$id)) return true; + $id = cleanID($id); + if(auth_aclcheck(getNS($id).':*', '', array()) >= AUTH_READ) return true; + return false; +} + +/** * Display the form to edit image meta data * * @author Andreas Gohr <andi@splitbrain.org> |