Built motion from commit c2984ba.|0.0.114
[motion.git] / server / models / user.js
index 91ccfe1..14aae44 100644 (file)
@@ -16,6 +16,7 @@ module.exports = function(sequelize, DataTypes) {
         is: /^[A-Za-z0-9\.\_]+$/i
       },
       set: function(name) {
+        name = name.toLowerCase();
         this.setDataValue('name', name);
         this.setDataValue('defaultuser', name);
       }
@@ -48,8 +49,7 @@ module.exports = function(sequelize, DataTypes) {
       set: function(password) {
         this.salt = this.makeSalt();
         this.setDataValue('password', this.encryptPassword(password));
-        this.setDataValue('md5secret', this.md5Password(this.name +
-          ':asterisk:' + password));
+        this.setDataValue('md5secret', this.md5Password(this.name + ':asterisk:' + password));
       }
     },
     provider: {
@@ -224,7 +224,7 @@ module.exports = function(sequelize, DataTypes) {
     },
     phoneBarExpires: {
       type: DataTypes.INTEGER(5),
-      defaultValue: 3600
+      defaultValue: 120
     },
     phoneBarNameServer: {
       type: DataTypes.STRING,