Automatic installer.php lang files by installer_builder (20070726)
[moodle-linuxchix.git] / mod / lams / list.php
blob09cfd6702b6111c44276a221bab13dd07588efd2
1 <?php // $Id$
3 /// send LAMS learning deisgn list as a string seperated by ":" to client
5 require_once("../../config.php");
6 require_once("lib.php");
8 $result = lams_get_sequences($USER->username,$courseid);
9 if(is_string($result)){//some exception happened!
10 $auth_exception = "AuthenticateException";
11 $server_not_found_exception = "ServerNotFoundException";
12 if(strpos($result,$auth_exception)){//found AuthenticationException in the error message
13 header("HTTP/1.1 401 Unauthenticated");
14 die;
15 }else if (strpos($result,$server_not_found_exception)){
16 header("HTTP/1.1 417 Expectation Failed");
17 die;
18 }else if ($result=="NOT_SET_UP"){
19 header("HTTP/1.1 402 Setup Required");
20 die;
21 }else{
22 header("HTTP/1.1 502 Bad Gateway");
23 echo $result;
24 die;
27 $list_str = "";
28 foreach($result as $design){
29 $list_str .= $design['sid'].",".$design['workspace'].",".$design['title'].":";
31 if (strlen($list_str)==0){
32 header("HTTP/1.1 504 Gateway Timeout");
33 }else{
34 echo $list_str;