diff options
author | Mario Vavti <mario@mariovavti.com> | 2015-04-21 22:45:54 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2015-04-21 22:45:54 +0200 |
commit | 21704ecb93e293f39d0228ae0d9765f37af8d99e (patch) | |
tree | ba934e990f9c26a15ddbe1b9aa0a298323cb1ffc /mod/lockview.php | |
parent | 0bd9fe0b11013423a17ebaabb22482bee38d8f0f (diff) | |
download | volse-hubzilla-21704ecb93e293f39d0228ae0d9765f37af8d99e.tar.gz volse-hubzilla-21704ecb93e293f39d0228ae0d9765f37af8d99e.tar.bz2 volse-hubzilla-21704ecb93e293f39d0228ae0d9765f37af8d99e.zip |
bring lockview to menu items, slightly change the way /lockview is called
Diffstat (limited to 'mod/lockview.php')
-rw-r--r-- | mod/lockview.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/mod/lockview.php b/mod/lockview.php index a46fb6d69..84c16f658 100644 --- a/mod/lockview.php +++ b/mod/lockview.php @@ -14,10 +14,13 @@ function lockview_content(&$a) { if(! $item_id) killme(); - if (!in_array($type, array('item','photo','event'))) + if (!in_array($type, array('item','photo','event', 'menu_item'))) killme(); - $r = q("SELECT * FROM %s WHERE id = %d LIMIT 1", + //we have different naming in in menu_item table + $id = (($type == 'menu_item') ? 'mitem_id' : 'id'); + + $r = q("SELECT * FROM %s WHERE $id = %d LIMIT 1", dbesc($type), intval($item_id) ); @@ -27,7 +30,10 @@ function lockview_content(&$a) { $item = $r[0]; - if($item['uid'] != local_channel()) { + //we have different naming in in menu_item table + $uid = (($type == 'menu_item') ? $item['mitem_channel_id'] : $item['uid']); + + if($uid != local_channel()) { echo '<li>' . t('Remote privacy information not available.') . '</li>'; killme(); } |