Merge commit 'upstream/master'

This commit is contained in:
aritas1 2012-02-14 21:42:15 +04:00
commit 206c2273bd
39 changed files with 223 additions and 6477 deletions

View file

@ -2,9 +2,11 @@
* The pad object, defined with joose
*/
var CommonCode = require('../utils/common_code');
var ERR = require("async-stacktrace");
var Changeset = require("../utils/Changeset");
var AttributePoolFactory = require("../utils/AttributePoolFactory");
var Changeset = CommonCode.require("/Changeset");
var AttributePoolFactory = CommonCode.require("/AttributePoolFactory");
var randomString = CommonCode.require('/pad_utils').randomString;
var db = require("./DB").db;
var async = require("async");
var settings = require('../utils/Settings');
@ -505,15 +507,7 @@ function hash(password, salt)
function generateSalt()
{
var len = 86;
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz./";
var randomstring = '';
for (var i = 0; i < len; i++)
{
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substring(rnum, rnum + 1);
}
return randomstring;
return randomstring(86);
}
function compare(hashStr, password)