Issues (55)

Security Analysis    no request data  

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

src/LmcUser/Options/ModuleOptions.php (2 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace LmcUser\Options;
4
5
use Laminas\Stdlib\AbstractOptions;
6
7
class ModuleOptions extends AbstractOptions implements
8
    UserControllerOptionsInterface,
9
    UserServiceOptionsInterface
10
{
11
    /**
12
     * Turn off strict options mode
13
     */
14
    protected $__strictMode__ = false;
15
16
    /**
17
     * @var bool
18
     */
19
    protected $useRedirectParameterIfPresent = true;
20
21
    /**
22
     * @var string
23
     */
24
    protected $loginRedirectRoute = 'lmcuser';
25
26
    /**
27
     * @var string
28
     */
29
    protected $logoutRedirectRoute = 'lmcuser/login';
30
31
    /**
32
     * @var int
33
     */
34
    protected $loginFormTimeout = 300;
35
36
    /**
37
     * @var int
38
     */
39
    protected $userFormTimeout = 300;
40
41
    /**
42
     * @var bool
43
     */
44
    protected $loginAfterRegistration = true;
45
46
    /**
47
     * @var int
48
     */
49
    protected $enableUserState = false;
50
51
    /**
52
     * @var int
53
     */
54
    protected $defaultUserState = 1;
55
56
    /**
57
     * @var Array
58
     */
59
    protected $allowedLoginStates = array( null, 1 );
60
61
    /**
62
     * @var array
63
     */
64
    protected $authAdapters = array( 100 => 'LmcUser\Authentication\Adapter\Db' );
65
66
    /**
67
     * @var array
68
     */
69
    protected $authIdentityFields = array( 'email' );
70
71
    /**
72
     * @var string
73
     */
74
    protected $userEntityClass = 'LmcUser\Entity\User';
75
76
    /**
77
     * @var string
78
     */
79
    protected $userLoginWidgetViewTemplate = 'lmc-user/user/login.phtml';
80
81
    /**
82
     * @var bool
83
     */
84
    protected $enableRegistration = true;
85
86
    /**
87
     * @var bool
88
     */
89
    protected $enableUsername = false;
90
91
    /**
92
     * @var bool
93
     */
94
    protected $enableDisplayName = false;
95
96
    /**
97
     * @var bool
98
     */
99
    protected $useRegistrationFormCaptcha = false;
100
101
    /**
102
     * @var bool
103
     */
104
    protected $useLoginFormCaptcha = false;
105
106
    /**
107
     * @var bool
108
     */
109
    protected $useLoginFormCsrf = true;
110
111
    /**
112
     * @var int
113
     */
114
    protected $passwordCost = 14;
115
116
    /**
117
     * @var string
118
     */
119
120
    protected $tableName = 'user';
121
122
    /**
123
     * @var array
124
     */
125
    protected $formCaptchaOptions = array(
126
        'class'   => 'figlet',
127
        'options' => array(
128
            'wordLen'    => 5,
129
            'expiration' => 300,
130
            'timeout'    => 300,
131
        ),
132
    );
133
134
    /**
135
     * set login redirect route
136
     *
137
     * @param  string $loginRedirectRoute
138
     * @return ModuleOptions
139
     */
140
    public function setLoginRedirectRoute($loginRedirectRoute)
141
    {
142
        $this->loginRedirectRoute = $loginRedirectRoute;
143
        return $this;
144
    }
145
146
    /**
147
     * get login redirect route
148
     *
149
     * @return string
150
     */
151
    public function getLoginRedirectRoute()
152
    {
153
        return $this->loginRedirectRoute;
154
    }
155
156
    /**
157
     * set logout redirect route
158
     *
159
     * @param  string $logoutRedirectRoute
160
     * @return ModuleOptions
161
     */
162
    public function setLogoutRedirectRoute($logoutRedirectRoute)
163
    {
164
        $this->logoutRedirectRoute = $logoutRedirectRoute;
165
        return $this;
166
    }
167
168
    /**
169
     * get logout redirect route
170
     *
171
     * @return string
172
     */
173
    public function getLogoutRedirectRoute()
174
    {
175
        return $this->logoutRedirectRoute;
176
    }
177
178
    /**
179
     * set use redirect param if present
180
     *
181
     * @param  bool $useRedirectParameterIfPresent
182
     * @return ModuleOptions
183
     */
184
    public function setUseRedirectParameterIfPresent($useRedirectParameterIfPresent)
185
    {
186
        $this->useRedirectParameterIfPresent = $useRedirectParameterIfPresent;
187
        return $this;
188
    }
189
190
    /**
191
     * get use redirect param if present
192
     *
193
     * @return bool
194
     */
195
    public function getUseRedirectParameterIfPresent()
196
    {
197
        return $this->useRedirectParameterIfPresent;
198
    }
199
200
    /**
201
     * set the view template for the user login widget
202
     *
203
     * @param  string $userLoginWidgetViewTemplate
204
     * @return ModuleOptions
205
     */
206
    public function setUserLoginWidgetViewTemplate($userLoginWidgetViewTemplate)
207
    {
208
        $this->userLoginWidgetViewTemplate = $userLoginWidgetViewTemplate;
209
        return $this;
210
    }
211
212
    /**
213
     * get the view template for the user login widget
214
     *
215
     * @return string
216
     */
217
    public function getUserLoginWidgetViewTemplate()
218
    {
219
        return $this->userLoginWidgetViewTemplate;
220
    }
221
222
    /**
223
     * set enable user registration
224
     *
225
     * @param  bool $enableRegistration
226
     * @return ModuleOptions
227
     */
228
    public function setEnableRegistration($enableRegistration)
229
    {
230
        $this->enableRegistration = $enableRegistration;
231
        return $this;
232
    }
233
234
    /**
235
     * get enable user registration
236
     *
237
     * @return bool
238
     */
239
    public function getEnableRegistration()
240
    {
241
        return $this->enableRegistration;
242
    }
243
244
    /**
245
     * set login form timeout
246
     *
247
     * @param  int $loginFormTimeout
248
     * @return ModuleOptions
249
     */
250
    public function setLoginFormTimeout($loginFormTimeout)
251
    {
252
        $this->loginFormTimeout = $loginFormTimeout;
253
        return $this;
254
    }
255
256
    /**
257
     * get login form timeout in seconds
258
     *
259
     * @return int
260
     */
261
    public function getLoginFormTimeout()
262
    {
263
        return $this->loginFormTimeout;
264
    }
265
266
    /**
267
     * set user form timeout in seconds
268
     *
269
     * @param  int $userFormTimeout
270
     * @return ModuleOptions
271
     */
272
    public function setUserFormTimeout($userFormTimeout)
273
    {
274
        $this->userFormTimeout = $userFormTimeout;
275
        return $this;
276
    }
277
278
    /**
279
     * get user form timeout in seconds
280
     *
281
     * @return int
282
     */
283
    public function getUserFormTimeout()
284
    {
285
        return $this->userFormTimeout;
286
    }
287
288
    /**
289
     * set login after registration
290
     *
291
     * @param  bool $loginAfterRegistration
292
     * @return ModuleOptions
293
     */
294
    public function setLoginAfterRegistration($loginAfterRegistration)
295
    {
296
        $this->loginAfterRegistration = $loginAfterRegistration;
297
        return $this;
298
    }
299
300
    /**
301
     * get login after registration
302
     *
303
     * @return bool
304
     */
305
    public function getLoginAfterRegistration()
306
    {
307
        return $this->loginAfterRegistration;
308
    }
309
310
    /**
311
     * get user state usage for registration/login process
312
     *
313
     * @return int
314
     */
315
    public function getEnableUserState()
316
    {
317
        return $this->enableUserState;
318
    }
319
320
    /**
321
     * set user state usage for registration/login process
322
     *
323
     * @param  boolean $flag
324
     * @return ModuleOptions
325
     */
326
    public function setEnableUserState($flag)
327
    {
328
        $this->enableUserState = $flag;
0 ignored issues
show
Documentation Bug introduced by
The property $enableUserState was declared of type integer, but $flag is of type boolean. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
329
        return $this;
330
    }
331
332
    /**
333
     * get default user state on registration
334
     *
335
     * @return int
336
     */
337
    public function getDefaultUserState()
338
    {
339
        return $this->defaultUserState;
340
    }
341
342
    /**
343
     * set default user state on registration
344
     *
345
     * @param  int $state
346
     * @return ModuleOptions
347
     */
348
    public function setDefaultUserState($state)
349
    {
350
        $this->defaultUserState = $state;
351
        return $this;
352
    }
353
354
    /**
355
     * get list of states to allow user login
356
     *
357
     * @return array
358
     */
359
    public function getAllowedLoginStates()
360
    {
361
        return $this->allowedLoginStates;
362
    }
363
364
    /**
365
     * set list of states to allow user login
366
     *
367
     * @param  Array $states
368
     * @return ModuleOptions
369
     */
370
    public function setAllowedLoginStates(array $states)
371
    {
372
        $this->allowedLoginStates = $states;
373
        return $this;
374
    }
375
376
    /**
377
     * set auth adapters
378
     *
379
     * @param  array $authAdapterss
0 ignored issues
show
There is no parameter named $authAdapterss. Did you maybe mean $authAdapters?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.

Consider the following example. The parameter $ireland is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $ireland
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was changed, but the annotation was not.

Loading history...
380
     * @return ModuleOptions
381
     */
382
    public function setAuthAdapters($authAdapters)
383
    {
384
        $this->authAdapters = $authAdapters;
385
        return $this;
386
    }
387
388
    /**
389
     * get auth adapters
390
     *
391
     * @return array
392
     */
393
    public function getAuthAdapters()
394
    {
395
        return $this->authAdapters;
396
    }
397
398
    /**
399
     * set auth identity fields
400
     *
401
     * @param  array $authIdentityFields
402
     * @return ModuleOptions
403
     */
404
    public function setAuthIdentityFields($authIdentityFields)
405
    {
406
        $this->authIdentityFields = $authIdentityFields;
407
        return $this;
408
    }
409
410
    /**
411
     * get auth identity fields
412
     *
413
     * @return array
414
     */
415
    public function getAuthIdentityFields()
416
    {
417
        return $this->authIdentityFields;
418
    }
419
420
    /**
421
     * set enable username
422
     *
423
     * @param  bool $flag
424
     * @return ModuleOptions
425
     */
426
    public function setEnableUsername($flag)
427
    {
428
        $this->enableUsername = (bool) $flag;
429
        return $this;
430
    }
431
432
    /**
433
     * get enable username
434
     *
435
     * @return bool
436
     */
437
    public function getEnableUsername()
438
    {
439
        return $this->enableUsername;
440
    }
441
442
    /**
443
     * set enable display name
444
     *
445
     * @param  bool $flag
446
     * @return ModuleOptions
447
     */
448
    public function setEnableDisplayName($flag)
449
    {
450
        $this->enableDisplayName = (bool) $flag;
451
        return $this;
452
    }
453
454
    /**
455
     * get enable display name
456
     *
457
     * @return bool
458
     */
459
    public function getEnableDisplayName()
460
    {
461
        return $this->enableDisplayName;
462
    }
463
464
    /**
465
     * set use a captcha in registration form
466
     *
467
     * @param  bool $useRegistrationFormCaptcha
468
     * @return ModuleOptions
469
     */
470
    public function setUseRegistrationFormCaptcha($useRegistrationFormCaptcha)
471
    {
472
        $this->useRegistrationFormCaptcha = $useRegistrationFormCaptcha;
473
        return $this;
474
    }
475
476
    /**
477
     * get use a captcha in registration form
478
     *
479
     * @return bool
480
     */
481
    public function getUseRegistrationFormCaptcha()
482
    {
483
        return $this->useRegistrationFormCaptcha;
484
    }
485
486
    /**
487
     * set use a captcha in login form
488
     *
489
     * @param  bool $useLoginFormCaptcha
490
     * @return ModuleOptions
491
     */
492
    public function setUseLoginFormCaptcha($useLoginFormCaptcha)
493
    {
494
        $this->useLoginFormCaptcha = $useLoginFormCaptcha;
495
        return $this;
496
    }
497
498
    /**
499
     * get use a captcha in login form
500
     *
501
     * @return bool
502
     */
503
    public function getUseLoginFormCaptcha()
504
    {
505
        return $this->useLoginFormCaptcha;
506
    }
507
508
    /**
509
     * set use a csrf in login form
510
     *
511
     * @param  bool $useLoginFormCsrf
512
     * @return ModuleOptions
513
     */
514
    public function setUseLoginFormCsrf($useLoginFormCsrf)
515
    {
516
        $this->useLoginFormCsrf = $useLoginFormCsrf;
517
        return $this;
518
    }
519
520
    /**
521
     * get use a csrf in login form
522
     *
523
     * @return bool
524
     */
525
    public function getUseLoginFormCsrf()
526
    {
527
        return $this->useLoginFormCsrf;
528
    }
529
530
    /**
531
     * set user entity class name
532
     *
533
     * @param  string $userEntityClass
534
     * @return ModuleOptions
535
     */
536
    public function setUserEntityClass($userEntityClass)
537
    {
538
        $this->userEntityClass = $userEntityClass;
539
        return $this;
540
    }
541
542
    /**
543
     * get user entity class name
544
     *
545
     * @return string
546
     */
547
    public function getUserEntityClass()
548
    {
549
        return $this->userEntityClass;
550
    }
551
552
    /**
553
     * set password cost
554
     *
555
     * @param  int $passwordCost
556
     * @return ModuleOptions
557
     */
558
    public function setPasswordCost($passwordCost)
559
    {
560
        $this->passwordCost = $passwordCost;
561
        return $this;
562
    }
563
564
    /**
565
     * get password cost
566
     *
567
     * @return int
568
     */
569
    public function getPasswordCost()
570
    {
571
        return $this->passwordCost;
572
    }
573
574
    /**
575
     * set user table name
576
     *
577
     * @param string $tableName
578
     */
579
    public function setTableName($tableName)
580
    {
581
        $this->tableName=$tableName;
582
    }
583
584
    /**
585
     * get user table name
586
     *
587
     * @return string
588
     */
589
    public function getTableName()
590
    {
591
        return $this->tableName;
592
    }
593
594
    /**
595
     * set form CAPTCHA options
596
     *
597
     * @param  array $formCaptchaOptions
598
     * @return ModuleOptions
599
     */
600
    public function setFormCaptchaOptions($formCaptchaOptions)
601
    {
602
        $this->formCaptchaOptions = $formCaptchaOptions;
603
        return $this;
604
    }
605
606
    /**
607
     * get form CAPTCHA options
608
     *
609
     * @return array
610
     */
611
    public function getFormCaptchaOptions()
612
    {
613
        return $this->formCaptchaOptions;
614
    }
615
}
616