Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
09fc0c3c
Commit
09fc0c3c
authored
Jul 31, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4539 from mickgeek/master
Fix signature validation
parents
11f8a2d1
017572d8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
LoginForm.php
apps/advanced/common/models/LoginForm.php
+5
-2
LoginForm.php
apps/basic/models/LoginForm.php
+5
-2
No files found.
apps/advanced/common/models/LoginForm.php
View file @
09fc0c3c
...
@@ -33,13 +33,16 @@ class LoginForm extends Model
...
@@ -33,13 +33,16 @@ class LoginForm extends Model
/**
/**
* Validates the password.
* Validates the password.
* This method serves as the inline validation for password.
* This method serves as the inline validation for password.
*
* @param string $attribute the attribute currently being validated
* @param array $params the additional name-value pairs given in the rule
*/
*/
public
function
validatePassword
()
public
function
validatePassword
(
$attribute
,
$params
)
{
{
if
(
!
$this
->
hasErrors
())
{
if
(
!
$this
->
hasErrors
())
{
$user
=
$this
->
getUser
();
$user
=
$this
->
getUser
();
if
(
!
$user
||
!
$user
->
validatePassword
(
$this
->
password
))
{
if
(
!
$user
||
!
$user
->
validatePassword
(
$this
->
password
))
{
$this
->
addError
(
'password'
,
'Incorrect username or password.'
);
$this
->
addError
(
$attribute
,
'Incorrect username or password.'
);
}
}
}
}
}
}
...
...
apps/basic/models/LoginForm.php
View file @
09fc0c3c
...
@@ -34,14 +34,17 @@ class LoginForm extends Model
...
@@ -34,14 +34,17 @@ class LoginForm extends Model
/**
/**
* Validates the password.
* Validates the password.
* This method serves as the inline validation for password.
* This method serves as the inline validation for password.
*
* @param string $attribute the attribute currently being validated
* @param array $params the additional name-value pairs given in the rule
*/
*/
public
function
validatePassword
()
public
function
validatePassword
(
$attribute
,
$params
)
{
{
if
(
!
$this
->
hasErrors
())
{
if
(
!
$this
->
hasErrors
())
{
$user
=
$this
->
getUser
();
$user
=
$this
->
getUser
();
if
(
!
$user
||
!
$user
->
validatePassword
(
$this
->
password
))
{
if
(
!
$user
||
!
$user
->
validatePassword
(
$this
->
password
))
{
$this
->
addError
(
'password'
,
'Incorrect username or password.'
);
$this
->
addError
(
$attribute
,
'Incorrect username or password.'
);
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment