Skip to content

Commit

Permalink
Revert "Dgt41 Password strength indication - Fixes #8513" (#10310)
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonge committed May 8, 2016
1 parent 9e71b85 commit c14cd55
Show file tree
Hide file tree
Showing 15 changed files with 25 additions and 902 deletions.
2 changes: 0 additions & 2 deletions administrator/components/com_users/models/forms/user.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
validate="password"
label="JGLOBAL_PASSWORD"
size="30"
strengthmeter="true"
username="username"
/>

<field name="password2" type="password"
Expand Down
11 changes: 0 additions & 11 deletions administrator/language/en-GB/en-GB.ini
Original file line number Diff line number Diff line change
Expand Up @@ -224,17 +224,6 @@ JFIELD_OPTION_NONE="None"
JFIELD_ORDERING_DESC="Select the ordering."
JFIELD_ORDERING_LABEL="Ordering"
JFIELD_PARAMS_LABEL="Options"
JFIELD_PASSWORD_INDICATE_CHARCLASS="Use different character classes"
JFIELD_PASSWORD_INDICATE_LENGTH="Your password is too short"
JFIELD_PASSWORD_INDICATE_NOEMAIL="Do not use your email as your password"
JFIELD_PASSWORD_INDICATE_NORMAL="Normal"
JFIELD_PASSWORD_INDICATE_MEDIUM="Medium"
JFIELD_PASSWORD_INDICATE_STRONG="Strong"
JFIELD_PASSWORD_INDICATE_VSTRONG="Very strong"
JFIELD_PASSWORD_INDICATE_USERNAME="Your password should not contain your username"
JFIELD_PASSWORD_INDICATE_WEAK="Weak"
JFIELD_PASSWORD_INDICATE_WORDREP="Too many repetitions"
JFIELD_PASSWORD_INDICATE_WORDSEQ="Your password contains sequences"
JFIELD_PLG_SEARCH_ALL_DESC="Indicate whether to include published items in the search."
JFIELD_PLG_SEARCH_ALL_LABEL="Search Published"
JFIELD_PLG_SEARCH_ARCHIVED_DESC="Indicate whether to include archived items in the search."
Expand Down
4 changes: 0 additions & 4 deletions administrator/templates/hathor/css/template.css
Original file line number Diff line number Diff line change
Expand Up @@ -3796,7 +3796,3 @@ div.toggle-editor {
.muted {
color: #999;
}
.controls .progress {
margin-top: 7px;
width: 220px;
}
6 changes: 0 additions & 6 deletions administrator/templates/hathor/less/template.less
Original file line number Diff line number Diff line change
Expand Up @@ -3531,9 +3531,3 @@ div.toggle-editor {
.muted {
color: #999;
}

/* Password strength indicator */
.controls .progress {
margin-top: 7px;
width: 220px;
}
7 changes: 0 additions & 7 deletions administrator/templates/isis/css/template-rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -8198,16 +8198,9 @@ body.modal-open {
.js-pstats-data-details dt {
width: 220px;
}
.modal-footer {
clear : both;
}
.modal-footer {
clear: both;
}
.controls .progress {
margin-top: 7px;
width: 220px;
}
.pull-right {
float: left;
}
Expand Down
4 changes: 0 additions & 4 deletions administrator/templates/isis/css/template.css
Original file line number Diff line number Diff line change
Expand Up @@ -8201,7 +8201,3 @@ body.modal-open {
.modal-footer {
clear: both;
}
.controls .progress {
margin-top: 7px;
width: 220px;
}
7 changes: 0 additions & 7 deletions administrator/templates/isis/less/template.less
Original file line number Diff line number Diff line change
Expand Up @@ -1358,10 +1358,3 @@ body.modal-open {
.modal-footer {
clear: both;
}

/* Password strength indicator */
.controls .progress {
margin-top: 7px;
width: 220px;
}

38 changes: 0 additions & 38 deletions installation/form/field/password.php

This file was deleted.

14 changes: 0 additions & 14 deletions installation/language/en-GB/en-GB.ini
Original file line number Diff line number Diff line change
Expand Up @@ -323,17 +323,3 @@ POSTGRESQL="PostgreSQL"
SQLAZURE="Microsoft SQL Azure"
SQLITE="SQLite"
SQLSRV="Microsoft SQL Server"


; Password strength
JFIELD_PASSWORD_INDICATE_CHARCLASS="Use different character classes"
JFIELD_PASSWORD_INDICATE_LENGTH="Your password is too short"
JFIELD_PASSWORD_INDICATE_NOEMAIL="Do not use your email as your password"
JFIELD_PASSWORD_INDICATE_NORMAL="Normal"
JFIELD_PASSWORD_INDICATE_MEDIUM="Medium"
JFIELD_PASSWORD_INDICATE_STRONG="Strong"
JFIELD_PASSWORD_INDICATE_VSTRONG="Very strong"
JFIELD_PASSWORD_INDICATE_USERNAME="Your password should not contain your username"
JFIELD_PASSWORD_INDICATE_WEAK="Weak"
JFIELD_PASSWORD_INDICATE_WORDREP="Too many repetitions"
JFIELD_PASSWORD_INDICATE_WORDSEQ="Your password contains sequences"
6 changes: 2 additions & 4 deletions installation/model/forms/site.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,14 @@
required="true"
/>

<field name="admin_password" type="installation.password" id="admin_password" class="inputbox"
<field name="admin_password" type="password" id="admin_password" class="inputbox"
label="INSTL_ADMIN_PASSWORD_LABEL"
required="true"
filter="raw"
autocomplete="off"
strengthmeter="true"
username="admin_user"
/>

<field name="admin_password2" type="installation.password" id="admin_password2" class="inputbox"
<field name="admin_password2" type="password" id="admin_password2" class="inputbox"
label="INSTL_ADMIN_PASSWORD2_LABEL"
required="true"
filter="raw"
Expand Down
19 changes: 1 addition & 18 deletions installation/template/css/template.css
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
/* CSS Document */
.spinner{
background: -moz-radial-gradient(center, ellipse cover, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%); /* FF3.6+ */
background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%,rgba(255,255,255,1)), color-stop(100%,rgba(255,255,255,0))); /* Chrome,Safari4+ */
background: -webkit-radial-gradient(center, ellipse cover, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%); /* Chrome10+,Safari5.1+ */
background: -o-radial-gradient(center, ellipse cover, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%); /* Opera 12+ */
background: -ms-radial-gradient(center, ellipse cover, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%); /* IE10+ */
background: radial-gradient(ellipse at center, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#00ffffff',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
}
.spinner-img{
background: url('../images/ajax-loader.gif') no-repeat 50% 50%;
height: 15px;
width: 128px;
}
.container{
position: relative;
max-width: 900px;
Expand Down Expand Up @@ -140,6 +126,7 @@ textarea.noResize {
.tooltip {
white-space: pre-wrap;
}

#loading {
position: absolute;
display: none;
Expand All @@ -153,7 +140,3 @@ textarea.noResize {
filter: alpha(opacity = 95);
background: url('../../../media/jui/images/ajax-loader.gif') rgba(255,255,255,0.7) center no-repeat;
}
.controls .progress {
margin-top: 7px;
width: 220px;
}
11 changes: 0 additions & 11 deletions language/en-GB/en-GB.ini
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,6 @@ JFIELD_META_RIGHTS_DESC="Describe what rights others have to use this content."
JFIELD_META_RIGHTS_LABEL="Content Rights"
JFIELD_ORDERING_DESC="Ordering of the article within the category."
JFIELD_ORDERING_LABEL="Ordering"
JFIELD_PASSWORD_INDICATE_CHARCLASS="Use different character classes"
JFIELD_PASSWORD_INDICATE_LENGTH="Your password is too short"
JFIELD_PASSWORD_INDICATE_NOEMAIL="Do not use your email as your password"
JFIELD_PASSWORD_INDICATE_NORMAL="Normal"
JFIELD_PASSWORD_INDICATE_MEDIUM="Medium"
JFIELD_PASSWORD_INDICATE_STRONG="Strong"
JFIELD_PASSWORD_INDICATE_VSTRONG="Very strong"
JFIELD_PASSWORD_INDICATE_USERNAME="Your password should not contain your username"
JFIELD_PASSWORD_INDICATE_WEAK="Weak"
JFIELD_PASSWORD_INDICATE_WORDREP="Too many repetitions"
JFIELD_PASSWORD_INDICATE_WORDSEQ="Your password contains sequences"
JFIELD_PUBLISHED_DESC="Set publication status."
JFIELD_TITLE_DESC="Title for the article."

Expand Down
87 changes: 22 additions & 65 deletions libraries/joomla/form/fields/password.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,6 @@ class JFormFieldPassword extends JFormField
*/
protected $maxLength;

/**
* The allowable minlength of password.
*
* @var integer
* @since 3.5
*/
protected $minLength;

/**
* The linked username field.
*
* @var string
* @since 3.5
*/
protected $username;

/**
* Whether to attach a password strength meter or not.
*
Expand All @@ -83,8 +67,6 @@ public function __get($name)
case 'threshold':
case 'maxLength':
case 'meter':
case 'username':
case 'minlength':
return $this->$name;
}

Expand All @@ -109,7 +91,6 @@ public function __set($name, $value)
{
case 'maxLength':
case 'threshold':
case 'username':
$this->$name = $value;
break;

Expand Down Expand Up @@ -144,8 +125,9 @@ public function setup(SimpleXMLElement $element, $value, $group = null)
{
$this->maxLength = $this->element['maxlength'] ? (int) $this->element['maxlength'] : 99;
$this->threshold = $this->element['threshold'] ? (int) $this->element['threshold'] : 66;
$meter = (string) $this->element['strengthmeter'];
$this->meter = ($meter == 'true' || $meter == 'on' || $meter == '1');

$meter = (string) $this->element['strengthmeter'];
$this->meter = ($meter == 'true' || $meter == 'on' || $meter == '1');
}

return $return;
Expand All @@ -164,56 +146,31 @@ protected function getInput()
$hint = $this->translateHint ? JText::_($this->hint) : $this->hint;

// Initialize some field attributes.
$size = !empty($this->size) ? ' size="' . $this->size . '"' : '';
$maxLength = !empty($this->maxLength) ? ' maxlength="' . $this->maxLength . '"' : '';
$class = !empty($this->class) ? ' class="' . $this->class . '"' : '';
$readonly = $this->readonly ? ' readonly' : '';
$disabled = $this->disabled ? ' disabled' : '';
$required = $this->required ? ' required aria-required="true"' : '';
$hint = $hint ? ' placeholder="' . $hint . '"' : '';
$autocomplete = !$this->autocomplete ? ' autocomplete="off"' : '';
$autofocus = $this->autofocus ? ' autofocus' : '';
$this->username = $this->element['username'] ? 'options.common.usernameField = "#jform_' . $this->element['username'] . '";' : '';

if (!$this->minLength)
{
$this->minLength = (int) JComponentHelper::getParams('com_users')->get('minimum_length', 4);
}
$size = !empty($this->size) ? ' size="' . $this->size . '"' : '';
$maxLength = !empty($this->maxLength) ? ' maxlength="' . $this->maxLength . '"' : '';
$class = !empty($this->class) ? ' class="' . $this->class . '"' : '';
$readonly = $this->readonly ? ' readonly' : '';
$disabled = $this->disabled ? ' disabled' : '';
$required = $this->required ? ' required aria-required="true"' : '';
$hint = $hint ? ' placeholder="' . $hint . '"' : '';
$autocomplete = !$this->autocomplete ? ' autocomplete="off"' : '';
$autofocus = $this->autofocus ? ' autofocus' : '';

if ($this->meter)
{
JHtml::_('script', 'jui/pwstrength-bootstrap-1.2.9.min.js', false, true, false, false, true);
JHtml::_('script', 'system/passwordstrength.js', true, true);
$script = 'new Form.PasswordStrength("' . $this->id . '",
{
threshold: ' . $this->threshold . ',
onUpdate: function(element, strength, threshold) {
element.set("data-passwordstrength", strength);
}
}
);';

// Load script on document load.
JFactory::getDocument()->addScriptDeclaration(
"
jQuery(document).ready(function($){
'use strict';
var options = {};
options.common = {};
" . $this->username . "
options.common.minChar = " . $this->minLength . "
options.ui = {
bootstrap2: true,
showErrors: true,
};
options.ui.verdicts = [
'" . JText::_('JFIELD_PASSWORD_INDICATE_WEAK') . "',
'" . JText::_('JFIELD_PASSWORD_INDICATE_NORMAL') . "',
'" . JText::_('JFIELD_PASSWORD_INDICATE_MEDIUM') . "',
'" . JText::_('JFIELD_PASSWORD_INDICATE_STRONG') . "',
'" . JText::_('JFIELD_PASSWORD_INDICATE_VSTRONG') . "'];
options.ui.errorMessages = {
wordLength: '" . JText::_('JFIELD_PASSWORD_INDICATE_LENGTH') . "',
wordNotEmail: '" . JText::_('JFIELD_PASSWORD_INDICATE_NOEMAIL') . "',
wordSimilarToUsername: '" . JText::_('JFIELD_PASSWORD_INDICATE_USERNAME') . "',
wordTwoCharacterClasses: '" . JText::_('JFIELD_PASSWORD_INDICATE_CHARCLASS') . "',
wordRepetitions: '" . JText::_('JFIELD_PASSWORD_INDICATE_WORDREP') . "',
wordSequences: '" . JText::_('JFIELD_PASSWORD_INDICATE_WORDSEQ') . "'
};
jQuery('#" . $this->id . "').pwstrength(options);
});
"
"jQuery(document).ready(function(){" . $script . "});"
);
}

Expand Down

0 comments on commit c14cd55

Please sign in to comment.