From 8470d68ddc04939093f796fcf53f26a2329a6e84 Mon Sep 17 00:00:00 2001 From: Max Pozdeev Date: Wed, 10 Nov 2010 21:33:01 +0300 Subject: [PATCH] + readonly user can export the tasks from published list --- src/export.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/export.php b/src/export.php index 0d41ece..ed1d07e 100644 --- a/src/export.php +++ b/src/export.php @@ -9,14 +9,13 @@ //$dontStartSession = 1; require_once('./init.php'); -if(!have_write_access()) { - die("Access denied"); -} +$onlyPublishedList = false; +if(!have_write_access()) $onlyPublishedList = true; $listId = (int)_get('list'); -$listData = $db->sqa("SELECT * FROM {$db->prefix}lists WHERE id=$listId"); +$listData = $db->sqa("SELECT * FROM {$db->prefix}lists WHERE id=$listId ". ($onlyPublishedList ? "AND published=1" : "") ); if(!$listData) { - die("No such list"); + die("No such list or access denied"); } $sqlSort = "ORDER BY compl ASC, ";