Beispiel #1
0
def taskPass():
  sys.path.insert(0, os.path.join(settings.WENDER_PATH, 'server'))
  from wender.utils.crypt import genPassword, encodePassword
  # if password provided
  if len(sys.argv) == 3:
    rawpass = sys.argv[2]
  else:
    rawpass = genPassword()
  encpass = encodePassword(rawpass)
  print 'pass: %s' % rawpass
  print 'encoded: %s' % encpass
Beispiel #2
0
def createUser(db, login, password):
  user = { 'login': login, 'password': crypt.encodePassword(password) }
  userId = db.user.insert(user)
  user['_id'] = str(userId)
  return user