You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
finished porting one time password feature after moving some UsrModule properties to behaviors; reverted adding a getter for user component; cleaned up
Copy file name to clipboardexpand all lines: README.md
+33-32
Original file line number
Diff line number
Diff line change
@@ -86,6 +86,8 @@ Remember to invalidate the email if it changes in the save() method from the Edi
86
86
87
87
This interface allows password reset with optional tracking of used passwords. This allows to detect expired passwords and avoid reusing old passwords by users.
88
88
89
+
See the ExpiredPasswordBehavior description below.
90
+
89
91
## Hybridauth
90
92
91
93
This interface allows finding local identity associated with a remote one (from an external social site) and creating such associations.
@@ -94,71 +96,70 @@ This interface allows finding local identity associated with a remote one (from
94
96
95
97
This interface allow saving and retrieving a secret used to generate one time passwords. Also, last used password and counter used to generate last password are saved and retrieve to protect against reply attacks.
96
98
99
+
See the OneTimePasswordFormBehavior description below.
100
+
97
101
## Profile Pictures
98
102
99
103
Allows users to upload a profile picture. The example identity uses [Gravatar](http://gravatar.com/) to provide a default picture.
100
104
101
-
# Custom behaviors
105
+
## Managable
106
+
107
+
Allows to manage users:
108
+
109
+
* update their profiles (and pictures)
110
+
* change passwords
111
+
* assign authorization roles
112
+
* activate/disable and mark email as verified
113
+
* see details as timestamps of account creation, last profile update and last visit
114
+
115
+
# Custom login behaviors
116
+
117
+
The login action can be extended by attaching custom behaviors to the LoginForm. This is done by configuring the UsrModule.loginFormBehaviors property.
102
118
103
-
Do akcji logowania można podpinać dodatkowe Behaviory za pomocą zdefiniowania właściwości loginFormBehaviors w konfiguracji modułu. Pozwalają one na dodanie własnej logiki do operacji logowania uzytkowników.
119
+
There are two such behaviors provided by yii-usr module:
104
120
105
-
## Moduł dostarcza 2 wbudowane behaviory:
106
121
* ExpiredPasswordBehavior
107
122
* OneTimePasswordFormBehavior
108
123
109
124
### ExpiredPasswordBehavior
110
125
111
-
Obsługuje zachowanie pozwalające na wymuszenie na użytkownikach zmiany hasła co pewien czas.
126
+
Validates if current password has expired and forces the users to change it before logging in.
112
127
113
-
Dodatkowe parametry:
128
+
Options:
114
129
115
-
* passwordTimeout - pozwala na zdefiniowanie czasu co jaki powinno zostać zmienione hasło
130
+
* passwordTimeout - number of days after which user is requred to reset his password after logging in
116
131
117
132
### OneTimePasswordFormBehavior
118
133
119
-
Obsługuję obsługe jednorazowych haseł.
134
+
Two step authentication using one time passwords.
120
135
121
-
Dodatkowe parametry:
136
+
Options:
122
137
123
-
* authenticator -
124
-
* required - boolean Should the user be allowed to log in even if a secret hasn't been generated yet. This only makes sense when mode is 'counter', secrets are generated when registering users and a code is sent via email.
125
-
* timeout - int DEFAULT: -1 Number of seconds for how long is the last verified code valid
126
-
* mode - one of otp mode values: 'otp', 'time', 'counter', 'none' DEFAULT: 'none'. If set to 'time' or 'counter' two step authentication is enabled using one time passwords
138
+
* authenticator - if null, set to a new instance of GoogleAuthenticator class.
139
+
* mode - if set to OneTimePasswordFormBehavior::OTP_TIME or OneTimePasswordFormBehavior::OTP_COUNTER, two step authentication is enabled using one time passwords. Time mode uses codes generated using current time and requires the user to use an external application, like Google Authenticator on Android. Counter mode uses codes generated using a sequence and sends them to user's email.
140
+
* required - should the user be allowed to log in even if a secret hasn't been generated yet (is null). This only makes sense when mode is 'counter', secrets are generated when registering users and a code is sent via email.
141
+
* timeout - Number of seconds for how long is the last verified code valid.
* see details as timestamps of account creation, last profile update and last visit
161
-
162
163
# User model example
163
164
164
165
A sample ExampleUserIdentity and corresponding ExampleUser and ExampleUserUsedPassword models along with database migrations are provided respectively in the 'components', 'models' and 'migrations' folders.
@@ -201,7 +202,7 @@ Feel free to send new and updated translations to the author.
201
202
202
203
# Usage scenarios
203
204
204
-
Varios scenarios can be created by enabling or disabling following features:
205
+
Various scenarios can be created by enabling or disabling following features:
@@ -104,11 +98,6 @@ class UsrModule extends CWebModule
104
98
* @var integer For how long the user will be logged in without any activity, in seconds. Defaults to 3600*24*30 seconds (30 days).
105
99
*/
106
100
public$rememberMeDuration = 2592000;
107
-
/**
108
-
* @var integer Timeout in days after which user is requred to reset his password after logging in.
109
-
* If not null, the user identity class must implement IPasswordHistoryIdentity interface.
110
-
*/
111
-
public$passwordTimeout;
112
101
/**
113
102
* @var array Set of rules to measure the password strength when choosing new password in the registration or recovery forms.
114
103
* Rules should NOT include attribute name, it will be added when they are used.
@@ -128,7 +117,6 @@ class UsrModule extends CWebModule
128
117
public$pictureUploadRules;
129
118
/**
130
119
* @var string Class name of user identity object used to authenticate user.
131
-
* Must implement the IPasswordHistoryIdentity interface if passwordTimeout is set.
132
120
*/
133
121
public$userIdentityClass = 'CUserIdentity';
134
122
/**
@@ -156,7 +144,8 @@ class UsrModule extends CWebModule
156
144
*/
157
145
public$submitButtonCssClass = '';
158
146
/**
159
-
* @var array configuration for PHPMailer, values which are arrays will trigger methods for each value instead of setting properties.
147
+
* @var array configuration for PHPMailer, values which are arrays will trigger methods
148
+
* for each value instead of setting properties.
160
149
* For a full reference, please resolve to PHPMailer documentation.
161
150
*/
162
151
public$mailerConfig = array(
@@ -191,20 +180,29 @@ class UsrModule extends CWebModule
191
180
*/
192
181
public$dicewareExtraChar = false;
193
182
/**
194
-
* @var array Available Hybridauth providers, indexed by name, defined as array('enabled'=>true|false, 'keys'=>array('id'=>string, 'key'=>string, 'secret'=>string), 'scope'=>string)
183
+
* @var array Available Hybridauth providers, indexed by name, defined as
0 commit comments