summaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorMorris Jobke <morris.jobke@gmail.com>2013-03-13 11:03:52 +0100
committerMorris Jobke <morris.jobke@gmail.com>2014-01-15 11:10:12 +0100
commit5c1a9f35f16a8a871bcef24a45478ac92af9a9e1 (patch)
tree040662a510f5466a0b9275fee9724e605e17f4ee /settings
parent34559ef11428c9a2a1b83f8a63d650d1fa0be49e (diff)
downloadnextcloud-server-5c1a9f35f16a8a871bcef24a45478ac92af9a9e1.tar.gz
nextcloud-server-5c1a9f35f16a8a871bcef24a45478ac92af9a9e1.zip
Indicate password strength using strengthify
* uses zxcvbn * outsourced to separate jquery plugin * async loading * hide strength meter if input is empty * feedback if user enters weakest password * fade in and out * show tipsy with strength * Opera 12, IE8-10, FF 23, Chromium 29
Diffstat (limited to 'settings')
-rw-r--r--settings/css/settings.css13
-rw-r--r--settings/js/personal.js12
-rw-r--r--settings/personal.php4
-rw-r--r--settings/templates/personal.php2
4 files changed, 31 insertions, 0 deletions
diff --git a/settings/css/settings.css b/settings/css/settings.css
index 2e464c3f110..a93c675d466 100644
--- a/settings/css/settings.css
+++ b/settings/css/settings.css
@@ -147,3 +147,16 @@ table.shareAPI td { padding-bottom: 0.8em; }
/* HELP */
.pressed {background-color:#DDD;}
+/* PASSWORD */
+.strengthify-wrapper {
+ position: absolute;
+ left: 189px;
+ width: 131px;
+ margin-top: -7px;
+}
+
+/* OPERA hack for strengthify*/
+doesnotexist:-o-prefocus, .strengthify-wrapper {
+ left: 185px;
+ width: 129px;
+}
diff --git a/settings/js/personal.js b/settings/js/personal.js
index 2934677f256..591eb8abe2e 100644
--- a/settings/js/personal.js
+++ b/settings/js/personal.js
@@ -1,5 +1,6 @@
/**
* Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
+ * 2013, Morris Jobke <morris.jobke@gmail.com>
* This file is licensed under the Affero General Public License version 3 or later.
* See the COPYING-README file.
*/
@@ -243,6 +244,17 @@ $(document).ready(function(){
$('#sendcropperbutton').click(function(){
sendCropData();
});
+
+ $('#pass2').strengthify({
+ zxcvbn: OC.linkTo('3rdparty','zxcvbn/js/zxcvbn.js'),
+ titles: [
+ t('core', 'Very weak password'),
+ t('core', 'Weak password'),
+ t('core', 'So-so password'),
+ t('core', 'Good password'),
+ t('core', 'Strong password')
+ ]
+ });
} );
OC.Encryption = {
diff --git a/settings/personal.php b/settings/personal.php
index 44e1048941b..cf1a496bdf0 100644
--- a/settings/personal.php
+++ b/settings/personal.php
@@ -13,6 +13,8 @@ $defaults = new OC_Defaults(); // initialize themable default strings and urls
// Highlight navigation entry
OC_Util::addScript( 'settings', 'personal' );
OC_Util::addStyle( 'settings', 'settings' );
+OC_Util::addScript( '3rdparty', 'strengthify/jquery.strengthify' );
+OC_Util::addStyle( '3rdparty', 'strengthify/strengthify' );
OC_Util::addScript( '3rdparty', 'chosen/chosen.jquery.min' );
OC_Util::addStyle( '3rdparty', 'chosen' );
\OC_Util::addScript('files', 'jquery.fileupload');
@@ -20,6 +22,8 @@ if (\OC_Config::getValue('enable_avatars', true) === true) {
\OC_Util::addScript('3rdparty/Jcrop', 'jquery.Jcrop.min');
\OC_Util::addStyle('3rdparty/Jcrop', 'jquery.Jcrop.min');
}
+
+// Highlight navigation entry
OC_App::setActiveNavigationEntry( 'personal' );
$storageInfo=OC_Helper::getStorageInfo('/');
diff --git a/settings/templates/personal.php b/settings/templates/personal.php
index 3eb864655bb..1518b48b979 100644
--- a/settings/templates/personal.php
+++ b/settings/templates/personal.php
@@ -44,6 +44,8 @@ if($_['passwordChangeSupported']) {
placeholder="<?php echo $l->t('New password');?>" data-typetoggle="#personal-show" />
<input type="checkbox" id="personal-show" name="show" /><label for="personal-show"></label>
<input id="passwordbutton" type="submit" value="<?php echo $l->t('Change password');?>" />
+ <br/>
+ <div class="strengthify-wrapper"></div>
</fieldset>
</form>
<?php