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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
yii2
Commits
6cac7c61
Commit
6cac7c61
authored
Feb 05, 2014
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed Yii::$app->getParam usage
parent
97917e65
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
3 deletions
+4
-3
params.php
apps/advanced/common/config/params.php
+1
-0
User.php
apps/advanced/common/models/User.php
+1
-1
SiteController.php
apps/advanced/frontend/controllers/SiteController.php
+1
-1
PasswordResetRequestForm.php
apps/advanced/frontend/models/PasswordResetRequestForm.php
+1
-1
No files found.
apps/advanced/common/config/params.php
View file @
6cac7c61
...
...
@@ -2,4 +2,5 @@
return
[
'adminEmail'
=>
'admin@example.com'
,
'supportEmail'
=>
'support@example.com'
,
'user.passwordResetTokenExpire'
=>
3600
,
];
apps/advanced/common/models/User.php
View file @
6cac7c61
...
...
@@ -82,7 +82,7 @@ class User extends ActiveRecord implements IdentityInterface
*/
public
static
function
findByPasswordResetToken
(
$token
)
{
$expire
=
\Yii
::
$app
->
getParam
(
'user.passwordResetTokenExpire'
,
3600
)
;
$expire
=
\Yii
::
$app
->
params
[
'user.passwordResetTokenExpire'
]
;
$parts
=
explode
(
'_'
,
$token
);
$timestamp
=
(
int
)
end
(
$parts
);
if
(
$timestamp
+
$expire
<
time
())
{
...
...
apps/advanced/frontend/controllers/SiteController.php
View file @
6cac7c61
...
...
@@ -87,7 +87,7 @@ class SiteController extends Controller
public
function
actionContact
()
{
$model
=
new
ContactForm
;
if
(
$model
->
load
(
$_POST
)
&&
$model
->
contact
(
Yii
::
$app
->
getParam
(
'adminEmail'
)
))
{
if
(
$model
->
load
(
$_POST
)
&&
$model
->
contact
(
Yii
::
$app
->
params
[
'adminEmail'
]
))
{
Yii
::
$app
->
session
->
setFlash
(
'success'
,
'Thank you for contacting us. We will respond to you as soon as possible.'
);
return
$this
->
refresh
();
}
else
{
...
...
apps/advanced/frontend/models/PasswordResetRequestForm.php
View file @
6cac7c61
...
...
@@ -43,7 +43,7 @@ class PasswordResetRequestForm extends Model
$user
->
generatePasswordResetToken
();
if
(
$user
->
save
())
{
return
\Yii
::
$app
->
mail
->
compose
(
'passwordResetToken'
,
[
'user'
=>
$user
])
->
setFrom
([
\Yii
::
$app
->
getParam
(
'supportEmail'
)
=>
\Yii
::
$app
->
name
.
' robot'
])
->
setFrom
([
\Yii
::
$app
->
params
[
'supportEmail'
]
=>
\Yii
::
$app
->
name
.
' robot'
])
->
setTo
(
$this
->
email
)
->
setSubject
(
'Password reset for '
.
\Yii
::
$app
->
name
)
->
send
();
...
...
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