fix webpage perms
This commit is contained in:
parent
b4dff3a9ff
commit
9e490d022b
@ -1637,7 +1637,7 @@ function profile_tabs($a, $is_owner = false, $nickname = null){
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($is_owner && feature_enabled($uid,'webpages')) {
|
if ($p['write_pages'] && feature_enabled($uid,'webpages')) {
|
||||||
$tabs[] = array(
|
$tabs[] = array(
|
||||||
'label' => t('Webpages'),
|
'label' => t('Webpages'),
|
||||||
'url' => $a->get_baseurl() . '/webpages/' . $nickname,
|
'url' => $a->get_baseurl() . '/webpages/' . $nickname,
|
||||||
|
@ -90,11 +90,18 @@ function editwebpage_content(&$a) {
|
|||||||
// We've already figured out which item we want and whose copy we need,
|
// We've already figured out which item we want and whose copy we need,
|
||||||
// so we don't need anything fancy here
|
// so we don't need anything fancy here
|
||||||
|
|
||||||
$itm = q("SELECT * FROM `item` WHERE `id` = %d and uid = %s LIMIT 1",
|
$sql_extra = item_permissions_sql($owner);
|
||||||
|
|
||||||
|
$itm = q("SELECT * FROM `item` WHERE `id` = %d and uid = %s $sql_extra LIMIT 1",
|
||||||
intval($post_id),
|
intval($post_id),
|
||||||
intval($owner)
|
intval($owner)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if(! $itm) {
|
||||||
|
notice( t('Permission denied.') . EOL);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if($itm[0]['item_flags'] & ITEM_OBSCURED) {
|
if($itm[0]['item_flags'] & ITEM_OBSCURED) {
|
||||||
$key = get_config('system','prvkey');
|
$key = get_config('system','prvkey');
|
||||||
if($itm[0]['title'])
|
if($itm[0]['title'])
|
||||||
|
@ -131,8 +131,10 @@ function webpages_content(&$a) {
|
|||||||
// so just list titles and an edit link.
|
// so just list titles and an edit link.
|
||||||
/** @TODO - this should be replaced with pagelist_widget */
|
/** @TODO - this should be replaced with pagelist_widget */
|
||||||
|
|
||||||
|
$sql_extra = item_permissions_sql($owner);
|
||||||
|
|
||||||
$r = q("select * from item_id left join item on item_id.iid = item.id
|
$r = q("select * from item_id left join item on item_id.iid = item.id
|
||||||
where item_id.uid = %d and service = 'WEBPAGE' order by item.created desc",
|
where item_id.uid = %d and service = 'WEBPAGE' $sql_extra order by item.created desc",
|
||||||
intval($owner)
|
intval($owner)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user