| Conditions | 7 |
| Paths | 6 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | <?php |
||
| 13 | public function init() |
||
|
1 ignored issue
–
show
|
|||
| 14 | { |
||
| 15 | $config = Config::share(); |
||
| 16 | if (!empty($config['failTry']) && $config['failTry'] > 3) { |
||
| 17 | exit('Превышен лимит неправильного ввода пароля. Для разблокировки отредактируйте файл %INJI_PROGRAM_DIR%/config/config.php'); |
||
| 18 | } |
||
| 19 | if (empty(App::$cur->params[0]) || App::$cur->params[0] != 'enter') { |
||
| 20 | if (empty($config['systemPass'])) { |
||
| 21 | Tools::redirect('/setup/enter', 'Придумайте системный пароль'); |
||
| 22 | } |
||
| 23 | if (empty($_SESSION['systemLogin'])) { |
||
| 24 | Tools::redirect('/setup/enter', 'Введите системный пароль'); |
||
| 25 | } |
||
| 26 | } |
||
| 27 | } |
||
| 28 | |||
| 30 |
Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable: