more bogus handling of pullbox API

This commit is contained in:
Tobias Hintze 2013-07-19 00:59:11 +02:00
parent c519cee99a
commit a629eda1b2
2 changed files with 7 additions and 1 deletions

View File

@ -51,10 +51,16 @@ function bogusSession($i) {
return $bs; return $bs;
} }
header('Content-Type: application/json');
if (preg_match('/^session-list/', $postBody) === 1) { // session-list if (preg_match('/^session-list/', $postBody) === 1) { // session-list
$bogusSessionList = array(); $bogusSessionList = array();
$bogusSessionList["session_list"] = array(bogusSession(0), bogusSession(1)); $bogusSessionList["session_list"] = array(bogusSession(0), bogusSession(1));
print json_encode($bogusSessionList, JSON_PRETTY_PRINT)."\n"; print json_encode($bogusSessionList, JSON_PRETTY_PRINT)."\n";
} else if (preg_match('/^join-session:/', $postBody) === 1) { // join
print "true";
} else if (preg_match('/^sync-ops:/', $postBody) === 1) { // sync
// completely bogus
print '{"result":"newOps","ops":[],"headSeq":-1}';
} else { } else {
print "unknown command"; // TODO send HTTP 400 response print "unknown command"; // TODO send HTTP 400 response
} }

View File

@ -70,7 +70,7 @@ var officeMain = {
collaborative: "owncloud", collaborative: "owncloud",
docUrl: doclocation, docUrl: doclocation,
loginProcedure: function(cb) { loginProcedure: function(cb) {
cb("0", "user", "token"); cb("0", OC.currentUser, "token");
}, },
callback: function() { callback: function() {
// initialized. // initialized.