aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-01-25 23:32:44 -0800
committerfriendica <info@friendica.com>2013-01-25 23:32:44 -0800
commit70aa8421b37a6ad7318172ef515bbb56e2d33917 (patch)
treea3f6301666c5ab22be7fdb2c204993d734b58405 /include
parent93af1932181a900c7b59d99799b28bd24e2c32d8 (diff)
downloadvolse-hubzilla-70aa8421b37a6ad7318172ef515bbb56e2d33917.tar.gz
volse-hubzilla-70aa8421b37a6ad7318172ef515bbb56e2d33917.tar.bz2
volse-hubzilla-70aa8421b37a6ad7318172ef515bbb56e2d33917.zip
further baby steps on the photos API
Diffstat (limited to 'include')
-rw-r--r--include/photos.php26
-rw-r--r--include/security.php2
2 files changed, 27 insertions, 1 deletions
diff --git a/include/photos.php b/include/photos.php
index 84352ed32..7ccfd31c6 100644
--- a/include/photos.php
+++ b/include/photos.php
@@ -223,4 +223,28 @@ function photo_upload($channel, $observer, $args) {
call_hooks('photo_post_end',$ret);
return $ret;
-} \ No newline at end of file
+}
+
+
+
+
+function photos_albums_list($channel,$observer) {
+
+ $channel_id = $channel['channel_id'];
+ $observer_xchan = (($observer) ? $observer['xchan_hash'] : '');
+
+ if(! perm_is_allowed($channel_id,$observer_xchan,'view_photos'))
+ return false;
+
+ // FIXME - create a permissions SQL which works on arbitrary observers and channels, regardless of login or web status
+
+ $sql_extra = permissions_sql($channel_id);
+
+ $albums = q("SELECT distinct album from photo where uid = %d $sql_extra order by created desc",
+ intval($channel_id)
+ );
+
+ return $albums;
+
+}
+
diff --git a/include/security.php b/include/security.php
index f28174153..9f4058f88 100644
--- a/include/security.php
+++ b/include/security.php
@@ -166,6 +166,8 @@ function change_channel($change_channel) {
}
+
+
function permissions_sql($owner_id,$remote_verified = false,$groups = null) {
$local_user = local_user();