summaryrefslogtreecommitdiff
path: root/node/db
diff options
context:
space:
mode:
authorPeter 'Pita' Martischka <petermartischka@googlemail.com>2011-08-04 17:40:51 +0100
committerPeter 'Pita' Martischka <petermartischka@googlemail.com>2011-08-04 17:40:51 +0100
commit3e0f30bddef185db6617cd67283c45eccd071e8d (patch)
tree1c16145bb9f1bffcd05cf3da2f2745cc1718c5c7 /node/db
parent7b030710d22415a749cacc64574aa08227befbf6 (diff)
downloadetherpad-lite-3e0f30bddef185db6617cd67283c45eccd071e8d.zip
added getReadOnlyID
Diffstat (limited to 'node/db')
-rw-r--r--node/db/API.js19
1 files changed, 17 insertions, 2 deletions
diff --git a/node/db/API.js b/node/db/API.js
index 6bfc4f42..8d19dab3 100644
--- a/node/db/API.js
+++ b/node/db/API.js
@@ -20,6 +20,7 @@
var padManager = require("./PadManager");
var padMessageHandler = require("../handler/PadMessageHandler");
+var readOnlyManager = require("./ReadOnlyManager");
var async = require("async");
/**********************/
@@ -404,9 +405,23 @@ Example returns:
{code: 0, message:"ok", data: null}
{code: 1, message:"padID does not exist", data: null}
*/
-exports.getReadOnlyLink = function(padID, callback)
+exports.getReadOnlyID = function(padID, callback)
{
-
+ //we don't need the pad object, but this function does all the security stuff for us
+ getPadSafe(padID, function(err)
+ {
+ if(err)
+ {
+ callback(err);
+ return;
+ }
+
+ //get the readonlyId
+ readOnlyManager.getReadOnlyId(padID, function(err, readOnlyId)
+ {
+ callback(err, {readOnlyID: readOnlyId});
+ });
+ });
}
/**