зеркало из https://github.com/mozilla/CSOL-site.git
All references to "nickname" changed to "username"
This commit is contained in:
Родитель
3a32cd47f9
Коммит
4ff9f84074
|
@ -144,7 +144,7 @@ function processInitialLearnerSignup (req, res, next) {
|
|||
}
|
||||
|
||||
if (!validateUsername(signup.username))
|
||||
return fail(new Error('This is not a valid nickname'));
|
||||
return fail(new Error('This is not a valid username'));
|
||||
|
||||
// Check for accidental February 30ths, etc
|
||||
var isValidDate = birthday.getFullYear() === signup.birthday_year
|
||||
|
@ -169,7 +169,7 @@ function processInitialLearnerSignup (req, res, next) {
|
|||
.error(function(err) {
|
||||
// Did try a `findOrCreate`, but couldn't get `isNewRecord` to work
|
||||
if (err.code === 'ER_DUP_ENTRY')
|
||||
return fail(new Error('This nickname is already in use'));
|
||||
return fail(new Error('This username is already in use'));
|
||||
|
||||
return fail(err);
|
||||
})
|
||||
|
@ -383,18 +383,18 @@ module.exports = function (app) {
|
|||
|
||||
function validateUser (user) {
|
||||
if (!user)
|
||||
return finalize(new Error('Nickname or password incorrect'));
|
||||
return finalize(new Error('Username or password incorrect'));
|
||||
|
||||
bcrypt.compare(password, user.password, function(err, match) {
|
||||
if (err || !match)
|
||||
return finalize(err || new Error('Nickname or password incorrect'));
|
||||
return finalize(err || new Error('Username or password incorrect'));
|
||||
|
||||
finalize(null, user);
|
||||
});
|
||||
}
|
||||
|
||||
if (!username || !password)
|
||||
return finalize(new Error('Missing nickname or password'));
|
||||
return finalize(new Error('Missing username or password'));
|
||||
|
||||
// Annoying redundancy here, but no other obvious way to generate OR queries
|
||||
learners.find({where: ["`email`=? OR `username`=?", normalizedUsername, normalizedUsername]})
|
||||
|
@ -600,7 +600,7 @@ module.exports = function (app) {
|
|||
return updateUserPassword(user);
|
||||
|
||||
if (!user.GuardianId)
|
||||
return finalize('Invalid nickname or email address');
|
||||
return finalize('Invalid username or email address');
|
||||
|
||||
// Make allowances for situations where guardians have entered their
|
||||
// own email address when resetting their child's password
|
||||
|
@ -608,7 +608,7 @@ module.exports = function (app) {
|
|||
user.getGuardian()
|
||||
.complete(function (err, guardian) {
|
||||
if (err || !guardian)
|
||||
return finalize('Invalid nickname or email address');
|
||||
return finalize('Invalid username or email address');
|
||||
|
||||
updateUserPassword(user);
|
||||
});
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<input type="hidden" name="_csrf" value="{{ csrfToken }}">
|
||||
<fieldset class="span6 offset3 well">
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="input-username">Email or Nickname</label>
|
||||
<label class="control-label" for="input-username">Email or Username</label>
|
||||
<div class="controls">
|
||||
<input type="text" id="input-username" name="username" value="{{ username }}" required="required">
|
||||
</div>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<input type="hidden" name="_csrf" value="{{ csrfToken }}">
|
||||
<fieldset class="span6 offset3 well">
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="input-username">Email or Nickname</label>
|
||||
<label class="control-label" for="input-username">Email or Username</label>
|
||||
<div class="controls">
|
||||
<input type="text" id="input-username" name="username" placeholder="e.g. user@example.com">
|
||||
<span class="help-block">We need this to confirm who you are.</span>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<input type="hidden" name="_csrf" value="{{ csrfToken }}">
|
||||
<fieldset class="span6 offset3 well">
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="input-username">Email or Nickname</label>
|
||||
<label class="control-label" for="input-username">Email or Username</label>
|
||||
<div class="controls">
|
||||
<input type="text" id="input-username" name="username" placeholder="e.g. user@example.com">
|
||||
</div>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<input type="hidden" name="_csrf" value="{{ csrfToken }}">
|
||||
<fieldset class="span6 offset3 well">
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="input-username">Nickname</label>
|
||||
<label class="control-label" for="input-username">Username</label>
|
||||
<div class="controls">
|
||||
<input type="text" id="input-username" name="username" value="{{ username }}" required="required" placeholder="e.g. {{ example }}">
|
||||
<span class="help-block"><strong>Please don't use your real name.</strong></span>
|
||||
|
@ -68,7 +68,7 @@
|
|||
|
||||
$button
|
||||
.addClass('btn')
|
||||
.attr({type: 'button', title: 'Create a nickname'})
|
||||
.attr({type: 'button', title: 'Create a username'})
|
||||
.append($refresh);
|
||||
|
||||
$button.click(function() {
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
</p>
|
||||
<ul>
|
||||
<li>Click on the log in/sign up button.</li>
|
||||
<li>Enter an email address or a unique nickname and a password.</li>
|
||||
<li>Enter an email address or a unique username and a password.</li>
|
||||
<li>Click Submit.</li>
|
||||
</ul>
|
||||
<p>If you are younger than 13 years old, you will need to enter your parent’s or guardian’s email address as well to confirm that it’s okay for you to be visiting this website.
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
<a href="/login" class="dropdown-toggle" role="button" data-toggle="dropdown" id="menu-login-form-toggle">Log In / Sign Up <i class="caret"></i></a>
|
||||
<form class="dropdown-menu" id="menu-login-form" aria-label="Log In" method="post" action="/login">
|
||||
<input type="hidden" name="_csrf" value="{{ csrfToken }}">
|
||||
<label for="menu-login-username">Email or Nickname:</label>
|
||||
<label for="menu-login-username">Email or Username:</label>
|
||||
<input type="text" id="menu-login-username" name="username" required="required">
|
||||
<label for="menu-login-password">Password:</label>
|
||||
<input type="password" id="menu-login-password" name="password" required="required">
|
||||
|
|
Загрузка…
Ссылка в новой задаче