Skip to content

Commit

Permalink
Merge branch 'release/1.2.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
iMattPro committed Feb 7, 2020
2 parents 20ee39c + 3b8b8ad commit 758742f
Show file tree
Hide file tree
Showing 7 changed files with 95 additions and 58 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ Try it out yourself here: ([Online Demo](http://vsephpbb.github.io/passwordstren
* Featured MOD of the Week in the phpBB Weekly Podcast, episode #166.

## Minimum Requirements
* phpBB 3.1.0 or phpBB 3.2.0
* phpBB 3.1.0
* phpBB 3.2.0
* phpBB 3.3.0
* PHP 5.3.3

## Install
Expand All @@ -42,4 +44,4 @@ Password Strength is intended to encourage your forum users to use strong passwo
## License
[GNU General Public License v2](http://opensource.org/licenses/GPL-2.0)

© 2013 - Matt Friedman (VSE)
© 2013 - Matt Friedman
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"type": "phpbb-extension",
"description": "An extension for phpBB that will show users how strong (or weak) their password is as they type it into the password field when creating or updating their account.",
"homepage": "https://github.com/VSEphpbb/passwordstrength",
"version": "1.2.2",
"version": "1.2.3",
"keywords": ["phpbb", "extension", "password", "strength", "zxcvbn"],
"license": "GPL-2.0",
"license": "GPL-2.0-only",
"authors": [
{
"name": "Matt Friedman (VSE)",
"homepage": "http://mattfriedman.me",
"name": "Matt Friedman",
"homepage": "http://vsephpbb.github.io",
"role": "Developer"
}
],
Expand Down
28 changes: 3 additions & 25 deletions event/listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ public function password_strength_acp_options($event)
'lang' => 'PASSWORD_STRENGTH_TYPE',
'validate' => 'int',
'type' => 'select',
'function' => array($this, 'select_password_strength'),
'explain' => true
'function' => 'build_select',
'params' => array(array(0 => 'PASSWORD_STRENGTH_TYPE_COMPLEX', 1 => 'PASSWORD_STRENGTH_TYPE_ZXCVBN'), '{CONFIG_VALUE}'),
'explain' => true,
),
);

Expand All @@ -98,27 +99,4 @@ public function password_strength_acp_options($event)
$event['display_vars'] = $display_vars;
}
}

/**
* Select Password Strength type
*
* @param string $selected_value
* @param string $key
* @return string
*/
public function select_password_strength($selected_value, $key = '')
{
$pws_type_ary = array(
0 => 'PASSWORD_STRENGTH_TYPE_COMPLEX',
1 => 'PASSWORD_STRENGTH_TYPE_ZXCVBN'
);
$pass_char_options = '';
foreach ($pws_type_ary as $pws_id => $pws_type)
{
$selected = ($selected_value == $pws_id) ? ' selected="selected"' : '';
$pass_char_options .= '<option value="' . $pws_id . '"' . $selected . '>' . $this->user->lang($pws_type) . '</option>';
}

return $pass_char_options;
}
}
41 changes: 41 additions & 0 deletions language/he/acp_passwordstrength.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php
/**
*
* Password Strength [Hebrew]
*
* @copyright (c) 2016 Matt Friedman
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/

/**
* DO NOT CHANGE
*/
if (!defined('IN_PHPBB'))
{
exit;
}

if (empty($lang) || !is_array($lang))
{
$lang = array();
}

// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct
//
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
// equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine

$lang = array_merge($lang, array(
'PASSWORD_STRENGTH_TYPE' => 'אלגוריתם חוזק הסיסמה',
'PASSWORD_STRENGTH_TYPE_EXPLAIN' => 'בחר אלגוריתם לקביעת חוזק סיסמה.<br/><strong>מורכבות</strong> מחפש תווים מעורבים מספרים וסמלים אורך סיסמה ומעודדת סיסמאות מורכבות.<br/><strong>אלגוריתם zxcvbn</strong> (מאת DropBox) מחשב כמה קלה הסיסמה שניתנת לניחוש, ומאפשר בכך סיסמאות חזקות וידידותיות למשתמש.',
'PASSWORD_STRENGTH_TYPE_COMPLEX' => 'מורכבות',
'PASSWORD_STRENGTH_TYPE_ZXCVBN' => 'אלגוריתם zxcvbn',
));
42 changes: 42 additions & 0 deletions language/he/passwordstrength.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php
/**
*
* Password Strength [Hebrew]
*
* @copyright (c) 2013 Matt Friedman
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/

/**
* DO NOT CHANGE
*/
if (!defined('IN_PHPBB'))
{
exit;
}

if (empty($lang) || !is_array($lang))
{
$lang = array();
}

// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct
//
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
// equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine

$lang = array_merge($lang, array(
'PS_VERY_WEAK' => 'סיסמה חלשה מאד',
'PS_WEAK' => 'סיסמה חלשה',
'PS_GOOD' => 'סיסמה טובה',
'PS_STRONG' => 'סיסמה חזקה',
'PS_VERY_STRONG' => 'סיסמה חזקה מאד',
));
2 changes: 1 addition & 1 deletion styles/all/template/password_strength.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
{%- endif -%}
showStrength($passField, score);
}
$passField.bind('keyup blur', trigger).after($resultMsg);
$passField.on('keyup blur', trigger).after($resultMsg);
});
};
{% if S_USE_ZXCVBN %}
Expand Down
26 changes: 0 additions & 26 deletions tests/event/listener_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,30 +164,4 @@ public function test_password_strength_acp_options($mode, $display_vars, $expect

$this->assertEquals($expected_keys, $keys);
}

public function select_password_strength_test_data()
{
return array(
array('', '<option value="0" selected="selected">PASSWORD_STRENGTH_TYPE_COMPLEX</option><option value="1">PASSWORD_STRENGTH_TYPE_ZXCVBN</option>'),
array('0', '<option value="0" selected="selected">PASSWORD_STRENGTH_TYPE_COMPLEX</option><option value="1">PASSWORD_STRENGTH_TYPE_ZXCVBN</option>'),
array('1', '<option value="0">PASSWORD_STRENGTH_TYPE_COMPLEX</option><option value="1" selected="selected">PASSWORD_STRENGTH_TYPE_ZXCVBN</option>'),
array('10', '<option value="0">PASSWORD_STRENGTH_TYPE_COMPLEX</option><option value="1">PASSWORD_STRENGTH_TYPE_ZXCVBN</option>'),
);
}

/**
* @dataProvider select_password_strength_test_data
*/
public function test_select_password_strength($selected, $expected)
{
$this->user->expects($this->any())
->method('lang')
->will($this->returnArgument(0));

$this->set_listener();

$html = $this->listener->select_password_strength($selected);

$this->assertEquals($expected, $html);
}
}

0 comments on commit 758742f

Please sign in to comment.