From 292c68a0a5be997c59954fa689a62c58be7286d6 Mon Sep 17 00:00:00 2001 From: Peter 'Pita' Martischka Date: Wed, 10 Aug 2011 14:24:21 +0100 Subject: [PATCH] harmonize different ID types, improved the prefixes --- node/db/AuthorManager.js | 17 ++++++----- node/db/GroupManager.js | 60 +++++++++++++------------------------- node/db/ReadOnlyManager.js | 14 +++++---- node/db/SessionManager.js | 12 ++++---- node/handler/APIHandler.js | 15 ++++++---- 5 files changed, 54 insertions(+), 64 deletions(-) diff --git a/node/db/AuthorManager.js b/node/db/AuthorManager.js index f93ebb68..8fa98189 100644 --- a/node/db/AuthorManager.js +++ b/node/db/AuthorManager.js @@ -129,7 +129,7 @@ function mapAuthorWithDBKey (mapperkey, mapper, callback) exports.createAuthor = function(name, callback) { //create the new author name - var author = "g." + _randomString(16); + var author = "a." + randomString(16); //create the globalAuthors db entry var authorObj = {"colorId" : Math.floor(Math.random()*32), "name": name, "timestamp": new Date().getTime()}; @@ -193,11 +193,14 @@ exports.setAuthorName = function (author, name, callback) /** * Generates a random String with the given length. Is needed to generate the Author Ids */ -function _randomString(len) { - // use only numbers and lowercase letters - var pieces = []; - for(var i=0;i