diff --git a/node/db/SecurityManager.js b/node/db/SecurityManager.js index fa7780dc3..c7d98a58b 100644 --- a/node/db/SecurityManager.js +++ b/node/db/SecurityManager.js @@ -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(); diff --git a/node/handler/PadMessageHandler.js b/node/handler/PadMessageHandler.js index 56e6de873..7aa1238e8 100644 --- a/node/handler/PadMessageHandler.js +++ b/node/handler/PadMessageHandler.js @@ -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 diff --git a/static/css/pad.css b/static/css/pad.css index 3d170c3dd..bdab50409 100644 --- a/static/css/pad.css +++ b/static/css/pad.css @@ -769,7 +769,7 @@ a#topbarmaximize { width: 100%; } -#embed, #readonly { +#embed, #readonly, #setpassword { display:none; position:absolute; top:40px; @@ -1146,4 +1146,4 @@ width:33px !important; #editbar ul li { padding: 4px 1px; } -} \ No newline at end of file +} diff --git a/static/index.html b/static/index.html index 1c35e3852..09b4b2164 100644 --- a/static/index.html +++ b/static/index.html @@ -69,7 +69,7 @@ font-weight: bold; font-size: 15px } - input[type="text"], input[type="password"] { + input[type="text"] { width: 243px; padding: 10px 47px 10px 10px; background: #fff; @@ -78,13 +78,7 @@ border-radius: 3px; text-shadow: 0 0 1px #fff } - #usepwlabel { - display: inline; - } - #usePasswordContainer { - margin: 10px 0 5px 0 - } - input[type="submit"] { + input[type="submit"] { width: 45px; margin-left: -50px; padding: 8px @@ -100,8 +94,6 @@