I just used the following because I don't want their login to succeed if
they enter no character IE: 0000012 the real username without the character
should also fail.
if request.args(0) == 'login' and request.post_vars.username:
login_char = request.post_vars.username[-1]
if login_char == 'R':
request.post_vars.username = request.vars.username =
request.post_vars.username[:-1] # remove last character
else:
request.post_vars.username = request.vars.username =
request.post_vars.username + 'X'
On Thu, Mar 29, 2012 at 12:34 PM, Anthony <[email protected]> wrote:
> def user():
>> .. #TODO validate submitted username
>> .. if request.args(0) == 'login' and request.post_vars.username:
>> .. .. request.post_vars.username = request.vars.username =
>> request.post_vars.username[:-**1] # remove last character
>> .. return dict(form=auth())
>>
>
> That doesn't check whether the last character is correct, so 0000012R
> would succeed, but so would 0000012X or any character at the end of the
> username.
>
> Anthony
>
--
--
Regards,
Bruce Wade
http://ca.linkedin.com/in/brucelwade
http://www.wadecybertech.com
http://www.warplydesigned.com
http://www.fitnessfriendsfinder.com