Add pwstrength inside public/libs, fix inscription.php UI

pull/2487/head
jmontoyaa 7 years ago
parent fccbc6ae68
commit c6c659c983
  1. 19
      assets/js/main.js
  2. 12
      main/template/default/auth/inscription.html.twig
  3. 7
      package.json
  4. 4
      public/libs/pwstrength-bootstrap/.gitignore
  5. 5
      public/libs/pwstrength-bootstrap/.travis.yml
  6. 39
      public/libs/pwstrength-bootstrap/AUTHORS.txt
  7. 259
      public/libs/pwstrength-bootstrap/CHANGES.md
  8. 0
      public/libs/pwstrength-bootstrap/GPL-LICENSE.txt
  9. 105
      public/libs/pwstrength-bootstrap/Gruntfile.js
  10. 0
      public/libs/pwstrength-bootstrap/MIT-LICENSE.txt
  11. 30
      public/libs/pwstrength-bootstrap/OPTIONS.md
  12. 25
      public/libs/pwstrength-bootstrap/README.md
  13. 4
      public/libs/pwstrength-bootstrap/bower.json
  14. 198
      public/libs/pwstrength-bootstrap/dist/pwstrength-bootstrap.js
  15. 4
      public/libs/pwstrength-bootstrap/dist/pwstrength-bootstrap.min.js
  16. 1
      public/libs/pwstrength-bootstrap/dist/pwstrength-bootstrap.min.map
  17. 4
      public/libs/pwstrength-bootstrap/locales/de.json
  18. 4
      public/libs/pwstrength-bootstrap/locales/el.json
  19. 4
      public/libs/pwstrength-bootstrap/locales/en.json
  20. 4
      public/libs/pwstrength-bootstrap/locales/eo.json
  21. 4
      public/libs/pwstrength-bootstrap/locales/es.json
  22. 6
      public/libs/pwstrength-bootstrap/locales/fr.json
  23. 17
      public/libs/pwstrength-bootstrap/locales/it.json
  24. 4
      public/libs/pwstrength-bootstrap/locales/pl.json
  25. 6
      public/libs/pwstrength-bootstrap/locales/pt.json
  26. 4
      public/libs/pwstrength-bootstrap/locales/ru.json
  27. 4
      public/libs/pwstrength-bootstrap/locales/sk.json
  28. 17
      public/libs/pwstrength-bootstrap/locales/th.json
  29. 4
      public/libs/pwstrength-bootstrap/locales/tr.json
  30. 4
      public/libs/pwstrength-bootstrap/locales/zh-TW.json
  31. 1898
      public/libs/pwstrength-bootstrap/package-lock.json
  32. 40
      public/libs/pwstrength-bootstrap/package.json
  33. 4
      public/libs/pwstrength-bootstrap/src/i18n.js
  34. 9
      public/libs/pwstrength-bootstrap/src/methods.js
  35. 123
      public/libs/pwstrength-bootstrap/src/options.js
  36. 35
      public/libs/pwstrength-bootstrap/src/rules.js
  37. 3
      public/libs/pwstrength-bootstrap/src/ui.js
  38. 16
      webpack.config.js
  39. 15
      yarn.lock

@ -13,11 +13,11 @@ require("webpack-jquery-ui/css");
// no need to set this to a variable, just require it
require("bootstrap-sass");
require("chosen-js");
// require("font-awesome-webpack");
// require("font-awesome-webpack"); already added manually in main.scss
// require("ckeditor"); // version 4.x doesnt have webpack support
require("mediaelement");
//require("js-cookie");
// full calendar added in lib
//require("fullcalendar");
require("qtip2");
@ -27,17 +27,18 @@ require("cropper");
require("jquery-ui-timepicker-addon/dist/jquery-ui-timepicker-addon");
require("jquery.scrollbar");
require("blueimp-file-upload");
//require ("readmore-js");
require("select2");
require("select2/dist/css/select2.css");
require('bootstrap-select/dist/js/bootstrap-select.js');
require('bootstrap-select/dist/css/bootstrap-select.css');
// Don't work with webpack
//require("js-cookie");
// doesn't work with webpack added directly in /public/libs folder
/*
require("pwstrength-bootstrap");
require ("readmore-js");
require("js-cookie");
require("js-cookie");
require("jquery-ui-timepicker-addon");
*/
//require("bootstrap-daterangepicker");
require("ckeditor");
*/

@ -5,10 +5,10 @@
%}
{% block content %}
{{ inscription_header }}
{{ inscription_content }}
{{ form }}
{{ text_after_registration }}
{% autoescape false %}
{{ inscription_header }}
{{ inscription_content }}
{{ form }}
{{ text_after_registration }}
{% endautoescape %}
{% endblock %}

@ -1,4 +1,8 @@
{
"name": "chamilo",
"version": "2.0.0",
"description": "E-learning and collaboration software",
"license": "GPL-3.0",
"devDependencies": {
"@symfony/webpack-encore": "^0.19",
"babel-preset-react": "^6.24.1",
@ -31,11 +35,10 @@
"mediaelement": "^4.2.9",
"moment": "^2.22",
"mxgraph": "^3.9.3",
"pwstrength-bootstrap": "^2.1.1",
"qtip2": "^3.0.3",
"select2": "^4.0.6-rc.1",
"simplewebrtc": "^3.0.1",
"timeago": "^1.6.1",
"timeago": "^1.6.3",
"webcamjs": "^1.0",
"webpack-jquery-ui": "^1.0.0"
}

@ -0,0 +1,4 @@
*~
node_modules
bower_components
/nbproject/private/

@ -0,0 +1,5 @@
language: node_js
node_js:
- "7.4.0"
before_script:
- npm install -g grunt-cli

@ -0,0 +1,39 @@
Authors ordered by first contribution.
Tane Piper <piper.tane@gmail.com>
Alejandro Blanco <alejandro.b.e@gmail.com>
Victor "Skakruk" <skakruk15@gmail.com>
Dameon87 <https://github.com/Dameon87>
Manuel Saelices <https://github.com/msaelices>
Samuel Levy <https://github.com/samlev>
Petros Kal. <https://github.com/kalpetros>
Maximilian Meister <mmeister@suse.de>
André Durão <andreluisdurao@gmail.com>
Peter Goes <https://github.com/petergoes>
Brent <https://github.com/bergerbs>
mikemey <https://github.com/mikemey>
saparicio <https://github.com/saparicio>
Javier Holguera <jholguerablanco@hotmail.com>
Rômulo Alves <romulo@romuloalves.com.br>
Hannah "hpinkos" <https://github.com/hpinkos>
Mike Stecker <https://github.com/mikestecker>
Aysel Afsar <https://github.com/ayselafsar>
Pablo Alexander <pablo@parg.com.br>
Meiyer <https://github.com/interDist>
toxuh <https://github.com/toxuh>
Anton Zakharov
Guilherme Pejon <https://github.com/guilpejon>
bakcay <https://github.com/bakcay>
Jason DiBianco <dibiancoj@gmail.com>
Andreas B <https://github.com/andreasba>
piernik <https://github.com/piernik>
Julio Montoya <https://github.com/jmontoyaa>
mindcreations <https://github.com/mindcreations>
Cal West <https://github.com/Allerion>
Grégory Pelletey <gregory.pelletey@gmail.com>
pages-solutions <https://github.com/pages-solutions>
fuzzfree <https://github.com/fuzzfree>
Roland Häder <https://github.com/Quix0r>
Tzipora Ziegler <https://github.com/tziporaziegler>
Ishmael Doss๛ <nukboon@gmail.com>
Pascal Gentemann <https://github.com/PascalGentemann>

@ -0,0 +1,259 @@
# CHANGELOG
## 2.2.0
- Add new rule to penalize common passwords.
## 2.1.4
- Thai localization.
- Fix typo in German localization.
- Activate by default the extra security rules.
- Make the invalid chars optional rule configurable.
## 2.1.3
- Bugfix, call `onScore` when zxcvbn is in use too.
## 2.1.2
- Fix errors in Portuguese localization.
- Fix French localization capitalization.
- Fix ruleIsMet issues with wordMin and wordMax rules.
- Don't allow verdict to break line when inside progress bar.
## 2.1.1
- Add missing rule, needed by the `ruleIsMet` method.
- Add `wordMaxLength` and `wordInvalidChar` optional rules to the engine.
## 2.1.0
- Slovak translation.
- Add a new `ruleIsMet` method that returns a boolean value indicating if all
password inputs in the page pass a specific rule.
## 2.0.8
- Fix showing the strength of the password through the status of the field.
## 2.0.7
- Add new option `progressExtraCssClasses` to be able to customize the
container of the progress bar.
- Updated development dependencies.
## 2.0.6
- Updated development dependencies.
- Bootstrap 4 alpha 6 support.
## 2.0.5
- Italian localization.
## 2.0.4
- French localization.
- Don't use Math.log2 since IE doesn't support it.
## 2.0.3
- German localization.
- Polish localization.
## 2.0.2
- Add a `onScore` callback to allow for a final score modification.
- Turkish localization.
## 2.0.1
- Fix bad assignment in the plugin initialization.
- Russian localization.
- New option to control the events the plugin listen to.
## 2.0.0
- Use six possible verdicts and six possible css classes, so they match one
to one making it possible to configure each class for each verdict level.
- Properly manage the paste event so the meter updates when the user pastes the
password.
- Add a new option to display the password score.
- Translations support, ahora hablamos idiomas.
- New option to set the minimum possible percentage filled in the progress bar
when the password field is not empty.
- New option to set the minimum possible percentage filled in the progress bar
when the password field is empty.
- New option for extra CSS classes to be added to the generated progress bar.
### Breaking changes
- There are 6 verdicts and css classes now, instead of 5.
- `verdicts` and `errorMessages` options have been removed. Now they rely on
the translations system.
## 1.2.10
- Replace entropy call with log2 of guesses for zxcvbn because entropy property
is removed in zxcvbn v4.0.1, and it was just log2 of guesses.
## 1.2.9
- No changes, I forgot to add the built files into the 1.2.8, so I'm releasing
the same again.
## 1.2.8
- Updated to work with Bootstrap 4. Bootstrap 3 is still the default mode.
- Allow to establish the placement of the popover through an option.
- Make the css classes added to the bar and verdicts customizable.
- Bugfix in the progress bar percentage calculation for a score of zero.
## 1.2.7
- Bugfix: escape special characters in username for regex.
## 1.2.6
- More sensible default score for sequences rule.
- Publish plugin in npm.
## 1.2.5
- Bugfix when using zxcvbn and form inputs with empty values.
- New option to specify a list of banned words for zxcvbn.
## 1.2.4
- New option to add a class in verdict element.
- If there is text in the password field, don't show the progress bar empty.
- Empty verdict for an empty password field.
- Support html in the verdicts content.
## 1.2.3
- New option to customize the html of the popover with the errors.
- Bugfix in special char regex.
## 1.2.2
- Every rule can have associated error messages.
## 1.2.1
- Improve documentation.
- Fix typo in alphabetical sequence.
- Use the not minified version of the library in bower as main file.
## 1.2.0
- Listen also to the `change` and `onpaste` events, not only to the `onkeyup`.
- Show the lowest verdict when the score is below zero.
- New option to pass more input fields content to the zxcvbn library.
- Don't show the verdicts inside the popover if they are being showed inside
the progressbar.
## 1.1.5
- Better Bower configuration.
- Pass also the verdict level to the "on key up" event handler.
- Add a basic usage section to the readme.
## 1.1.4
- Bower support.
## 1.1.3
- Pass the score and the verdict to the "on key up" event handler.
## 1.1.2
- Upgrade dev dependencies: grunt plugins and jquery
- Bugfix in sequences lookup
- New tests for sequences lookup
## 1.1.1
- Pass the username field content to the zxcvbn function, so zxcvbn takes it
into consideration when scoring the password.
- Add a debug option, so the score gets printed in the JS console.
- Check reversed sequences too in the sequences rule.
- Fix the popover flickering.
## 1.1.0
- Support zxcvbn for password scoring.
- Support showing the password strength as a validation status in the password
field.
- Support hiding the progress bar, making it optional.
- Support showing the verdicts inside the progress bar.
## 1.0.2
- Bugfix in UI initialization.
- Fix typo in readme.
## 1.0.1
- Separate source file in several smaller files.
- Add Grunt support for creating a bundle and a minified version.
- Add tests for the rules engine, and continuos integration with Travis.
## 1.0.0
- Complete refactor of the code. This is a cleaner version, easier to extend
and mantain.
- Broke backwards compatibility. Bootstrap 3 is the default option now, other
options default values have changed. Options structure has changed too.
- Old tests have been renamed to examples, which is what they really are. Leave
room for real tests.
## 0.7.0
- New rule to check for sequences in the password. It penalizes finding
sequences of consecutive numbers, consecutive characters in the alphabet or
in the qwerty layout. Active by default.
## 0.6.0
- New feature: support showing the verdicts and errors in a Bootstrap popover.
- Hide the verdicts and errors when the input is empty.
- Remove _showVerdictsInitially_ option, is not needed anymore.
## 0.5.0
- Support to activate/deactivate rules using the _rules_ object inside the
_options_ object.
- Two new rules added, deactivated by default. Check for too many character
repetitions, and check for number of character classes used.
## 0.4.5
- Fix error message when the password contains the username.
- Check if the password is an email, and mark as weak.
- Add a _container_ option, it will be used to look for the viewports.
## 0.4.4
- Bad version in plugin manifest.
## 0.4.3
- Change jQuery plugin name to avoid conflict with an existing one.
## 0.4.2
- New option to choose if the verdicts should be displayed before the user
introduces a letter. New default behaviour: don't show them.
- Bugfix with progress bar color and Bootstrap 2.
- Improve code quality.
## 0.4.1
- jQuery plugins registry support.
## 0.4.0
- Bootstrap 3.0.0 support.

@ -0,0 +1,105 @@
/*jslint node: true */
/*global */
module.exports = function (grunt) {
"use strict";
var license =
'/*!\n' +
'* jQuery Password Strength plugin for Twitter Bootstrap\n' +
'* Version: <%= pkg.version %>\n' +
'*\n' +
'* Copyright (c) 2008-2013 Tane Piper\n' +
'* Copyright (c) 2013 Alejandro Blanco\n' +
'* Dual licensed under the MIT and GPL licenses.\n' +
'*/\n\n' +
'(function (jQuery) {\n';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jslint: {
client: {
src: [
'src/*js', 'spec/*js', 'Gruntfile.js'
],
directives: {
browser: true,
predef: [
'jQuery'
]
}
}
},
jasmine_node: {
options: {
forceExit: true,
jUnit: {
report: false
}
},
all: ['spec/']
},
concat: {
options: {
banner: license,
footer: '}(jQuery));',
process: function (src, filepath) {
// Remove ALL block comments, the stripBanners only removes
// the first one
src = src.replace(/\/\*[\s\S]*?\*\//g, '');
return '// Source: ' + filepath + src;
}
},
dist: {
src: [
'src/i18n.js', 'src/rules.js', 'src/options.js',
'src/ui.js', 'src/methods.js'
],
dest: '<%= pkg.name %>.js'
}
},
uglify: {
options: {
banner: '/* <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> - GPLv3 & MIT License */\n',
sourceMap: true,
sourceMapName: '<%= pkg.name %>.min.map'
},
dist: {
files: {
'<%= pkg.name %>.min.js': [
'<%= concat.dist.dest %>'
]
}
}
},
shell: {
copyFile: {
command: 'cp <%= concat.dist.dest %> examples/pwstrength.js'
},
copyZxcvbn: {
command: 'cp bower_components/zxcvbn/dist/zxcvbn.js examples/zxcvbn.js'
},
copyI18next: {
command: 'cp bower_components/i18next/i18next.min.js examples/i18next.js'
},
makeDir: {
command: 'mkdir -p dist'
},
moveFiles: {
command: 'mv <%= pkg.name %>* dist/'
}
}
});
// Load the plugins
grunt.loadNpmTasks('grunt-jslint');
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-jasmine-node');
grunt.registerTask('test', ['jslint', 'jasmine_node']);
// Default task(s)
grunt.registerTask('default', ['jslint', 'concat', 'uglify', 'shell']);
};

@ -21,6 +21,12 @@ Let's see the options of each section.
Sets the minimum required of characters for a password to not be considered
too weak.
* __maxChar__:
Default: `20` (Integer)
Sets the maximum allowed characters for a password.
* __usernameField__:
Default: `"#username"` (String)
@ -28,6 +34,13 @@ Let's see the options of each section.
The username field to match a password to, to ensure the user does not use
the same value for their password.
* __invalidCharsRegExp__:
Default: `new RegExp(/[\s,'"]/)` (Regular Expression)
A regular expression object to use to test for banned characters in the
password.
* __userInputs__:
Default: `[]` (Array)
@ -115,7 +128,9 @@ Let's see the options of each section.
```
{
wordNotEmail: -100,
wordLength: -50,
wordMinLength: -50,
wordMaxLength: -50,
wordInvalidChar: -100,
wordSimilarToUsername: -100,
wordSequences: -50,
wordTwoCharacterClasses: 2,
@ -142,7 +157,9 @@ Let's see the options of each section.
```
{
wordNotEmail: true,
wordLength: true,
wordMinLength: true,
wordMaxLength: false,
wordInvalidChar: true,
wordSimilarToUsername: true,
wordSequences: true,
wordTwoCharacterClasses: false,
@ -169,6 +186,13 @@ Let's see the options of each section.
The value used to modify the final score, based on the password length,
allows you to tailor your results.
* __commonPasswords__:
Default: `['123456', 'password', ...]` (Array of Strings)
A list of the most common passwords. If the user inputs a password present
in the list, then it gets heavily penalized.
## User Interface
* __bootstrap2__:
@ -212,7 +236,7 @@ Let's see the options of each section.
use of the extra classes provided by Bootstrap. The classes will be added to
the proper DOM element depending of which version of Bootstrap is being
used.
E.g.
```css
div.progress.custom-class {

@ -46,15 +46,15 @@ meter to. For example, to use it on all the password fields with the default
examples:
```javascript
$(':password').pwstrength();
$(':password').pwstrength();
```
To apply it only to one input and change the options:
```javascript
$('#passwd1').pwstrength({
ui: { showVerdictsInsideProgressBar: true }
});
$('#passwd1').pwstrength({
ui: { showVerdictsInsideProgressBar: true }
});
```
## Options
@ -174,20 +174,25 @@ $(document).ready(function () {
```
## Extra security
## Extra restrictions
The plugin comes with two validation rules deactivated by default. One checks
for too many character repetitions, and the other checks the number of
character classes used. An easy way to increase the security of the passwords
is to activate this two rules:
the length of the password and penalizes it if it's too long; and the other
checks if the password contains a banned char, and penalizes it if it does.
You can configure the max length of the password by using the option `maxChar`.
You can also configure the invalid chars by using the option
`invalidCharsRegExp`.
If you need these restrictions you just need to activate this two rules:
```javascript
$(document).ready(function () {
var options = {};
options.rules = {
activated: {
wordTwoCharacterClasses: true,
wordRepetitions: true
wordMaxLength: true,
wordInvalidChar: true
}
};
$(':password').pwstrength(options);

@ -1,6 +1,6 @@
{
"name": "pwstrength-bootstrap",
"version": "2.1.0",
"version": "2.2.0",
"homepage": "https://github.com/ablanco/jquery.pwstrength.bootstrap",
"authors": [
"Alejandro Blanco <alejandro.b.e@gmail.com>"
@ -8,7 +8,7 @@
"description": "jQuery plugin for Twitter Bootstrap that provides rulesets for visualy displaying the quality of a users typed in password.",
"main": "dist/pwstrength-bootstrap.js",
"dependencies": {
"jquery": ">=1.7.0",
"jquery": ">=3.0.0",
"bootstrap": ">=2.0.0",
"zxcvbn": ">=4.2.0",
"i18next": ">=2.4.0"

@ -1,6 +1,6 @@
/*!
* jQuery Password Strength plugin for Twitter Bootstrap
* Version: 2.0.8
* Version: 2.2.0
*
* Copyright (c) 2008-2013 Tane Piper
* Copyright (c) 2013 Alejandro Blanco
@ -19,7 +19,9 @@ var i18n = {};
'use strict';
i18n.fallback = {
"wordLength": "Your password is too short",
"wordMinLength": "Your password is too short",
"wordMaxLength": "Your password is too long",
"wordInvalidChar": "Your password contains an invalid character",
"wordNotEmail": "Do not use your email as your password",
"wordSimilarToUsername": "Your password cannot contain your username",
"wordTwoCharacterClasses": "Use different character classes",
@ -80,7 +82,7 @@ try {
return 0;
};
validation.wordLength = function (options, word, score) {
validation.wordMinLength = function (options, word, score) {
var wordlen = word.length,
lenScore = Math.pow(wordlen, options.rules.raisePower);
if (wordlen < options.common.minChar) {
@ -89,6 +91,31 @@ try {
return lenScore;
};
validation.wordMaxLength = function (options, word, score) {
var wordlen = word.length,
lenScore = Math.pow(wordlen, options.rules.raisePower);
if (wordlen > options.common.maxChar) {
return score;
}
return lenScore;
};
validation.wordInvalidChar = function (options, word, score) {
if (options.common.invalidCharsRegExp.test(word)) {
return score;
}
return 0;
};
validation.wordMinLengthStaticScore = function (options, word, score) {
return word.length < options.common.minChar ? 0 : score;
};
validation.wordMaxLengthStaticScore = function (options, word, score) {
return word.length > options.common.maxChar ? 0 : score;
};
validation.wordSimilarToUsername = function (options, word, score) {
var username = $(options.common.usernameField).val();
if (username && word.toLowerCase().match(username.replace(/[\-\[\]\/\{\}\(\)\*\+\=\?\:\.\\\^\$\|\!\,]/g, "\\$&").toLowerCase())) {
@ -167,6 +194,10 @@ try {
return word.match(/([a-zA-Z0-9].*[!,@,#,$,%,\^,&,*,?,_,~])|([!,@,#,$,%,\^,&,*,?,_,~].*[a-zA-Z0-9])/) && score;
};
validation.wordIsACommonPassword = function (options, word, score) {
return ($.inArray(word, options.rules.commonPasswords) >= 0) && score;
};
rulesEngine.validation = validation;
rulesEngine.executeRules = function (options, word) {
@ -198,10 +229,6 @@ try {
}
});
if ($.isFunction(options.common.onScore)) {
totalScore = options.common.onScore(options, word, totalScore);
}
return totalScore;
};
}(jQuery, rulesEngine));
@ -221,7 +248,9 @@ var defaultOptions = {};
defaultOptions.common = {};
defaultOptions.common.minChar = 6;
defaultOptions.common.maxChar = 20;
defaultOptions.common.usernameField = "#username";
defaultOptions.common.invalidCharsRegExp = new RegExp(/[\s,'"]/);
defaultOptions.common.userInputs = [
// Selectors for input fields with user input
];
@ -239,7 +268,9 @@ defaultOptions.rules = {};
defaultOptions.rules.extra = {};
defaultOptions.rules.scores = {
wordNotEmail: -100,
wordLength: -50,
wordMinLength: -50,
wordMaxLength: -50,
wordInvalidChar: -100,
wordSimilarToUsername: -100,
wordSequences: -20,
wordTwoCharacterClasses: 2,
@ -252,15 +283,18 @@ defaultOptions.rules.scores = {
wordTwoSpecialChar: 5,
wordUpperLowerCombo: 2,
wordLetterNumberCombo: 2,
wordLetterNumberCharCombo: 2
wordLetterNumberCharCombo: 2,
wordIsACommonPassword: -100
};
defaultOptions.rules.activated = {
wordNotEmail: true,
wordLength: true,
wordMinLength: true,
wordMaxLength: false,
wordInvalidChar: false,
wordSimilarToUsername: true,
wordSequences: true,
wordTwoCharacterClasses: false,
wordRepetitions: false,
wordTwoCharacterClasses: true,
wordRepetitions: true,
wordLowercase: true,
wordUppercase: true,
wordOneNumber: true,
@ -269,9 +303,113 @@ defaultOptions.rules.activated = {
wordTwoSpecialChar: true,
wordUpperLowerCombo: true,
wordLetterNumberCombo: true,
wordLetterNumberCharCombo: true
wordLetterNumberCharCombo: true,
wordIsACommonPassword: true
};
defaultOptions.rules.raisePower = 1.4;
// List taken from https://github.com/danielmiessler/SecLists (MIT License)
defaultOptions.rules.commonPasswords = [
'123456',
'password',
'12345678',
'qwerty',
'123456789',
'12345',
'1234',
'111111',
'1234567',
'dragon',
'123123',
'baseball',
'abc123',
'football',
'monkey',
'letmein',
'696969',
'shadow',
'master',
'666666',
'qwertyuiop',
'123321',
'mustang',
'1234567890',
'michael',
'654321',
'pussy',
'superman',
'1qaz2wsx',
'7777777',
'fuckyou',
'121212',
'000000',
'qazwsx',
'123qwe',
'killer',
'trustno1',
'jordan',
'jennifer',
'zxcvbnm',
'asdfgh',
'hunter',
'buster',
'soccer',
'harley',
'batman',
'andrew',
'tigger',
'sunshine',
'iloveyou',
'fuckme',
'2000',
'charlie',
'robert',
'thomas',
'hockey',
'ranger',
'daniel',
'starwars',
'klaster',
'112233',
'george',
'asshole',
'computer',
'michelle',
'jessica',
'pepper',
'1111',
'zxcvbn',
'555555',
'11111111',
'131313',
'freedom',
'777777',
'pass',
'fuck',
'maggie',
'159753',
'aaaaaa',
'ginger',
'princess',
'joshua',
'cheese',
'amanda',
'summer',
'love',
'ashley',
'6969',
'nicole',
'chelsea',
'biteme',
'matthew',
'access',
'yankees',
'987654321',
'dallas',
'austin',
'thunder',
'taylor',
'matrix'
];
defaultOptions.ui = {};
defaultOptions.ui.bootstrap2 = false;
@ -492,6 +630,9 @@ var ui = {};
if (cssClass > -1) {
$verdict.addClass(options.ui.colorClasses[cssClass]);
}
if (options.ui.showVerdictsInsideProgressBar) {
$verdict.css('white-space', 'nowrap');
}
$verdict.html(text);
};
@ -678,13 +819,18 @@ var methods = {};
} else {
score = rulesEngine.executeRules(options, word);
}
if ($.isFunction(options.common.onScore)) {
score = options.common.onScore(options, word, score);
}
}
ui.updateUI(options, $el, score);
verdictText = ui.getVerdictAndCssClass(options, score);
verdictLevel = verdictText[1];
verdictText = verdictText[0];
if (options.common.debug) { console.log(score + ' - ' + verdictText); }
if (options.common.debug) {
console.log(score + ' - ' + verdictText);
}
if ($.isFunction(options.common.onKeyUp)) {
options.common.onKeyUp(event, {
@ -705,7 +851,7 @@ var methods = {};
callback;
callback = function () {
var newWord = $el.val();
var newWord = $el.val();
if (newWord !== word) {
onKeyUp(event);
@ -788,6 +934,28 @@ var methods = {};
applyToAll.call(this, rule, "activated", active);
};
methods.ruleIsMet = function (rule) {
if ($.isFunction(rulesEngine.validation[rule])) {
if (rule === "wordMinLength") {
rule = "wordMinLengthStaticScore";
} else if (rule === "wordMaxLength") {
rule = "wordMaxLengthStaticScore";
}
var rulesMetCnt = 0;
this.each(function (idx, el) {
var options = $(el).data("pwstrength-bootstrap");
rulesMetCnt += rulesEngine.validation[rule](options, $(el).val(), 1);
});
return (rulesMetCnt === this.length);
}
$.error("Rule " + rule + " does not exist on jQuery.pwstrength-bootstrap.validation");
};
$.fn.pwstrength = function (method) {
var result;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,5 +1,7 @@
{
"wordLength": "Das Passwort ist zu kurz",
"wordMinLength": "Das Passwort ist zu kurz",
"wordMaxLength": "Das Passwort ist zu lang",
"wordInvalidChar": "Das Passwort enthält ein ungültiges Zeichen",
"wordNotEmail": "Das Passwort darf die E-Mail Adresse nicht enthalten",
"wordSimilarToUsername": "Das Passwort darf den Benutzernamen nicht enthalten",
"wordTwoCharacterClasses": "Bitte Buchstaben und Ziffern verwenden",

@ -1,5 +1,7 @@
{
"wordLength": "Ο κωδικός πρόσβασης δεν έχει τον ελάχιστο αριθμό χαρακτήρων",
"wordMinLength": "Ο κωδικός πρόσβασης δεν έχει τον ελάχιστο αριθμό χαρακτήρων",
"wordMaxLength": "Ο κωδικός πρόσβασής σας είναι πολύ μεγάλος",
"wordInvalidChar": "Ο κωδικός πρόσβασής σας περιέχει έναν μη έγκυρο χαρακτήρα",
"wordNotEmail": "Μη χρησιμοποιείτε το email ως κωδικό",
"wordSimilarToUsername": "Ο κωδικός πρόσβασης δεν πρέπει να περιέχει το username",
"wordTwoCharacterClasses": "Χρησιμοποιήστε διαφορετικές κλάσεις χαρακτήρων",

@ -1,5 +1,7 @@
{
"wordLength": "Your password is too short",
"wordMinLength": "Your password is too short",
"wordMaxLength": "Your password is too long",
"wordInvalidChar": "Your password contains an invalid character",
"wordNotEmail": "Do not use your email as your password",
"wordSimilarToUsername": "Your password cannot contain your username",
"wordTwoCharacterClasses": "Use different character classes",

@ -1,5 +1,7 @@
{
"wordLength": "Via pasvorto estas tro mallonga",
"wordMinLength": "Via pasvorto estas tro mallonga",
"wordMaxLength": "Via pasvorto estas tro longa",
"wordInvalidChar": "Via pasvorto enhavas nevalidan karaktero",
"wordNotEmail": "Ne uzu vian retpoŝtadreson kiel la pasvorton",
"wordSimilarToUsername": "Via pasvorto enhavas vian uzanto-nomon",
"wordTwoCharacterClasses": "Uzu signojn de diversaj tipoj (ekz., literoj kaj ciferoj)",

@ -1,5 +1,7 @@
{
"wordLength": "Tu contraseña es demasiado corta",
"wordMinLength": "Tu contraseña es demasiado corta",
"wordMaxLength": "Tu contraseña es muy larga",
"wordInvalidChar": "Tu contraseña contiene un carácter no válido",
"wordNotEmail": "No uses tu email como tu contraseña",
"wordSimilarToUsername": "Tu contraseña no puede contener tu nombre de usuario",
"wordTwoCharacterClasses": "Mezcla diferentes clases de caracteres",

@ -1,5 +1,7 @@
{
"wordLength": "Votre mot de passe est trop court",
"wordMinLength": "Votre mot de passe est trop court",
"wordMaxLength": "Votre mot de passe est trop long",
"wordInvalidChar": "Votre mot de passe contient un caractère invalide",
"wordNotEmail": "Ne pas utiliser votre adresse e-mail comme mot de passe",
"wordSimilarToUsername": "Votre mot de passe ne peut pas contenir votre nom d'utilisateur",
"wordTwoCharacterClasses": "Utilisez différents type de caractères",
@ -11,5 +13,5 @@
"normal": "Normal",
"medium": "Moyen",
"strong": "Fort",
"veryStrong": "Très fort"
"veryStrong": "Très Fort"
}

@ -0,0 +1,17 @@
{
"wordMinLength": "La tua password è troppo corta",
"wordMaxLength": "La tua password è troppo lunga",
"wordInvalidChar": "La tua password contiene un carattere non valido",
"wordNotEmail": "Non usare la tua e-mail come password",
"wordSimilarToUsername": "La tua password non può contenere il tuo nome",
"wordTwoCharacterClasses": "Usa classi di caratteri diversi",
"wordRepetitions": "Troppe ripetizioni",
"wordSequences": "La tua password contiene sequenze",
"errorList": "Errori:",
"veryWeak": "Molto debole",
"weak": "Debole",
"normal": "Normale",
"medium": "Media",
"strong": "Forte",
"veryStrong": "Molto forte"
}

@ -1,5 +1,7 @@
{
"wordLength": "Hasło jest zbyt krótkie",
"wordMinLength": "Hasło jest zbyt krótkie",
"wordMaxLength": "Hasło jest za długie",
"wordInvalidChar": "Hasło zawiera nieprawidłowy znak",
"wordNotEmail": "Hasło nie może być Twoim emailem",
"wordSimilarToUsername": "Hasło nie może zawierać nazwy użytkownika",
"wordTwoCharacterClasses": "Użyj innych klas znaków",

@ -1,11 +1,13 @@
{
"wordLength": "Sua senha é muito curta",
"wordMinLength": "Sua senha é muito curta",
"wordMaxLength": "Sua senha é muito longa",
"wordInvalidChar": "Sua senha contém um caractere inválido",
"wordNotEmail": "Não use seu e-mail como senha",
"wordSimilarToUsername": "Sua senha não pode conter o seu nome de usuário",
"wordTwoCharacterClasses": "Use diferentes classes de caracteres",
"wordRepetitions": "Muitas repetições",
"wordSequences": "Sua senha contém sequências",
"errorList": "Errores:",
"errorList": "Erros:",
"veryWeak": "Muito Fraca",
"weak": "Fraca",
"normal": "Normal",

@ -1,5 +1,7 @@
{
"wordLength": "Слишком короткий пароль",
"wordMinLength": "Слишком короткий пароль",
"wordMaxLength": "Ваш пароль слишком длинный",
"wordInvalidChar": "Ваш пароль содержит недопустимый символ",
"wordNotEmail": "Не используйте e-mail в качестве пароля",
"wordSimilarToUsername": "Пароль не должен содержать логин",
"wordTwoCharacterClasses": "Используйте разные классы символов",

@ -1,5 +1,7 @@
{
"wordLength": "Vaše heslo je príliž krátke",
"wordMinLength": "Vaše heslo je príliž krátke",
"wordMaxLength": "Vaše heslo je príliš dlhé",
"wordInvalidChar": "Vaše heslo obsahuje neplatný znak",
"wordNotEmail": "Nepoužívajte Váš email ako Vaše heslo",
"wordSimilarToUsername": "Vaše heslo nesmie obsahovať prihlasovacie meno",
"wordTwoCharacterClasses": "Použite rôzne druhy znakov",

@ -0,0 +1,17 @@
{
"wordMinLength": "รหสผานของคณสนเกนไป",
"wordMaxLength": "รหสผานของคณยาวเกนไป",
"wordInvalidChar": "รหสผานของคณมกษรทไมกตอง",
"wordNotEmail": "คณไมสามารถใชรหสผานเหมอนกบอเมลของคณได",
"wordSimilarToUsername": "รหสผานไมควรประกอบดวยคำทเปน username",
"wordTwoCharacterClasses": "ลองเปนกลมคำใหม",
"wordRepetitions": "มกษรซำเยอะเกนไป",
"wordSequences": "รหสผานของคณเดางายเกนไป",
"errorList": "Errors:",
"veryWeak": "เดางายมาก",
"weak": "เดางาย",
"normal": "พอใช",
"medium": "กำลงด",
"strong": "คอนขางด",
"veryStrong": "ดมาก"
}

@ -1,5 +1,7 @@
{
"wordLength": "Girdiğiniz şifre çok Kısa",
"wordMinLength": "Girdiğiniz şifre çok Kısa",
"wordMaxLength": "Parolanız çok uzun",
"wordInvalidChar": "Şifreniz geçersiz bir karakter içeriyor",
"wordNotEmail": "E-mail adresinizi şifreniz içerisinde kullanmayınız",
"wordSimilarToUsername": "Kullanıcı Adınızı şifreniz içerisinde kullanmayınız",
"wordTwoCharacterClasses": "Başka karakter sınıfı kullanınız",

@ -1,5 +1,7 @@
{
"wordLength": "您的密碼太短",
"wordMinLength": "您的密碼太短",
"wordMaxLength": "您的密碼太長",
"wordInvalidChar": "您的密碼包含無效字符",
"wordNotEmail": "不要使用電子郵件作為密碼",
"wordSimilarToUsername": "您的密碼不能包含您的用戶名",
"wordTwoCharacterClasses": "使用不同的字元類型 例如: 大小寫混合",

File diff suppressed because it is too large Load Diff

@ -0,0 +1,40 @@
{
"name": "pwstrength-bootstrap",
"version": "2.2.0",
"description": "jQuery plugin for Twitter Bootstrap that provides rulesets for visualy displaying the quality of a users typed in password.",
"author": "Alejandro Blanco <alejandro.b.e@gmail.com>",
"homepage": "https://github.com/ablanco/jquery.pwstrength.bootstrap",
"bugs": {
"url": "https://github.com/ablanco/jquery.pwstrength.bootstrap/issues"
},
"keywords": [
"bootstrap",
"password",
"strength",
"meter",
"jquery-plugin",
"ecosystem:jquery"
],
"repository": {
"type": "git",
"url": "https://github.com/ablanco/jquery.pwstrength.bootstrap.git"
},
"license": "(GPL-3.0 OR MIT)",
"scripts": {
"test": "grunt test"
},
"dependencies": {
"jquery": ">=3.0.0",
"bootstrap": ">=2.0.0"
},
"devDependencies": {
"grunt": "~1.0.1",
"grunt-jslint": "1.1.14",
"grunt-shell": "~2.1.0",
"grunt-contrib-concat": "~1.0.1",
"grunt-contrib-uglify": "~3.0.x",
"grunt-jasmine-node": "~0.3.1",
"jquery": "3.2.x",
"jsdom": "~9.11.0"
}
}

@ -15,7 +15,9 @@ var i18n = {};
'use strict';
i18n.fallback = {
"wordLength": "Your password is too short",
"wordMinLength": "Your password is too short",
"wordMaxLength": "Your password is too long",
"wordInvalidChar": "Your password contains an invalid character",
"wordNotEmail": "Do not use your email as your password",
"wordSimilarToUsername": "Your password cannot contain your username",
"wordTwoCharacterClasses": "Use different character classes",

@ -42,6 +42,9 @@ var methods = {};
} else {
score = rulesEngine.executeRules(options, word);
}
if ($.isFunction(options.common.onScore)) {
score = options.common.onScore(options, word, score);
}
}
ui.updateUI(options, $el, score);
verdictText = ui.getVerdictAndCssClass(options, score);
@ -156,8 +159,10 @@ var methods = {};
methods.ruleIsMet = function (rule) {
if ($.isFunction(rulesEngine.validation[rule])) {
if (rule === "wordLength") {
rule = "wordLengthStaticScore";
if (rule === "wordMinLength") {
rule = "wordMinLengthStaticScore";
} else if (rule === "wordMaxLength") {
rule = "wordMaxLengthStaticScore";
}
var rulesMetCnt = 0;

@ -13,7 +13,9 @@ var defaultOptions = {};
defaultOptions.common = {};
defaultOptions.common.minChar = 6;
defaultOptions.common.maxChar = 20;
defaultOptions.common.usernameField = "#username";
defaultOptions.common.invalidCharsRegExp = new RegExp(/[\s,'"]/);
defaultOptions.common.userInputs = [
// Selectors for input fields with user input
];
@ -31,7 +33,9 @@ defaultOptions.rules = {};
defaultOptions.rules.extra = {};
defaultOptions.rules.scores = {
wordNotEmail: -100,
wordLength: -50,
wordMinLength: -50,
wordMaxLength: -50,
wordInvalidChar: -100,
wordSimilarToUsername: -100,
wordSequences: -20,
wordTwoCharacterClasses: 2,
@ -44,15 +48,18 @@ defaultOptions.rules.scores = {
wordTwoSpecialChar: 5,
wordUpperLowerCombo: 2,
wordLetterNumberCombo: 2,
wordLetterNumberCharCombo: 2
wordLetterNumberCharCombo: 2,
wordIsACommonPassword: -100
};
defaultOptions.rules.activated = {
wordNotEmail: true,
wordLength: true,
wordMinLength: true,
wordMaxLength: false,
wordInvalidChar: false,
wordSimilarToUsername: true,
wordSequences: true,
wordTwoCharacterClasses: false,
wordRepetitions: false,
wordTwoCharacterClasses: true,
wordRepetitions: true,
wordLowercase: true,
wordUppercase: true,
wordOneNumber: true,
@ -61,9 +68,113 @@ defaultOptions.rules.activated = {
wordTwoSpecialChar: true,
wordUpperLowerCombo: true,
wordLetterNumberCombo: true,
wordLetterNumberCharCombo: true
wordLetterNumberCharCombo: true,
wordIsACommonPassword: true
};
defaultOptions.rules.raisePower = 1.4;
// List taken from https://github.com/danielmiessler/SecLists (MIT License)
defaultOptions.rules.commonPasswords = [
'123456',
'password',
'12345678',
'qwerty',
'123456789',
'12345',
'1234',
'111111',
'1234567',
'dragon',
'123123',
'baseball',
'abc123',
'football',
'monkey',
'letmein',
'696969',
'shadow',
'master',
'666666',
'qwertyuiop',
'123321',
'mustang',
'1234567890',
'michael',
'654321',
'pussy',
'superman',
'1qaz2wsx',
'7777777',
'fuckyou',
'121212',
'000000',
'qazwsx',
'123qwe',
'killer',
'trustno1',
'jordan',
'jennifer',
'zxcvbnm',
'asdfgh',
'hunter',
'buster',
'soccer',
'harley',
'batman',
'andrew',
'tigger',
'sunshine',
'iloveyou',
'fuckme',
'2000',
'charlie',
'robert',
'thomas',
'hockey',
'ranger',
'daniel',
'starwars',
'klaster',
'112233',
'george',
'asshole',
'computer',
'michelle',
'jessica',
'pepper',
'1111',
'zxcvbn',
'555555',
'11111111',
'131313',
'freedom',
'777777',
'pass',
'fuck',
'maggie',
'159753',
'aaaaaa',
'ginger',
'princess',
'joshua',
'cheese',
'amanda',
'summer',
'love',
'ashley',
'6969',
'nicole',
'chelsea',
'biteme',
'matthew',
'access',
'yankees',
'987654321',
'dallas',
'austin',
'thunder',
'taylor',
'matrix'
];
defaultOptions.ui = {};
defaultOptions.ui.bootstrap2 = false;

@ -35,7 +35,7 @@ try {
return 0;
};
validation.wordLength = function (options, word, score) {
validation.wordMinLength = function (options, word, score) {
var wordlen = word.length,
lenScore = Math.pow(wordlen, options.rules.raisePower);
if (wordlen < options.common.minChar) {
@ -44,6 +44,31 @@ try {
return lenScore;
};
validation.wordMaxLength = function (options, word, score) {
var wordlen = word.length,
lenScore = Math.pow(wordlen, options.rules.raisePower);
if (wordlen > options.common.maxChar) {
return score;
}
return lenScore;
};
validation.wordInvalidChar = function (options, word, score) {
if (options.common.invalidCharsRegExp.test(word)) {
return score;
}
return 0;
};
validation.wordMinLengthStaticScore = function (options, word, score) {
return word.length < options.common.minChar ? 0 : score;
};
validation.wordMaxLengthStaticScore = function (options, word, score) {
return word.length > options.common.maxChar ? 0 : score;
};
validation.wordSimilarToUsername = function (options, word, score) {
var username = $(options.common.usernameField).val();
if (username && word.toLowerCase().match(username.replace(/[\-\[\]\/\{\}\(\)\*\+\=\?\:\.\\\^\$\|\!\,]/g, "\\$&").toLowerCase())) {
@ -122,6 +147,10 @@ try {
return word.match(/([a-zA-Z0-9].*[!,@,#,$,%,\^,&,*,?,_,~])|([!,@,#,$,%,\^,&,*,?,_,~].*[a-zA-Z0-9])/) && score;
};
validation.wordIsACommonPassword = function (options, word, score) {
return ($.inArray(word, options.rules.commonPasswords) >= 0) && score;
};
rulesEngine.validation = validation;
rulesEngine.executeRules = function (options, word) {
@ -153,10 +182,6 @@ try {
}
});
if ($.isFunction(options.common.onScore)) {
totalScore = options.common.onScore(options, word, totalScore);
}
return totalScore;
};
}(jQuery, rulesEngine));

@ -174,6 +174,9 @@ var ui = {};
if (cssClass > -1) {
$verdict.addClass(options.ui.colorClasses[cssClass]);
}
if (options.ui.showVerdictsInsideProgressBar) {
$verdict.css('white-space', 'nowrap');
}
$verdict.html(text);
};

@ -17,11 +17,11 @@ Encore
.autoProvidejQuery()
// read main.js -> output as public/build/chamilo.js
.addEntry('chamilo', './assets/js/main.js')
// read main.scss -> output as web/build/css/base.css
.addStyleEntry('css/base', './assets/css/main.scss')
.addStyleEntry('css/editor', './assets/css/editor.css')
.addStyleEntry('css/print', './assets/css/print.css')
.enableSourceMaps(!Encore.isProduction())
.autoProvideVariables({
$: 'jquery',
@ -62,7 +62,7 @@ var chamiloThemes = [
'tasty_olive',
];
// Add chamilo themes
// Add Chamilo themes
chamiloThemes.forEach(function (theme) {
Encore
.addStyleEntry('css/themes/'+theme+'/default', './assets/css/themes/'+theme+'/default.css')
@ -77,16 +77,4 @@ chamiloThemes.forEach(function (theme) {
});
var config = Encore.getWebpackConfig();
/*config.module.rules.push({
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: 'file-loader',
options: {
name: '[path][name].[ext]',
useRelativePath: true,
cssOutputPath: 'static/css'
}
});*/
module.exports = config;

@ -1050,10 +1050,6 @@ bootstrap-select@^1.12.4:
dependencies:
jquery ">=1.8"
bootstrap@>=2.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.0.0.tgz#ceb03842c145fcc1b9b4e15da2a05656ba68469a"
brace-expansion@^1.1.7:
version "1.1.11"
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
@ -3456,7 +3452,7 @@ jquery.scrollbar@^0.2.11:
version "0.2.11"
resolved "https://registry.yarnpkg.com/jquery.scrollbar/-/jquery.scrollbar-0.2.11.tgz#e91bd4a97d83859463024d26e730dc36676ab59d"
jquery@>=1.10, jquery@>=1.2.3, jquery@>=1.6.0, jquery@>=1.8, jquery@>=2.0.0, jquery@>=3.0.0, jquery@^3.0, jquery@^3.2.1:
jquery@>=1.10, jquery@>=1.2.3, jquery@>=1.6.0, jquery@>=1.8, jquery@>=2.0.0, jquery@^3.0, jquery@^3.2.1:
version "3.3.1"
resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.3.1.tgz#958ce29e81c9790f31be7792df5d4d95fc57fbca"
@ -4919,13 +4915,6 @@ punycode@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.0.tgz#5f863edc89b96db09074bad7947bf09056ca4e7d"
pwstrength-bootstrap@^2.1.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/pwstrength-bootstrap/-/pwstrength-bootstrap-2.2.1.tgz#67e72ae87c2e3bb9663962d5dad18da33275c89a"
dependencies:
bootstrap ">=2.0.0"
jquery ">=3.0.0"
q@^1.1.2:
version "1.5.1"
resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7"
@ -5996,7 +5985,7 @@ time-stamp@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/time-stamp/-/time-stamp-2.0.0.tgz#95c6a44530e15ba8d6f4a3ecb8c3a3fac46da357"
timeago@^1.6.1:
timeago@^1.6.3:
version "1.6.3"
resolved "https://registry.yarnpkg.com/timeago/-/timeago-1.6.3.tgz#162a1adae99356297df59339837d09f1b0f36465"
dependencies:

Loading…
Cancel
Save