diff options
author | Andrew Manning <tamanning@zoho.com> | 2016-05-21 21:55:09 -0400 |
---|---|---|
committer | Andrew Manning <tamanning@zoho.com> | 2016-05-21 21:55:09 -0400 |
commit | a36bef7979aecd72751d319f85b7037991979e35 (patch) | |
tree | 30b24ac811becd3e32cbeb260e11bea66ef4445d /include/wiki.php | |
parent | 049147a9d78b981482297c3daf48c67f31754259 (diff) | |
download | volse-hubzilla-a36bef7979aecd72751d319f85b7037991979e35.tar.gz volse-hubzilla-a36bef7979aecd72751d319f85b7037991979e35.tar.bz2 volse-hubzilla-a36bef7979aecd72751d319f85b7037991979e35.zip |
List of wikis populates with links according to observer permissions.
Diffstat (limited to 'include/wiki.php')
-rw-r--r-- | include/wiki.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/wiki.php b/include/wiki.php index 32caa98e8..7cd838f95 100644 --- a/include/wiki.php +++ b/include/wiki.php @@ -15,9 +15,17 @@ function wiki_delete() { } -function wiki_list($observer_hash) { +function wiki_list($nick, $observer_hash) { + if (local_channel() || remote_channel()) { + $sql_extra = item_permissions_sql(get_channel_by_nick($nick)['channel_id'], $observer_hash); + } else { + $sql_extra = " AND item_private = 0 "; + } + $wikis = q("SELECT * FROM item WHERE resource_type = '%s' AND mid = parent_mid AND item_deleted = 0 $sql_extra", + dbesc(WIKI_ITEM_RESOURCE_TYPE) + ); // TODO: query db for wikis the observer can access. Return with two lists, for read and write access - return array('write' => array('wiki1'), 'read' => array('wiki1', 'wiki2')); + return array('wikis' => $wikis); } function wiki_pages() { |