1 | <?php |
||
7 | class ModuleOptions extends AbstractOptions implements UserControllerOptionsInterface, UserServiceOptionsInterface |
||
8 | { |
||
9 | /** |
||
10 | * Turn off strict options mode |
||
11 | */ |
||
12 | protected $__strictMode__ = false; |
||
13 | |||
14 | /** |
||
15 | * @var bool |
||
16 | */ |
||
17 | protected $useRedirectParameterIfPresent = true; |
||
18 | |||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $loginRedirectRoute = 'zfcuser'; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $logoutRedirectRoute = 'zfcuser/login'; |
||
28 | |||
29 | /** |
||
30 | * @var int |
||
31 | */ |
||
32 | protected $loginFormTimeout = 300; |
||
33 | |||
34 | /** |
||
35 | * @var int |
||
36 | */ |
||
37 | protected $userFormTimeout = 300; |
||
38 | |||
39 | /** |
||
40 | * @var bool |
||
41 | */ |
||
42 | protected $loginAfterRegistration = true; |
||
43 | |||
44 | /** |
||
45 | * @var int |
||
46 | */ |
||
47 | protected $enableUserState = false; |
||
48 | |||
49 | /** |
||
50 | * @var int |
||
51 | */ |
||
52 | protected $defaultUserState = 1; |
||
53 | |||
54 | /** |
||
55 | * @var Array |
||
56 | */ |
||
57 | protected $allowedLoginStates = array( null, 1 ); |
||
58 | |||
59 | /** |
||
60 | * @var array |
||
61 | */ |
||
62 | protected $authAdapters = array( 100 => 'ZfcUser\Authentication\Adapter\Db' ); |
||
63 | |||
64 | /** |
||
65 | * @var array |
||
66 | */ |
||
67 | protected $authIdentityFields = array( 'email' ); |
||
68 | |||
69 | /** |
||
70 | * @var string |
||
71 | */ |
||
72 | protected $userEntityClass = 'ZfcUser\Entity\User'; |
||
73 | |||
74 | /** |
||
75 | * @var string |
||
76 | */ |
||
77 | protected $userLoginWidgetViewTemplate = 'zfc-user/user/login.phtml'; |
||
78 | |||
79 | /** |
||
80 | * @var bool |
||
81 | */ |
||
82 | protected $enableRegistration = true; |
||
83 | |||
84 | /** |
||
85 | * @var bool |
||
86 | */ |
||
87 | protected $enableUsername = false; |
||
88 | |||
89 | /** |
||
90 | * @var bool |
||
91 | */ |
||
92 | protected $enableDisplayName = false; |
||
93 | |||
94 | /** |
||
95 | * @var int |
||
96 | */ |
||
97 | protected $passwordCost = 14; |
||
98 | |||
99 | /** |
||
100 | * @var string |
||
101 | */ |
||
102 | |||
103 | protected $tableName = 'user'; |
||
104 | |||
105 | |||
106 | /** |
||
107 | * set login redirect route |
||
108 | * |
||
109 | * @param string $loginRedirectRoute |
||
110 | * @return ModuleOptions |
||
111 | */ |
||
112 | public function setLoginRedirectRoute($loginRedirectRoute) |
||
113 | { |
||
114 | $this->loginRedirectRoute = $loginRedirectRoute; |
||
115 | return $this; |
||
116 | } |
||
117 | |||
118 | /** |
||
119 | * get login redirect route |
||
120 | * |
||
121 | * @return string |
||
122 | */ |
||
123 | public function getLoginRedirectRoute() |
||
127 | |||
128 | /** |
||
129 | * set logout redirect route |
||
130 | * |
||
131 | * @param string $logoutRedirectRoute |
||
132 | * @return ModuleOptions |
||
133 | */ |
||
134 | public function setLogoutRedirectRoute($logoutRedirectRoute) |
||
139 | |||
140 | /** |
||
141 | * get logout redirect route |
||
142 | * |
||
143 | * @return string |
||
144 | */ |
||
145 | public function getLogoutRedirectRoute() |
||
149 | |||
150 | /** |
||
151 | * set use redirect param if present |
||
152 | * |
||
153 | * @param bool $useRedirectParameterIfPresent |
||
154 | * @return ModuleOptions |
||
155 | */ |
||
156 | public function setUseRedirectParameterIfPresent($useRedirectParameterIfPresent) |
||
161 | |||
162 | /** |
||
163 | * get use redirect param if present |
||
164 | * |
||
165 | * @return bool |
||
166 | */ |
||
167 | public function getUseRedirectParameterIfPresent() |
||
171 | |||
172 | /** |
||
173 | * set the view template for the user login widget |
||
174 | * |
||
175 | * @param string $userLoginWidgetViewTemplate |
||
176 | * @return ModuleOptions |
||
177 | */ |
||
178 | public function setUserLoginWidgetViewTemplate($userLoginWidgetViewTemplate) |
||
183 | |||
184 | /** |
||
185 | * get the view template for the user login widget |
||
186 | * |
||
187 | * @return string |
||
188 | */ |
||
189 | public function getUserLoginWidgetViewTemplate() |
||
193 | |||
194 | /** |
||
195 | * set enable user registration |
||
196 | * |
||
197 | * @param bool $enableRegistration |
||
198 | * @return ModuleOptions |
||
199 | */ |
||
200 | public function setEnableRegistration($enableRegistration) |
||
205 | |||
206 | /** |
||
207 | * get enable user registration |
||
208 | * |
||
209 | * @return bool |
||
210 | */ |
||
211 | public function getEnableRegistration() |
||
215 | |||
216 | /** |
||
217 | * set login form timeout |
||
218 | * |
||
219 | * @param int $loginFormTimeout |
||
220 | * @return ModuleOptions |
||
221 | */ |
||
222 | public function setLoginFormTimeout($loginFormTimeout) |
||
227 | |||
228 | /** |
||
229 | * get login form timeout in seconds |
||
230 | * |
||
231 | * @return int |
||
232 | */ |
||
233 | public function getLoginFormTimeout() |
||
237 | |||
238 | /** |
||
239 | * set user form timeout in seconds |
||
240 | * |
||
241 | * @param int $userFormTimeout |
||
242 | * @return ModuleOptions |
||
243 | */ |
||
244 | public function setUserFormTimeout($userFormTimeout) |
||
249 | |||
250 | /** |
||
251 | * get user form timeout in seconds |
||
252 | * |
||
253 | * @return int |
||
254 | */ |
||
255 | public function getUserFormTimeout() |
||
259 | |||
260 | /** |
||
261 | * set login after registration |
||
262 | * |
||
263 | * @param bool $loginAfterRegistration |
||
264 | * @return ModuleOptions |
||
265 | */ |
||
266 | public function setLoginAfterRegistration($loginAfterRegistration) |
||
271 | |||
272 | /** |
||
273 | * get login after registration |
||
274 | * |
||
275 | * @return bool |
||
276 | */ |
||
277 | public function getLoginAfterRegistration() |
||
281 | |||
282 | /** |
||
283 | * get user state usage for registration/login process |
||
284 | * |
||
285 | * @return int |
||
286 | */ |
||
287 | public function getEnableUserState() |
||
291 | |||
292 | /** |
||
293 | * set user state usage for registration/login process |
||
294 | * |
||
295 | * @param boolean $flag |
||
296 | * @return ModuleOptions |
||
297 | */ |
||
298 | public function setEnableUserState($flag) |
||
303 | |||
304 | /** |
||
305 | * get default user state on registration |
||
306 | * |
||
307 | * @return int |
||
308 | */ |
||
309 | public function getDefaultUserState() |
||
313 | |||
314 | /** |
||
315 | * set default user state on registration |
||
316 | * |
||
317 | * @param int $state |
||
318 | * @return ModuleOptions |
||
319 | */ |
||
320 | public function setDefaultUserState($state) |
||
325 | |||
326 | /** |
||
327 | * get list of states to allow user login |
||
328 | * |
||
329 | * @return array |
||
330 | */ |
||
331 | public function getAllowedLoginStates() |
||
335 | |||
336 | /** |
||
337 | * set list of states to allow user login |
||
338 | * |
||
339 | * @param Array $states |
||
340 | * @return ModuleOptions |
||
341 | */ |
||
342 | public function setAllowedLoginStates(Array $states) |
||
347 | |||
348 | /** |
||
349 | * set auth adapters |
||
350 | * |
||
351 | * @param array $authAdapterss |
||
352 | * @return ModuleOptions |
||
353 | */ |
||
354 | public function setAuthAdapters($authAdapters) |
||
359 | |||
360 | /** |
||
361 | * get auth adapters |
||
362 | * |
||
363 | * @return array |
||
364 | */ |
||
365 | public function getAuthAdapters() |
||
369 | |||
370 | /** |
||
371 | * set auth identity fields |
||
372 | * |
||
373 | * @param array $authIdentityFields |
||
374 | * @return ModuleOptions |
||
375 | */ |
||
376 | public function setAuthIdentityFields($authIdentityFields) |
||
381 | |||
382 | /** |
||
383 | * get auth identity fields |
||
384 | * |
||
385 | * @return array |
||
386 | */ |
||
387 | public function getAuthIdentityFields() |
||
391 | |||
392 | /** |
||
393 | * set enable username |
||
394 | * |
||
395 | * @param bool $flag |
||
396 | * @return ModuleOptions |
||
397 | */ |
||
398 | public function setEnableUsername($flag) |
||
403 | |||
404 | /** |
||
405 | * get enable username |
||
406 | * |
||
407 | * @return bool |
||
408 | */ |
||
409 | public function getEnableUsername() |
||
413 | |||
414 | /** |
||
415 | * set enable display name |
||
416 | * |
||
417 | * @param bool $flag |
||
418 | * @return ModuleOptions |
||
419 | */ |
||
420 | public function setEnableDisplayName($flag) |
||
425 | |||
426 | /** |
||
427 | * get enable display name |
||
428 | * |
||
429 | * @return bool |
||
430 | */ |
||
431 | public function getEnableDisplayName() |
||
435 | |||
436 | /** |
||
437 | * set user entity class name |
||
438 | * |
||
439 | * @param string $userEntityClass |
||
440 | * @return ModuleOptions |
||
441 | */ |
||
442 | public function setUserEntityClass($userEntityClass) |
||
447 | |||
448 | /** |
||
449 | * get user entity class name |
||
450 | * |
||
451 | * @return string |
||
452 | */ |
||
453 | public function getUserEntityClass() |
||
454 | { |
||
455 | return $this->userEntityClass; |
||
456 | } |
||
457 | |||
458 | /** |
||
459 | * set password cost |
||
460 | * |
||
461 | * @param int $passwordCost |
||
462 | * @return ModuleOptions |
||
463 | */ |
||
464 | public function setPasswordCost($passwordCost) |
||
465 | { |
||
466 | $this->passwordCost = $passwordCost; |
||
467 | return $this; |
||
468 | } |
||
469 | |||
470 | /** |
||
471 | * get password cost |
||
472 | * |
||
473 | * @return int |
||
474 | */ |
||
475 | public function getPasswordCost() |
||
479 | |||
480 | /** |
||
481 | * set user table name |
||
482 | * |
||
483 | * @param string $tableName |
||
484 | */ |
||
485 | public function setTableName($tableName) |
||
489 | |||
490 | /** |
||
491 | * get user table name |
||
492 | * |
||
493 | * @return string |
||
494 | */ |
||
495 | public function getTableName() |
||
499 | } |
||
500 |