backend/server/handlers/xmlrpc/registration.py | 8 ++++----
backend/server/rhnUser.py | 1 +
2 files changed, 5 insertions(+), 4 deletions(-)
New commits:
commit a43f0d390ee285734970d648d89bc3b92336c2d1
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Tue Jan 18 13:27:16 2011 +0100
670458 - check password policy only if we are really going to reserve user
diff --git a/backend/server/handlers/xmlrpc/registration.py
b/backend/server/handlers/xmlrpc/registration.py
index f95b847..e2df9d3 100644
--- a/backend/server/handlers/xmlrpc/registration.py
+++ b/backend/server/handlers/xmlrpc/registration.py
@@ -123,14 +123,14 @@ class Registration(rhnHandler):
"""
Get an username and a password and create a record for this user.
Eventually mark it as such.
+ Additionaly this method is used to verify login and password in early
+ stage of rhn_register.
Returns true value if user is reserved, otherwise fault is raised.
"""
-
log_debug(1, username)
- # validate the arguments
- username, password = rhnUser.check_user_password(username, password)
- # now try to reserve the user
+ # check user login/password and if not CFG.disallow_user_creation
+ # then reserver the user
ret = rhnUser.reserve_user(username, password)
log_debug(3, "rhnUser.reserve_user returned: " + str(ret))
if ret < 0:
diff --git a/backend/server/rhnUser.py b/backend/server/rhnUser.py
index 7a79e53..ee90e5a 100644
--- a/backend/server/rhnUser.py
+++ b/backend/server/rhnUser.py
@@ -472,6 +472,7 @@ def __reserve_user_db(user, password):
# user doesn't exist. now we fail, instead of reserving user.
if CFG.disallow_user_creation:
raise rhnFault(2001)
+ user, password = check_user_password(user, password)
# now check the reserved table
h = rhnSQL.prepare("""
Show replies by date