Change config to camel case with backwards compatibility
This refactors the configs a bit to now use camel case everywhere. This change should help to clean up the config interface and make it better understandable. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
This commit is contained in:
@@ -45,10 +45,10 @@ function secure (socket, next) {
|
||||
var handshakeData = socket.request
|
||||
if (handshakeData.headers.cookie) {
|
||||
handshakeData.cookie = cookie.parse(handshakeData.headers.cookie)
|
||||
handshakeData.sessionID = cookieParser.signedCookie(handshakeData.cookie[config.sessionname], config.sessionsecret)
|
||||
handshakeData.sessionID = cookieParser.signedCookie(handshakeData.cookie[config.sessionName], config.sessionSecret)
|
||||
if (handshakeData.sessionID &&
|
||||
handshakeData.cookie[config.sessionname] &&
|
||||
handshakeData.cookie[config.sessionname] !== handshakeData.sessionID) {
|
||||
handshakeData.cookie[config.sessionName] &&
|
||||
handshakeData.cookie[config.sessionName] !== handshakeData.sessionID) {
|
||||
if (config.debug) { logger.info('AUTH success cookie: ' + handshakeData.sessionID) }
|
||||
return next()
|
||||
} else {
|
||||
@@ -284,7 +284,7 @@ function extractNoteIdFromSocket (socket) {
|
||||
return false
|
||||
}
|
||||
var hostUrl = url.parse(referer)
|
||||
var noteId = config.urlpath ? hostUrl.pathname.slice(config.urlpath.length + 1, hostUrl.pathname.length).split('/')[1] : hostUrl.pathname.split('/')[1]
|
||||
var noteId = config.urlPath ? hostUrl.pathname.slice(config.urlPath.length + 1, hostUrl.pathname.length).split('/')[1] : hostUrl.pathname.split('/')[1]
|
||||
return noteId
|
||||
} else {
|
||||
return false
|
||||
@@ -330,7 +330,7 @@ function emitRefresh (socket) {
|
||||
var note = notes[noteId]
|
||||
var out = {
|
||||
title: note.title,
|
||||
docmaxlength: config.documentmaxlength,
|
||||
docmaxlength: config.documentMaxLength,
|
||||
owner: note.owner,
|
||||
ownerprofile: note.ownerprofile,
|
||||
lastchangeuser: note.lastchangeuser,
|
||||
@@ -788,7 +788,7 @@ function connection (socket) {
|
||||
var note = notes[noteId]
|
||||
// Only owner can change permission
|
||||
if (note.owner && note.owner === socket.request.user.id) {
|
||||
if (permission === 'freely' && !config.allowanonymous && !config.allowanonymousedits) return
|
||||
if (permission === 'freely' && !config.allowAnonymous && !config.allowAnonymousedits) return
|
||||
note.permission = permission
|
||||
models.Note.update({
|
||||
permission: permission
|
||||
|
||||
Reference in New Issue
Block a user