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
ca122418
Commit
ca122418
authored
Feb 15, 2014
by
Johnny Theill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed minor consistency bugs in apps
* Added 'return' to goHome() calls in actions * Changed $_POST to Yii::$app->request->post()
parent
94576de9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
SiteController.php
apps/advanced/backend/controllers/SiteController.php
+2
-2
SiteController.php
apps/advanced/frontend/controllers/SiteController.php
+3
-3
SiteController.php
apps/basic/controllers/SiteController.php
+3
-3
No files found.
apps/advanced/backend/controllers/SiteController.php
View file @
ca122418
...
@@ -54,11 +54,11 @@ class SiteController extends Controller
...
@@ -54,11 +54,11 @@ class SiteController extends Controller
public
function
actionLogin
()
public
function
actionLogin
()
{
{
if
(
!
\Yii
::
$app
->
user
->
isGuest
)
{
if
(
!
\Yii
::
$app
->
user
->
isGuest
)
{
$this
->
goHome
();
return
$this
->
goHome
();
}
}
$model
=
new
LoginForm
();
$model
=
new
LoginForm
();
if
(
$model
->
load
(
$_POST
)
&&
$model
->
login
())
{
if
(
$model
->
load
(
Yii
::
$app
->
request
->
post
()
)
&&
$model
->
login
())
{
return
$this
->
goBack
();
return
$this
->
goBack
();
}
else
{
}
else
{
return
$this
->
render
(
'login'
,
[
return
$this
->
render
(
'login'
,
[
...
...
apps/advanced/frontend/controllers/SiteController.php
View file @
ca122418
...
@@ -65,7 +65,7 @@ class SiteController extends Controller
...
@@ -65,7 +65,7 @@ class SiteController extends Controller
public
function
actionLogin
()
public
function
actionLogin
()
{
{
if
(
!
\Yii
::
$app
->
user
->
isGuest
)
{
if
(
!
\Yii
::
$app
->
user
->
isGuest
)
{
$this
->
goHome
();
return
$this
->
goHome
();
}
}
$model
=
new
LoginForm
();
$model
=
new
LoginForm
();
...
@@ -87,7 +87,7 @@ class SiteController extends Controller
...
@@ -87,7 +87,7 @@ class SiteController extends Controller
public
function
actionContact
()
public
function
actionContact
()
{
{
$model
=
new
ContactForm
;
$model
=
new
ContactForm
;
if
(
$model
->
load
(
$_POST
)
&&
$model
->
contact
(
Yii
::
$app
->
params
[
'adminEmail'
]))
{
if
(
$model
->
load
(
Yii
::
$app
->
request
->
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.'
);
Yii
::
$app
->
session
->
setFlash
(
'success'
,
'Thank you for contacting us. We will respond to you as soon as possible.'
);
return
$this
->
refresh
();
return
$this
->
refresh
();
}
else
{
}
else
{
...
@@ -144,7 +144,7 @@ class SiteController extends Controller
...
@@ -144,7 +144,7 @@ class SiteController extends Controller
throw
new
BadRequestHttpException
(
$e
->
getMessage
());
throw
new
BadRequestHttpException
(
$e
->
getMessage
());
}
}
if
(
$model
->
load
(
$_POST
)
&&
$model
->
resetPassword
())
{
if
(
$model
->
load
(
Yii
::
$app
->
request
->
post
()
)
&&
$model
->
resetPassword
())
{
Yii
::
$app
->
getSession
()
->
setFlash
(
'success'
,
'New password was saved.'
);
Yii
::
$app
->
getSession
()
->
setFlash
(
'success'
,
'New password was saved.'
);
return
$this
->
goHome
();
return
$this
->
goHome
();
}
}
...
...
apps/basic/controllers/SiteController.php
View file @
ca122418
...
@@ -55,11 +55,11 @@ class SiteController extends Controller
...
@@ -55,11 +55,11 @@ class SiteController extends Controller
public
function
actionLogin
()
public
function
actionLogin
()
{
{
if
(
!
\Yii
::
$app
->
user
->
isGuest
)
{
if
(
!
\Yii
::
$app
->
user
->
isGuest
)
{
$this
->
goHome
();
return
$this
->
goHome
();
}
}
$model
=
new
LoginForm
();
$model
=
new
LoginForm
();
if
(
$model
->
load
(
$_POST
)
&&
$model
->
login
())
{
if
(
$model
->
load
(
Yii
::
$app
->
request
->
post
()
)
&&
$model
->
login
())
{
return
$this
->
goBack
();
return
$this
->
goBack
();
}
else
{
}
else
{
return
$this
->
render
(
'login'
,
[
return
$this
->
render
(
'login'
,
[
...
@@ -77,7 +77,7 @@ class SiteController extends Controller
...
@@ -77,7 +77,7 @@ class SiteController extends Controller
public
function
actionContact
()
public
function
actionContact
()
{
{
$model
=
new
ContactForm
;
$model
=
new
ContactForm
;
if
(
$model
->
load
(
$_POST
)
&&
$model
->
contact
(
Yii
::
$app
->
params
[
'adminEmail'
]))
{
if
(
$model
->
load
(
Yii
::
$app
->
request
->
post
()
)
&&
$model
->
contact
(
Yii
::
$app
->
params
[
'adminEmail'
]))
{
Yii
::
$app
->
session
->
setFlash
(
'contactFormSubmitted'
);
Yii
::
$app
->
session
->
setFlash
(
'contactFormSubmitted'
);
return
$this
->
refresh
();
return
$this
->
refresh
();
}
else
{
}
else
{
...
...
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