#!/usr/bin/python
# Copyright (C) 2008-2009 NAV CANADA (http://www.navcanada.ca)
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# Author: Mike Stoddart <stoddam@navcanada.ca>
# Author: Jeff Dever <deverj@navcanada.ca>

import sys
from common import *
from config import *

# Prompt for the username and password.
username = prompt_username()
if user_exists(username):
	print "User %s already exists, exiting"%username
	sys.exit(-1)

password = prompt_password(confirm=True)

# Ask for confirmation.
if not prompt_confirmation("Are you sure you want to add user %s?" % username):
	print "Doing nothing"
	sys.exit(0)

# Do the add.
if not add_user(username, password):
	print "Failed to add user, exiting"
	sys.exit(-2)

#success
sys.exit(0)


f5fa6247982d55318905159134eec652d61bdd5e
#!/usr/bin/python
# Copyright (C) 2008-2009 NAV CANADA (http://www.navcanada.ca)
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# Author: Mike Stoddart <stoddam@navcanada.ca>
# Author: Jeff Dever <deverj@navcanada.ca>

import sys
from common import *
from config import *

# Prompt for the username and password.
username = prompt_username()
if user_exists(username):
	print "User %s already exists, exiting"%username
	sys.exit(-1)

password = prompt_password(confirm=True)

# Ask for confirmation.
if not prompt_confirmation("Are you sure you want to add user %s?" % username):
	print "Doing nothing"
	sys.exit(0)

# Do the add.
if not add_user(username, password):
	print "Failed to add user, exiting"
	sys.exit(-2)

#success
sys.exit(0)

