From f4b58a16e1b45dbf35ecb72483097c57b293c3c2 Mon Sep 17 00:00:00 2001 From: Michaela Murauer Date: Thu, 29 Sep 2016 14:40:58 +0200 Subject: [PATCH] elove: update - add removed code --- portfoliofile.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/portfoliofile.php b/portfoliofile.php index 182764e..f9ea400 100644 --- a/portfoliofile.php +++ b/portfoliofile.php @@ -52,6 +52,27 @@ $epopaccess=false; //authenticate the user +if ($token) { + // keep code for eLove - needed for teacher access to submitted files + + $webservicelib = new webservice(); + $authenticationinfo = $webservicelib->authenticate_user($token); + $accessPath = explode('/', $access); + + if(strpos($accessPath[2],'-')) + $accessPath[2] = (explode('-', $accessPath[2])[0]); + + $item = block_exaport_get_elove_item($itemid, $accessPath[2], $authenticationinfo); + if(!$item) + print_error("viewnotfound", "block_exaport"); + + if ($file = block_exaport_get_item_file($item)) { + send_stored_file($file); + } else { + not_found(); + } + exit; +} $authenticationinfo = null; if ($wstoken) {