<?php

namespace Modules\Index\Outil;

use Entity\Model\Paravrac;
use Helpers\Outil\Roles;

class OutilDoubleAuthentification
{
    protected $pdo;

    protected $post;

    public function __construct(\PDO $pdo)
    {
        $this->pdo = $pdo;
    }
    
    public static function doubleAuthActive(\PDO $pdo) : array
    {
        $droit['dbleAuthActive'] = (new Paravrac($pdo))->getGeneric('LOGIN_DOUBLE_AUTHENTIFICATION');
        
        if ($droit['dbleAuthActive'] == 'O') {
            $droit['dbleAuthActive'] = true;
        } else {
            $droit['dbleAuthActive'] = false;
        }
        $droit['dbleAuthFrequence'] = (new Paravrac($pdo))->getGeneric('LOGIN_DBLAUTH_FREQUENCE');

        return $droit;
    }
}
