Skip to content

Commit eaba5dd

Browse files
fix
1 parent 439325d commit eaba5dd

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

src/controllers/UserController.php

+20-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ class UserController extends ParentController
2323
{
2424
public $controller_id = 1001;
2525

26-
public $full_access_actions = ['login', 'logout', 'request-password-reset', 'reset-password', 'set-new-email', 'change-password'];
26+
public $full_access_actions = [
27+
'login', 'logout',
28+
'request-password-reset', 'reset-password', 'set-new-email', 'change-password',
29+
'profile'
30+
];
2731

2832
/**
2933
* Lists all User models.
@@ -232,7 +236,7 @@ public function actionSetNewEmail($username, $email, $key)
232236
*/
233237
public function actionChangePassword()
234238
{
235-
// not guest cannot change password
239+
// guest cannot change password
236240
if (Yii::$app->user->isGuest) {
237241
return $this->goHome();
238242
}
@@ -278,10 +282,24 @@ public function actionLogin()
278282
}
279283

280284
$model->password = '';
285+
281286
return $this->render('login', [
282287
'model' => $model,
283288
]);
284289
}
290+
291+
public function actionProfile()
292+
{
293+
294+
// guest cannot view profile
295+
if (Yii::$app->user->isGuest) {
296+
return $this->goHome();
297+
}
298+
299+
return $this->render('profile', [
300+
'model' => Yii::$app->user->identity,
301+
]);
302+
}
285303

286304
/**
287305
* Finds the User model based on its primary key value.

0 commit comments

Comments
 (0)