Skip to content

Commit

Permalink
login: Use email_address for login instead of user_name
Browse files Browse the repository at this point in the history
  • Loading branch information
Turbo87 committed Jul 9, 2012
1 parent 732a700 commit ebfba06
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions skylines/config/app_cfg.py
Expand Up @@ -55,6 +55,7 @@
# override this if you would like to provide a different who plugin for
# managing login and logout of your application
base_config.sa_auth.form_plugin = None
base_config.sa_auth.translations.user_name = 'email_address'

# override this if you are using a different charset for the login form
base_config.sa_auth.charset = 'utf-8'
Expand Down
2 changes: 1 addition & 1 deletion skylines/controllers/root.py
Expand Up @@ -95,7 +95,7 @@ def post_login(self, came_from = None):
came_from = lurl('/')

if not request.identity:
flash(_('Sorry, username or password are wrong. Please try again or register.'), 'warning')
flash(_('Sorry, email address or password are wrong. Please try again or register.'), 'warning')
else:
request.identity['user'].login_ip = request.remote_addr
request.identity['user'].login_time = datetime.now()
Expand Down
4 changes: 2 additions & 2 deletions skylines/templates/login.html
Expand Up @@ -20,9 +20,9 @@
<div class="well span8 offset2" id="loginform">
<form action="${tg.url('/login_handler', params=dict(came_from=came_from.encode('utf-8')))}" method="post" accept-charset="UTF-8" class="loginfields">
<div class="control-group">
<label class="control-label" for="loginusername">Username:</label>
<label class="control-label" for="loginusername">Email Address:</label>
<div class="controls">
<input type="text" id="loginusername" name="login" />
<input type="text" id="loginusername" name="login" title="Attention! This was changed from username to email address." rel="tooltip"/>
</div>
</div>
<div class="control-group">
Expand Down
4 changes: 2 additions & 2 deletions skylines/templates/master/topbar.html
Expand Up @@ -32,9 +32,9 @@
<div class="dropdown-menu">
<form action="${tg.url('/login_handler', params=dict(came_from=request.url.encode('utf-8')))}" method="post" accept-charset="UTF-8">
<div class="control-group">
<label class="control-label" for="username">Username:</label>
<label class="control-label" for="username">Email Address:</label>
<div class="controls">
<input type="text" id="username" name="login" />
<input type="text" id="username" name="login" title="Attention! This was changed from username to email address." rel="tooltip"/>
</div>
</div>
<div class="control-group">
Expand Down

0 comments on commit ebfba06

Please sign in to comment.