|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* _ __ __ _____ _____ ___ ____ _____ |
|
5
|
|
|
* | | / // // ___//_ _// || __||_ _| |
|
6
|
|
|
* | |/ // /(__ ) / / / /| || | | | |
|
7
|
|
|
* |___//_//____/ /_/ /_/ |_||_| |_| |
|
8
|
|
|
* @link https://vistart.me/ |
|
9
|
|
|
* @copyright Copyright (c) 2016 - 2017 vistart |
|
10
|
|
|
* @license https://vistart.me/license/ |
|
11
|
|
|
*/ |
|
12
|
|
|
use rhosocial\user\User; |
|
13
|
|
|
use rhosocial\user\Profile; |
|
14
|
|
|
use yii\helpers\Html; |
|
15
|
|
|
use yii\widgets\DetailView; |
|
16
|
|
|
/* @var $this yii\web\View */ |
|
17
|
|
|
/* @var $user User */ |
|
18
|
|
|
$this->title = Yii::t('user', 'View User') . ' (' . $user->getID() . ')'; |
|
19
|
|
|
$this->params['breadcrumbs'][] = Yii::t('user', 'View User'); |
|
20
|
|
|
echo DetailView::widget([ |
|
21
|
|
|
'model' => $user, |
|
22
|
|
|
'attributes' => [ |
|
23
|
|
|
// 'GUID' => 'readableGUID', // The GUID is not displayed by default. |
|
24
|
|
|
'ID' => $user->idAttribute, |
|
25
|
|
|
// 'Password Hash' => $user->passwordHashAttribute, // The Password Hash is not displayed by default. |
|
26
|
|
|
'IP' => [ |
|
27
|
|
|
'attribute' => 'ipAddress', |
|
28
|
|
|
'label' => Yii::t('user', 'IP Address'), |
|
29
|
|
|
], |
|
30
|
|
|
'IP Type' => $user->ipTypeAttribute, |
|
31
|
|
|
'created_at' => [ |
|
32
|
|
|
'attribute' => $user->createdAtAttribute, |
|
33
|
|
|
'format' => 'datetime', |
|
34
|
|
|
], |
|
35
|
|
|
'updated_at' => [ |
|
36
|
|
|
'attribute' => $user->updatedAtAttribute, |
|
37
|
|
|
'format' => 'datetime', |
|
38
|
|
|
], |
|
39
|
|
|
'Authentication Key' => $user->authKeyAttribute, |
|
40
|
|
|
'Access Token' => $user->accessTokenAttribute, |
|
41
|
|
|
'Password Reset Token' => $user->passwordResetTokenAttribute, |
|
42
|
|
|
'Status' => $user->statusAttribute, |
|
43
|
|
|
'Type' => 'type', |
|
44
|
|
|
'Source' => $user->sourceAttribute, |
|
45
|
|
|
], |
|
46
|
|
|
]); |
|
47
|
|
|
|
|
48
|
|
|
if (class_exists($user->profileClass) && ($profile = $user->profile)) { |
|
49
|
|
|
/* @var $profile Profile */ |
|
50
|
|
|
echo DetailView::widget([ |
|
51
|
|
|
'model' => $profile, |
|
52
|
|
|
'attributes' => [ |
|
53
|
|
|
'nickname' => $profile->contentAttribute, |
|
54
|
|
|
'first_name' => 'first_name', |
|
55
|
|
|
'last_name' => 'last_name', |
|
56
|
|
|
'gender' => [ |
|
57
|
|
|
'attribute' => 'gender', |
|
58
|
|
|
'label' => Yii::t('user', 'Gender'), |
|
59
|
|
|
'value' => function ($model, $widget) { |
|
|
|
|
|
|
60
|
|
|
/* @var $model Profile */ |
|
61
|
|
|
/* @var $widget DetailView */ |
|
62
|
|
|
return $model->getGenderDesc($model->gender); |
|
63
|
|
|
}, |
|
64
|
|
|
], |
|
65
|
|
|
'gravatar_type' => 'gravatar_type', |
|
66
|
|
|
'gravatar' => 'gravatar', |
|
67
|
|
|
'timezone' => 'timezone', |
|
68
|
|
|
'individual_sign' => 'individual_sign', |
|
69
|
|
|
'created_at' => [ |
|
70
|
|
|
'attribute' => $profile->createdAtAttribute, |
|
71
|
|
|
'format' => 'datetime', |
|
72
|
|
|
], |
|
73
|
|
|
'updated_at' => [ |
|
74
|
|
|
'attribute' => $profile->updatedAtAttribute, |
|
75
|
|
|
'format' => 'datetime', |
|
76
|
|
|
], |
|
77
|
|
|
], |
|
78
|
|
|
]); |
|
79
|
|
|
}?> |
|
80
|
|
|
<h3><?= Yii::t('user', 'Other operations') ?></h3> |
|
81
|
|
|
<div class="row"> |
|
82
|
|
|
<div class="col-md-3"> |
|
83
|
|
|
<?= Html::a(Yii::t('user', 'Back to User List'), [ |
|
84
|
|
|
'index', |
|
85
|
|
|
], ['class' => 'btn btn-primary']) ?> |
|
86
|
|
|
</div> |
|
87
|
|
|
</div> |
|
88
|
|
|
|
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.