added getReadOnlyID

pull/85/merge
Peter 'Pita' Martischka 2011-08-04 17:40:51 +01:00
parent 7b030710d2
commit 3e0f30bdde
2 changed files with 18 additions and 3 deletions

View File

@ -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});
});
});
}
/**

View File

@ -53,7 +53,7 @@ var functions = {
"setText" : ["padID", "text"],
"getRevisionsCount" : ["padID"],
// "deletePad" : ["padID"],
// "getReadOnlyLink" : ["padID"],
"getReadOnlyID" : ["padID"],
// "setPublicStatus" : ["padID", "publicStatus"],
// "getPublicStatus" : ["padID"],
// "setPassword" : ["padID", "password"],