Commit e0dc711c authored by mcramer's avatar mcramer
Browse files

- Changed previous commit to check for read permissions only on download action

parent 24936c29
...@@ -58,7 +58,10 @@ class plugin_backuplist extends plugin_base { ...@@ -58,7 +58,10 @@ class plugin_backuplist extends plugin_base {
//* check if the user is owner of the parent domain //* check if the user is owner of the parent domain
$domain_backup = $app->db->queryOneRecord("SELECT parent_domain_id FROM web_backup WHERE backup_id = ".$backup_id); $domain_backup = $app->db->queryOneRecord("SELECT parent_domain_id FROM web_backup WHERE backup_id = ".$backup_id);
$get_domain = $app->db->queryOneRecord("SELECT domain_id FROM web_domain WHERE domain_id = ".$app->functions->intval($domain_backup["parent_domain_id"])." AND ".$this->getAuthSQL('u')); $check_perm = 'u';
if($_GET['backup_action'] == 'download') $check_perm = 'r'; // only check read permissions on download, not update permissions
$get_domain = $app->db->queryOneRecord("SELECT domain_id FROM web_domain WHERE domain_id = ".$app->functions->intval($domain_backup["parent_domain_id"])." AND ".$this->getAuthSQL($check_perm));
if(empty($get_domain) || !$get_domain) { if(empty($get_domain) || !$get_domain) {
$app->error($app->tform->lng('no_domain_perm')); $app->error($app->tform->lng('no_domain_perm'));
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment