#!/usr/bin/python

import sys
import gdbm
import posix
import string

from Config import *
import Utils
import Users

def getline():
	return string.strip(sys.stdin.readline())

print 'Please enter the new user name: ',
name = getline()
print 'Please enter the new user email address: ',
addr = getline()
print 'Please enter the new password: ',
pass1 = getline()
print 'Please enter the password again: ',
pass2 = getline()
print 'Should this user be SUPERUSER? (\'y\' for yes) ',
su = getline()
su = su[0] in ['y', 'Y']

if pass1 != pass2:
	print 'Passwords must match.'
	sys.exit(0)

user = Users.User(name, addr, pass1)
if su:
	user.set_superuser(1)
