Now working. The password can be set from within the pad editor.

Currently there are only two remaining issues:
 1 After the password is set, re-authentication is needed
 2 The toolbar button does not yet have a nice icon
This commit is contained in:
jaseg 2011-12-08 22:45:54 +01:00
parent c905fd76c1
commit a161b59601
8 changed files with 56 additions and 49 deletions

View file

@ -217,7 +217,6 @@ exports.checkAccess = function (padID, sessionID, token, password, callback)
else if(!isPublic)
{
//--> deny access
console.log("not public");
statusObject = {accessStatus: "deny"};
}
else
@ -228,9 +227,8 @@ exports.checkAccess = function (padID, sessionID, token, password, callback)
// there is no valid session avaiable AND pad doesn't exists
else
{
//--> deny access
console.log("imaginary pad");
statusObject = {accessStatus: "deny"};
//grant access so he pad can be generated
statusObject = {accessStatus: "grant", authorID: tokenAuthor};
}
callback();

View file

@ -190,6 +190,12 @@ exports.handleMessage = function(client, message)
{
handleSuggestUserName(client, message);
}
else if(message.type == "COLLABROOM" &&
message.data.type == "CLIENT_MESSAGE" &&
message.data.payload.type == "setPassword")
{
handleSetPadPassword(client, message);
}
//if the message type is unkown, throw an exception
else
{
@ -294,6 +300,13 @@ function handleSuggestUserName(client, message)
}
}
function handleSetPadPassword(client, message){
var padId = session2pad[client.id];
padManager.getPad(padId, function(err, value){
value.setPassword(message.data.payload.password);
});
}
/**
* Handles a USERINFO_UPDATE, that means that a user have changed his color or name. Anyway, we get both informations
* @param client the client that send this message