Ejemplo n.º 1
0
def is_valid_user(uname, pwd):
	pwd = md5.md5(pwd)
	sql = 'select * from user where uname = "%s" and pwd = "%s"' % (uname, pwd)
	return database.is_exist(sql)
Ejemplo n.º 2
0
def insert(uname, email, rname, pwd, permission = 0):
	#对密码进行md5的加密
	pwd = md5.md5(pwd)
	sql = "insert into user values('%s', '%s', '%s', '%s', '%d')" % (uname, email, rname, pwd, permission)
	return database.query(sql)