453
454
455
456
457
458
459
460
461
462
463
464
465
466
|
if (!$this->user)
{
return false;
}
return ($this->user->droits->$category >= $permission);
}
public function getNewOTPSecret()
{
$out = [];
$out['secret'] = Security_OTP::getRandomSecret();
$out['secret_display'] = implode(' ', str_split($out['secret'], 4));
$out['url'] = Security_OTP::getOTPAuthURL(Config::getInstance()->get('nom_asso'), $out['secret']);
|
>
>
>
>
>
>
>
>
|
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
|
if (!$this->user)
{
return false;
}
return ($this->user->droits->$category >= $permission);
}
public function requireAccess($category, $permission)
{
if (!$this->canUserAccess($category, $permission))
{
throw new UserException('Vous n\'avez pas le droit d\'accéder à cette page.');
}
}
public function getNewOTPSecret()
{
$out = [];
$out['secret'] = Security_OTP::getRandomSecret();
$out['secret_display'] = implode(' ', str_split($out['secret'], 4));
$out['url'] = Security_OTP::getOTPAuthURL(Config::getInstance()->get('nom_asso'), $out['secret']);
|