               return callback new KodingError 'You have to agree to the TOS'
             else if not username? or not email?
               return callback new KodingError 'Username and email are required fields'
-            
+
             @verifyKodingenPassword {username, password, kodingenUser}, (err)->
               if err
                 return callback new KodingError 'Wrong password'

  @hashUnhashedPasswords =->
    @all {salt: $exists: no}, (err, users)->
      users.forEach (user)-> user.changePassword user.getAt('password')
  
  hashPassword =(value, salt)->
    require('crypto').createHash('sha1').update(salt+value).digest('hex')
    
  createSalt = require 'hat'
  
  @share()
  
  @::mixin Flaggable::
  
  @getFlagRole =-> 'owner'
  
  @set
    indexes         :
      username      : 'unique'

  #       callback new KodingError 'No visitor instance was found.'
  #     else
  #       constructor.one {username}, callback

  createNewMemberActivity =(account, callback=->)->
    bucket = new CNewMemberBucket
      anchor      : account
