| Conditions | 5 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 45 | private function is2faEnabled() |
||
| 46 | { |
||
| 47 | $enabled = config('rakshak.enable_2fa'); |
||
| 48 | // $controlLevel = RakshakSetting::first()->control_level_2fa; |
||
| 49 | $controlLevel = Cache::get('rakshak.control_level_2fa'); |
||
| 50 | |||
| 51 | if ($enabled && $controlLevel === 'admin') { |
||
| 52 | return true; |
||
| 53 | } |
||
| 54 | |||
| 55 | if ($enabled && $controlLevel === 'user') { |
||
| 56 | return Auth::user()->enable_2fa; |
||
| 57 | } |
||
| 60 |