Version 4.3.0
This commit is contained in:
1 parent
96997ddd8e
commit
fe1acf984a
1349 files changed
+116159
-67711
No files matched your search
@@ -26,7 +26,7 @@ class _Password extends Text
|
||||
* @brief Default Options
|
||||
* @code
|
||||
$childDefaultOptions = array(
|
||||
'validateFor' => \IPS\Member::loggedIn(), // If an \IPS\Member object is provided, the password will be checked if it is valid for that account. Default is NULL.
|
||||
'validateFor' => \IPS\Member::loggedIn(), // If an \IPS\Member object is provided, the password will be checked if it is valid for that account. Default is NULL. Note that it is possible a user may not have any available password-based login handler, so this should only be used when *changing* a password.
|
||||
'confirm' => 'password1', // If the name of another element in the form is provided, will check is the values match. Default is NULL.
|
||||
'showMeter' => FALSE, // Show a "strength" meter
|
||||
'minimumStrength => 3 // If a strength is provided validation will fail for any lesser value.
|
||||
@@ -50,7 +50,7 @@ class _Password extends Text
|
||||
{
|
||||
$value = parent::getValue();
|
||||
|
||||
if ( $value === '********' )
|
||||
if ( $value === '********' and $this->defaultValue )
|
||||
{
|
||||
$value = $this->defaultValue;
|
||||
}
|
||||
@@ -93,25 +93,13 @@ class _Password extends Text
|
||||
{
|
||||
$valid = FALSE;
|
||||
|
||||
foreach( \IPS\Login::handlers( TRUE ) as $k => $handler )
|
||||
$login = new \IPS\Login();
|
||||
foreach ( $login->usernamePasswordMethods() as $method )
|
||||
{
|
||||
if ( $handler->authTypes & \IPS\Login::AUTH_TYPE_USERNAME )
|
||||
if ( $method->authenticatePasswordForMember( $this->options['validateFor'], $this->value ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
$handler->authenticate( array( 'auth' => $this->options['validateFor']->name, 'password' => $this->value ) );
|
||||
$valid = TRUE;
|
||||
}
|
||||
catch ( \Exception $e ) {}
|
||||
}
|
||||
if ( $handler->authTypes & \IPS\Login::AUTH_TYPE_EMAIL )
|
||||
{
|
||||
try
|
||||
{
|
||||
$handler->authenticate( array( 'auth' => $this->options['validateFor']->email, 'password' => $this->value ) );
|
||||
$valid = TRUE;
|
||||
}
|
||||
catch ( \Exception $e ) {}
|
||||
$valid = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,7 +136,7 @@ class _Password extends Text
|
||||
{
|
||||
foreach( $this->value as $key => $value )
|
||||
{
|
||||
$this->value[ $key ] = htmlspecialchars( $value, ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE );
|
||||
$this->value[ $key ] = htmlspecialchars( $value, ENT_QUOTES | ENT_DISALLOWED, 'UTF-8', FALSE );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user