aboutsummaryrefslogtreecommitdiffstats
path: root/include/widgets.php
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-11-17 20:44:57 -0800
committerredmatrix <redmatrix@redmatrix.me>2015-11-17 20:44:57 -0800
commit68da4d90dcbda1240ae014768a66a164fd5d2b36 (patch)
tree109692ad30537b2b48aa4b029b69c166e6a5ed2e /include/widgets.php
parenta089064588352b60bebf27c94a51d480f8062368 (diff)
downloadvolse-hubzilla-68da4d90dcbda1240ae014768a66a164fd5d2b36.tar.gz
volse-hubzilla-68da4d90dcbda1240ae014768a66a164fd5d2b36.tar.bz2
volse-hubzilla-68da4d90dcbda1240ae014768a66a164fd5d2b36.zip
fix admin plugin hooks
Diffstat (limited to 'include/widgets.php')
-rw-r--r--include/widgets.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/widgets.php b/include/widgets.php
index fc6fee2ef..2b1fb2859 100644
--- a/include/widgets.php
+++ b/include/widgets.php
@@ -1238,6 +1238,23 @@ function widget_album($args) {
if($args['title'])
$title = $args['title'];
+ /**
+ * This may return incorrect permissions if you have multiple directories of the same name.
+ * It is a limitation of the photo table using a name for a photo album instead of a folder hash
+ */
+
+ if($album) {
+ $x = q("select hash from attach where filename = '%s' and uid = %d limit 1",
+ dbesc($album),
+ intval($owner_uid)
+ );
+ if($x) {
+ $y = attach_can_view_folder($owner_uid,get_observer_hash(),$x[0]['hash']);
+ if(! $y)
+ return '';
+ }
+ }
+
$order = 'DESC';
$r = q("SELECT p.resource_id, p.id, p.filename, p.type, p.scale, p.description, p.created FROM photo p INNER JOIN