mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-06 04:21:17 +01:00
closes #651
This commit is contained in:
@@ -41,6 +41,17 @@ define(['forum/accountheader', 'uploader'], function(header, uploader) {
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
function getSignatureCharsLeft() {
|
||||
return '(' + $('#inputSignature').val().length + '/' + config.maximumSignatureLength + ')';
|
||||
}
|
||||
|
||||
$('#signatureCharCountLeft').html(getSignatureCharsLeft());
|
||||
|
||||
$('#inputSignature').on('keyup change', function(ev) {
|
||||
$('#signatureCharCountLeft').html(getSignatureCharsLeft());
|
||||
});
|
||||
|
||||
$('#changePictureBtn').on('click', function() {
|
||||
selectedImageType = '';
|
||||
AccountEdit.updateImages();
|
||||
|
||||
@@ -84,9 +84,9 @@
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="inputSignature">[[user:signature]]</label>
|
||||
<label class="control-label" for="inputSignature">[[user:signature]]</label> <small><label id="signatureCharCountLeft"></label></small>
|
||||
<div class="controls">
|
||||
<textarea class="form-control" id="inputSignature" placeholder="max 150 chars" rows="5">{signature}</textarea>
|
||||
<textarea class="form-control" id="inputSignature" rows="5">{signature}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -83,6 +83,8 @@
|
||||
<input type="text" class="form-control" value="16" data-field="maximumUsernameLength"><br />
|
||||
<strong>Minimum Password Length</strong><br />
|
||||
<input type="text" class="form-control" value="6" data-field="minimumPasswordLength"><br />
|
||||
<strong>Maximum Signature Length</strong><br />
|
||||
<input type="text" class="form-control" value="255" data-field="maximumSignatureLength"><br />
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
@@ -220,6 +220,9 @@ var async = require('async'),
|
||||
}, {
|
||||
field: 'imgurClientID',
|
||||
value: ''
|
||||
}, {
|
||||
field: 'maximumSignatureLength',
|
||||
value: 255
|
||||
}, {
|
||||
field: 'maximumProfileImageSize',
|
||||
value: 256
|
||||
|
||||
@@ -34,9 +34,10 @@ var path = require('path'),
|
||||
config.minimumUsernameLength = meta.config.minimumUsernameLength;
|
||||
config.maximumUsernameLength = meta.config.maximumUsernameLength;
|
||||
config.minimumPasswordLength = meta.config.minimumPasswordLength;
|
||||
config.maximumSignatureLength = meta.config.maximumSignatureLength;
|
||||
config.useOutgoingLinksPage = meta.config.useOutgoingLinksPage;
|
||||
config.emailSetup = !!meta.config['email:from'];
|
||||
|
||||
console.log(config);
|
||||
res.json(200, config);
|
||||
});
|
||||
|
||||
@@ -149,11 +150,11 @@ var path = require('path'),
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
}, req.params.id, uid);
|
||||
}, req.params.id, uid);
|
||||
} else {
|
||||
res.send(403);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
} else {
|
||||
res.send(403);
|
||||
|
||||
@@ -190,9 +190,9 @@ var bcrypt = require('bcrypt'),
|
||||
};
|
||||
|
||||
function isSignatureValid(next) {
|
||||
if (data.signature !== undefined && data.signature.length > 150) {
|
||||
if (data.signature !== undefined && data.signature.length > meta.config.maximumSignatureLength) {
|
||||
next({
|
||||
error: 'Signature can\'t be longer than 150 characters!'
|
||||
error: 'Signature can\'t be longer than ' + meta.config.maximumSignatureLength + ' characters!'
|
||||
}, false);
|
||||
} else {
|
||||
next(null, true);
|
||||
|
||||
Reference in New Issue
Block a user