From: dongsheng Date: Tue, 9 Sep 2008 03:25:03 +0000 (+0000) Subject: MDL-13766 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=cf493e8923065697a42722623ef6facf2573d6b9;p=moodle.git MDL-13766 popup authentication support (draft) --- diff --git a/repository/lib.php b/repository/lib.php index 53940bb0d5..6c0b98a6e9 100644 --- a/repository/lib.php +++ b/repository/lib.php @@ -1244,6 +1244,10 @@ EOD; +EOD; + break; +case 'list': +case 'search': try { if(!empty($p)) { echo json_encode($repo->get_listing($p)); @@ -103,8 +129,8 @@ if ($action == 'list' || $action == 'search') { $err->e = $e->getMessage(); die(json_encode($err)); } - -} elseif($action == 'download') { + break; +case 'download': $path = $repo->get_file($file, $title); $itemid = (int)substr(hexdec(uniqid()), 0, 9)+rand(1,100); try { @@ -124,15 +150,8 @@ if ($action == 'list' || $action == 'search') { $err->e = $e->getMessage(); die(json_encode($err)); } -} elseif ($action == 'login') { - try { - echo json_encode($repo->print_login()); - } catch (repository_exception $e){ - $err = new stdclass; - $err->e = $e->getMessage(); - die(json_encode($err)); - } -} elseif ($action == 'upload') { + break; +case 'upload': try { echo json_encode($repo->get_listing()); } catch (repository_exception $e){ @@ -140,4 +159,5 @@ if ($action == 'list' || $action == 'search') { $err->e = $e->getMessage(); die(json_encode($err)); } + break; }