Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ffd7806

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 955fe1c + 73e1c3b commit ffd7806

23 files changed

+639
-109
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
# CHANGELOG
22

3+
- Fix: Update last_login_at when successfully logged in over oauth(#899)
4+
35
## 0.9.12 [11 January 2017]
46

57
- Fix: Fixed migrations (dmeroff)
68
- Fix #832: Fixed admin view file (thyseus)
9+
- Enh #839: Order by most recent registration first (created_at DESC) by default (thyseus)
710

811
## 0.9.11 [10 January 2017]
912

Mailer.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ class Mailer extends Component
2929
/** @var string|array Default: `Yii::$app->params['adminEmail']` OR `[email protected]` */
3030
public $sender;
3131

32+
/** @var \yii\mail\BaseMailer Default: `Yii::$app->mailer` */
33+
public $mailerComponent;
34+
3235
/** @var string */
3336
protected $welcomeSubject;
3437

@@ -261,8 +264,7 @@ public function sendRecoveryMessage(User $user, Token $token)
261264
*/
262265
protected function sendMessage($to, $subject, $view, $params = [])
263266
{
264-
/** @var \yii\mail\BaseMailer $mailer */
265-
$mailer = Yii::$app->mailer;
267+
$mailer = $this->mailerComponent === null ? Yii::$app->mailer : Yii::$app->get($this->mailerComponent);
266268
$mailer->viewPath = $this->viewPath;
267269
$mailer->getView()->theme = Yii::$app->view->theme;
268270

controllers/RecoveryController.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,9 @@ public function actionReset($id, $code)
148148

149149
/** @var Token $token */
150150
$token = $this->finder->findToken(['user_id' => $id, 'code' => $code, 'type' => Token::TYPE_RECOVERY])->one();
151+
if (empty($token) || ! $token instanceof Token) {
152+
throw new NotFoundHttpException();
153+
}
151154
$event = $this->getResetPasswordEvent($token);
152155

153156
$this->trigger(self::EVENT_BEFORE_TOKEN_VALIDATE, $event);

controllers/SecurityController.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ public function authenticate(ClientInterface $client)
217217
\Yii::$app->session->setFlash('danger', \Yii::t('user', 'Your account has been blocked.'));
218218
$this->action->successUrl = Url::to(['/user/security/login']);
219219
} else {
220+
$account->user->updateAttributes(['last_login_at' => time()]);
220221
\Yii::$app->user->login($account->user, $this->module->rememberFor);
221222
$this->action->successUrl = \Yii::$app->getUser()->getReturnUrl();
222223
}

docs/user-management.md

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,23 +49,61 @@ feature. Place something like this in your view file to allow to jump back when
4949
```
5050
if (Yii::$app->session->has(\dektrium\user\controllers\AdminController::ORIGINAL_USER_SESSION_KEY))
5151
echo Html::a(
52-
'<span class="glyphicon glyphicon-user"></span> Back to original user',
52+
'<span class="glyphicon glyphicon-user"></span> ' . Yii::t('main', 'Back to original user'),
5353
['/user/admin/switch'], ['class' => 'btn btn-primary', 'data-method' => 'POST']);
5454
```
5555

5656
or
5757

5858
```
5959
echo Nav::widget([
60+
'options' => ['class' => 'navbar-nav navbar-right'],
6061
'items' => [
61-
Yii::$app->session->has(\dektrium\user\controllers\AdminController::ORIGINAL_USER_SESSION_KEY;) ?
62+
Yii::$app->session->has(\dektrium\user\controllers\AdminController::ORIGINAL_USER_SESSION_KEY) ?
6263
'<li>' . Html::beginForm(['/user/admin/switch'], 'post', ['class' => 'navbar-form'])
63-
. Html::submitButton('<span class="glyphicon glyphicon-user"></span> Back to original user',
64+
. Html::submitButton('<span class="glyphicon glyphicon-user"></span> ' . Yii::t('user', 'Back to original user'),
6465
['class' => 'btn btn-link']
6566
) . Html::endForm() . '</li>' : '',
6667
],
68+
]);
6769
```
6870

71+
You can declare module options 'adminPermission'. Access to action `switch` must be prefaced to all:
72+
```
73+
'modules' => [
74+
'user' => [
75+
'class' => 'dektrium\user\Module',
76+
'adminPermission' => 'administrateUser',
77+
],
78+
],
79+
```
80+
```
81+
'modules' => [
82+
'user' => [
83+
'controllerMap' => [
84+
'admin' => [
85+
'class' => 'dektrium\user\controllers\AdminController',
86+
'as access' => [
87+
'class' => 'yii\filters\AccessControl',
88+
'rules' => [
89+
[
90+
'allow' => true,
91+
'roles' => ['administrateUser'],
92+
],
93+
[
94+
'actions' => ['switch'],
95+
'allow' => true,
96+
'roles' => ['@'],
97+
],
98+
],
99+
],
100+
],
101+
],
102+
],
103+
],
104+
```
105+
106+
69107
##Changing CRUD layout
70108

71109
Sometimes you will need to have different layouts for frontend and backend pages. It is really easy to change admin layout:

messages/ca/user.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@
175175
'If you did not make this request you can ignore this email' => 'PD: Si has rebut aquest correu electrònic per error, simplement elimina\'l',
176176
'In order to complete your registration, please click the link below' => 'Per a completar el registre, si us plau, fes click al següent enllaç',
177177
'In order to complete your request, please click the link below' => 'Per a completar la petició, fes click al següent enllaç',
178-
'Information' => '@@Informació@@',
178+
'Information' => 'Informació',
179179
'Invalid login or password' => 'Usuari o contrasenyaa incorrectes',
180180
'Joined on {0, date}' => 'Registrat el {0, date}',
181181
'Location' => 'Localització',

messages/cs/user.php

Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
<?php
2+
/**
3+
* Message translations.
4+
*
5+
* This file is automatically generated by 'yii message/extract' command.
6+
* It contains the localizable messages extracted from source code.
7+
* You may modify this file by translating the extracted messages.
8+
*
9+
* Each array element represents the translation (value) of a message (key).
10+
* If the value is empty, the message is considered as not translated.
11+
* Messages that no longer need translation will have their translations
12+
* enclosed between a pair of '@@' marks.
13+
*
14+
* Message string can be used with plural forms format. Check i18n section
15+
* of the guide for details.
16+
*
17+
* NOTE: this file must be saved in UTF-8 encoding.
18+
*/
19+
return [
20+
'(not set)' => '(není nastaveno)',
21+
'A confirmation message has been sent to your new email address' => 'Kontrolní zpráva byla odeslána na Vaší novou emailovou adresu',
22+
'A message has been sent to your email address. It contains a confirmation link that you must click to complete registration.' => 'Aktivační odkaz odeslán na Vaší emailovou adresu. Na ten je nutné kliknout pro dokončení registrace.',
23+
'A new confirmation link has been sent' => 'Nový aktivační odkaz odeslán na Váš email',
24+
'A password will be generated automatically if not provided' => 'Pokud nezadáte heslo, bude vygenerováno automaticky',
25+
'Account' => 'Účet',
26+
'Account confirmation' => 'Aktivace účtu',
27+
'Account details' => 'Účet',
28+
'Account details have been updated' => 'Účet byl auktualizován',
29+
'Account settings' => 'Nastavení účtu',
30+
'Already registered? Sign in!' => 'Mám účet? Přihlásit se!',
31+
'An email has been sent with instructions for resetting your password' => 'Byl Vám odeslán email s pokyny pro změnu hesla.',
32+
'An error occurred and your password has not been changed. Please try again later.' => 'Došlo k chybě a heslo nebylo změněno. Zkuste to prosím později.',
33+
'An error occurred processing your request' => 'Došlo k chybě pri zpracování požadavku',
34+
'Are you sure you want to block this user?' => 'Opravdu chcete zablokovat tohoto uživatele?',
35+
'Are you sure you want to confirm this user?' => 'Opravdu chtete aktivovat tohoto uživatele?',
36+
'Are you sure you want to delete this user?' => 'Opravdu chtete vymazat tohoto uživatele?',
37+
'Are you sure you want to switch to this user for the rest of this Session?' => 'Opravdu se chcete přepnout na tohoto uživatele po zbytek relace?',
38+
'Are you sure you want to unblock this user?' => 'Opravdu chcete odblokovat tohoto uživatele?',
39+
'Are you sure?' => 'Jste si jisti?',
40+
'Are you sure? Deleted user can not be restored' => 'Jste si jisti? Vymazaného uživatele není možné obnovit',
41+
'Are you sure? There is no going back' => 'Jste si jisti? Tuto akci nelze vrátit zpět',
42+
'Assignments' => 'Uživatelská práva',
43+
'Awesome, almost there. Now you need to click the confirmation link sent to your new email address' => 'Téměř hotovo! Klikněte na potrzovací odkaz odeslaný na novou emailovou adresu',
44+
'Awesome, almost there. Now you need to click the confirmation link sent to your old email address' => 'Téměř hotovo! Klikněte na potrzovací odkaz odeslaný na starou emailovou adresu',
45+
'Become this user' => 'Přepnout se na uživatele',
46+
'Bio' => 'O mně',
47+
'Block' => 'Zablokovat',
48+
'Block status' => 'Stav blokace',
49+
'Blocked at {0, date, MMMM dd, YYYY HH:mm}' => 'Zablokován {0, date, dd MMMM, YYYY HH:mm}',
50+
'Change your avatar at Gravatar.com' => 'Změnit avatar na Gravatar.com',
51+
'Complete password reset on {0}' => 'Heslo změněno na webu {0}',
52+
'Confirm' => 'Aktivovat',
53+
'Confirm account on {0}' => 'Aktivace účtu na webu {0}',
54+
'Confirm email change on {0}' => 'Potvrzení změny emailu na webu {0}',
55+
'Confirmation' => 'Aktivace',
56+
'Confirmation status' => 'Stav aktivace',
57+
'Confirmation time' => 'Aktivován',
58+
'Confirmed' => 'Aktivován',
59+
'Confirmed at {0, date, MMMM dd, YYYY HH:mm}' => 'Aktivován {0, date, dd MMMM, YYYY HH:mm}',
60+
'Connect' => 'Propojit',
61+
'Continue' => 'Pokračovat',
62+
'Create' => 'Vytvořit',
63+
'Create a user account' => 'Vyvořit uživatelský účet',
64+
'Credentials will be sent to the user by email' => 'Přihlašovací údaje budou odeslány a email',
65+
'Current password' => 'Aktuální heslo',
66+
'Current password is not valid' => 'Aktuální heslo není správně',
67+
'Delete' => 'Vymazat',
68+
'Delete account' => 'Vymazat účet',
69+
'Didn\'t receive confirmation message?' => 'Nepřišel aktivační email?',
70+
'Disconnect' => 'Odpojit',
71+
'Don\'t have an account? Sign up!' => 'Nemáte účet? Zaregistrovat se!',
72+
'Email' => 'Email',
73+
'Email (public)' => 'Veřejný email',
74+
'Error occurred while changing password' => 'Došlo k chybě při změně hesla',
75+
'Error occurred while confirming user' => 'Došlo k chybě při aktivaci uživatele',
76+
'Error occurred while deleting user' => 'Došlo k chybě při mazání uživatele',
77+
'Error while trying to generate new password' => 'Došlo k chybě při generování nového hesla',
78+
'Finish' => 'Dokončit',
79+
'Forgot password?' => 'Zapomenuté heslo?',
80+
'Generate and send new password to user' => 'Vygenerovat and post uživateli nové heslo',
81+
'Gravatar email' => 'Gravatar email',
82+
'Hello' => 'Dobrý den',
83+
'If you already registered, sign in and connect this account on settings page' => 'Pokud jste již registrováni, přihlašte se a připojte účet v nastavení',
84+
'If you cannot click the link, please try pasting the text into your browser' => 'Pokud nemůžete kliknout na odkaz, zkopírujte a vložte jej do adresního řádku webového prohlížeče',
85+
'If you did not make this request you can ignore this email' => 'P.S. Pokud jste tuto zprávu obdrželi omylem, můžete ji ignorovat',
86+
'Impersonate user is disabled in the application configuration' => 'Přepínání uživatelů je zakázano v konfigurace aplikace',
87+
'In order to complete your registration, please click the link below' => 'Pro aktivaci Vašeho účtu klikněte prosím na následující odkaz',
88+
'In order to complete your request, please click the link below' => 'Pro dokončení Vašeho požadavku klikněte prosím na následující odkaz',
89+
'In order to finish your registration, we need you to enter following fields' => 'K dokončení registrace je nutné vyplnit následující pole',
90+
'Information' => 'Informace',
91+
'Invalid login or password' => 'Špatné uživatelské jméno nebo heslo',
92+
'Invalid or expired link' => 'Odkaz není platný nebo už vypršel',
93+
'It will be deleted forever' => 'Bude odstraněn navždy',
94+
'Joined on {0, date}' => 'Připojeno {0, date}',
95+
'Last login' => 'Poslední přihlášení',
96+
'Location' => 'Umístění',
97+
'Login' => 'Přihlásit se',
98+
'Logout' => 'Odhlásit se',
99+
'Manage users' => 'Správa uživatelů',
100+
'Name' => 'Jméno',
101+
'Networks' => 'Sociální sítě',
102+
'Never' => 'Nikdy',
103+
'New Password has been generated and sent to user' => 'Nové heslo bylo odesláno uživateli',
104+
'New email' => 'Nový email',
105+
'New password' => 'Nové heslo',
106+
'New permission' => 'Nové přístupové právo',
107+
'New role' => 'Nová role',
108+
'New rule' => 'Nové pravidlo',
109+
'New user' => 'Nový uživatel',
110+
'Not blocked' => 'Povolen',
111+
'Not found' => 'Nenalezeno',
112+
'Once you delete your account, there is no going back' => 'Vymazání účtu nelze vrátit zpět',
113+
'Password' => 'Heslo',
114+
'Password generation is not possible for admin users' => 'Administrátorovi nemůže být přegenerováno heslo',
115+
'Password has been changed' => 'Heslo bylo změněno',
116+
'Password is not necessary because the module is in DEBUG mode.' => 'Heslo není nutné, protože modul je v DEBUG režimu',
117+
'Permissions' => 'Přístopová práva',
118+
'Please be certain' => 'Buďtě prosím opatrní',
119+
'Please click the link below to complete your password reset' => 'Pro přegenerování hesla klikněte na následující odkaz',
120+
'Please fix following errors:' => 'Opravte prosím následující chyby:',
121+
'Profile' => 'Profil',
122+
'Profile details' => 'Profil',
123+
'Profile details have been updated' => 'Uživatelský profil byl aktualizován',
124+
'Profile settings' => 'Nastavení profilu',
125+
'Recover your password' => 'Obnovit heslo',
126+
'Recovery link is invalid or expired. Please try requesting a new one.' => 'Odkaz pro obnovu hesla neni platný nebo je zastaralý. Zkuste požádat o nový.',
127+
'Recovery message sent' => 'Email pro obnovení hesla byl odeslán',
128+
'Registration IP' => 'IP při registraci',
129+
'Registration ip' => 'IP registrace',
130+
'Registration on this website is disabled' => 'Registrace na webu je zakázána',
131+
'Registration time' => 'Registrován',
132+
'Remember me next time' => 'pamatovat si mně',
133+
'Request new confirmation message' => 'Požádat o nový aktivační email',
134+
'Reset your password' => 'Obnovit heslo',
135+
'Roles' => 'Role',
136+
'Rules' => 'Pravidla',
137+
'Save' => 'Uložit',
138+
'Sign in' => 'Přihlásit se',
139+
'Sign up' => 'Zaregistrovat se',
140+
'Something went wrong' => 'Něco se pokazilo',
141+
'Something went wrong and your account has not been confirmed.' => 'Něco se pokazilo a Váš účet se nepodařilo aktivovat.',
142+
'Thank you for signing up on {0}' => 'Děkujeme za registraci na webu {0}',
143+
'Thank you, registration is now complete.' => 'Váš účet byl úspěšně aktivován.',
144+
'The confirmation link is invalid or expired. Please try requesting a new one.' => 'Odkaz pro aktivaci účtu je neplatný nebo zastaralý. Požádejte prosím znova o aktivaci.',
145+
'This account has already been connected to another user' => 'Tento účet je již propojen s jiným uživatelem',
146+
'This email address has already been taken' => 'Tento email je již registrováno',
147+
'This username has already been taken' => 'Totu uživatelské jméno je již registrováno',
148+
'Time zone' => 'Časová zóna',
149+
'Time zone is not valid' => 'Neplatná časová zóna',
150+
'Unblock' => 'Odblokovat',
151+
'Unconfirmed' => 'Nepotvrzený účet',
152+
'Update' => 'Aktualizovat',
153+
'Update user account' => 'Aktualizovat uživatelský účet',
154+
'User has been blocked' => 'Uživatel byl zablokován',
155+
'User has been confirmed' => 'Uživatel byl aktivován',
156+
'User has been created' => 'Uživatel byl vytvořen',
157+
'User has been deleted' => 'Uživatel byl vymazán',
158+
'User has been unblocked' => 'Uživatel byl odblokován',
159+
'User is not found' => 'Uživatel nebyl nalezen',
160+
'Username' => 'Uživatelské jméno',
161+
'Users' => 'Uživatelé',
162+
'VKontakte' => 'VKontakte',
163+
'We have generated a password for you' => 'Bylo Vám vygenerované heslo',
164+
'We have received a request to change the email address for your account on {0}' => 'Požádali jste o změnu emailu na webu {0}',
165+
'We have received a request to reset the password for your account on {0}' => 'Požádali jste o změnu hesla na webu {0}',
166+
'We have sent confirmation links to both old and new email addresses. You must click both links to complete your request' => 'Posílame Vám odkazy na starou i novou emailovou adresu. Musíte kliknout na oba odkazy pro dokončení změny.',
167+
'Website' => 'Webová stránka',
168+
'Welcome to {0}' => 'Vítejte na stránkách {0}',
169+
'Yandex' => 'Yandex',
170+
'You can assign multiple roles or permissions to user by using the form below' => 'Můžete přidávat různé role a práva k uživatelům v následujícím formuláři',
171+
'You can connect multiple accounts to be able to log in using them' => 'Můžryr připojit různé účty, které bude možné použít pro přihlášení',
172+
'You can not block your own account' => 'Nemůžete zablokovat svůj vlastní účet',
173+
'You can not remove your own account' => 'Nemůžete vymazat svůj vlastní účet',
174+
'You need to confirm your email address' => 'Musíte potvrdit Vaší emailovou adresu',
175+
'Your account details have been updated' => 'Настройки аккаунта были изменены',
176+
'Your account has been blocked' => 'Váš účet byl zablokován',
177+
'Your account has been blocked.' => 'Váš účet byl zablokován',
178+
'Your account has been completely deleted' => 'Váš účet byl vymazán',
179+
'Your account has been connected' => 'Váš účet byl připojen',
180+
'Your account has been created' => 'Váš účet byl vytvořen',
181+
'Your account has been created and a message with further instructions has been sent to your email' => 'Váš účet byl vytvořen a zpráva s dalšími pokyny byla odeslána na Váš email',
182+
'Your account on {0} has a new password' => 'Nové heslo pro Váš účet na webu {0}',
183+
'Your account on {0} has been created' => 'Váš účet na webu {0} byl vytvořen',
184+
'Your confirmation token is invalid or expired' => 'Aktivační link je neplatný nebo zastaralý',
185+
'Your email address has been changed' => 'Váš email byl změněn',
186+
'Your password has been changed successfully.' => 'Vaše heslo bylo úspěšně změněno.',
187+
'Your password on {0} has been changed' => 'Vaše heslo na webu {0} bylo změněno',
188+
'Your profile has been updated' => 'Váš uživatelský profil byl změněn',
189+
'{0, date, MMMM dd, YYYY HH:mm}' => '{0, date, dd MMMM, YYYY HH:mm}',
190+
];

messages/da/user.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@
169169
'If you did not make this request you can ignore this email' => 'P.S. Hvis du har modtaget denne email ved en fejl, kan du bare slette den',
170170
'In order to complete your registration, please click the link below' => 'For at fuldføre din registrering, klik venligst på nedenstående link',
171171
'In order to complete your request, please click the link below' => 'For at fuldføre din anmodning, klik venligst på nedenstående link',
172-
'Information' => '@@Information@@',
172+
'Information' => 'Information',
173173
'Invalid login or password' => 'Ugyldigt brugernavn eller kodeord',
174174
'Joined on {0, date}' => 'Tilmeldt d. {0, date}',
175175
'Location' => 'Lokation',

0 commit comments

Comments
 (0)