Merge branch '10400' into data_engine

This commit is contained in:
fredtempez 2020-10-28 19:36:59 +01:00
commit aff90ba298
2 changed files with 36 additions and 42 deletions

View File

@ -22,6 +22,8 @@
- Thème administration : modification de l'appel du code CSS permettant une mise à jour du thème sans vider le cache. - Thème administration : modification de l'appel du code CSS permettant une mise à jour du thème sans vider le cache.
- Amélioration : - Amélioration :
- Mise en page du corps des mails de notification. - Mise en page du corps des mails de notification.
- Mise à jour :
- TinyMCE 4.9.11
## version 10.3.03 ## version 10.3.03
- Correction : - Correction :

View File

@ -49,70 +49,62 @@ class template {
'value' => '', 'value' => '',
'limit' => false 'limit' => false
], $attributes); ], $attributes);
// Génération des nombres et choix de l'opération // Tirage de l'opération et des nombres
$numbers = array(0,1,2,3,4,5,6,7,8,9,10,12,13,14,15,16,17,18,19,20); $numbers = array(0,1,2,3,4,5,6,7,8,9,10,12,13,14,15,16,17,18,19,20);
$letters = array('u','t','s','r','q','p','o','n','m','l','k','j','i','h','g','f','e','d','c','b','a'); $letters = array('u','t','s','r','q','p','o','n','m','l','k','j','i','h','g','f','e','d','c','b','a');
$limit = $attributes['limit'] ? count($letters)-1 : 10; $limit = $attributes['limit'] ? count($letters)-1 : 10;
mt_srand((float) microtime()*1000000); mt_srand((float) microtime()*1000000);
$operator = mt_rand (0, 3);
if ($operator > 1) {
$limit = 10;
}
$firstNumber = mt_rand (1, $limit); $firstNumber = mt_rand (1, $limit);
mt_srand((float) microtime()*1000000);
$secondNumber = mt_rand (1, $limit); $secondNumber = mt_rand (1, $limit);
mt_srand((float) microtime()*1000000);
$operator = mt_rand (0, 3); if ( ($operator < 2)
AND ($firstNumber < $secondNumber) )
{
$temp = $firstNumber;
$firstNumber = $secondNumber;
$secondNumber = $temp;
}
switch ($operator) { switch ($operator) {
case 0: case 0:
$operator = template::ico('plus'); $operator = template::ico('plus');
if ($firstNumber < $secondNumber) { $result = $firstNumber + $secondNumber;
$temp = $firstNumber;
$firstNumber = $secondNumber;
$secondNumber = $temp;
}
$result = $firstNumber + $secondNumber;
break; break;
case 1: case 1:
$operator = template::ico('minus'); $operator = template::ico('minus');
if ($firstNumber < $secondNumber) { $result = $firstNumber - $secondNumber;
$temp = $firstNumber;
$firstNumber = $secondNumber;
$secondNumber = $temp;
}
$result = $firstNumber - $secondNumber;
break; break;
case 2: case 2:
$operator = template::ico('cancel'); $operator = template::ico('cancel');
mt_srand((float) microtime()*1000000); $result = $firstNumber * $secondNumber;
$firstNumber = mt_rand (1, 10);
mt_srand((float) microtime()*1000000);
$secondNumber = mt_rand (1, 10);
$result = $firstNumber * $secondNumber;
break; break;
case 3: case 3:
$operator = template::ico('divide'); $operator = template::ico('divide');
mt_srand((float) microtime()*1000000); switch ($firstNumber) {
$firstNumber = mt_rand (1, 10); case 3:
mt_srand((float) microtime()*1000000); $limit = 6;
if ($firstNumber < 3) { break;
$secondNumber = mt_rand(1, 10); case 4:
} $limit = 5;
elseif ($firstNumber = 3) { break;
$secondNumber = mt_rand(1, 6); case 5:
} $limit = 4;
elseif ($firstNumber = 4) { break;
$secondNumber = mt_rand(1, 5); case 6:
} $limit = 3;
elseif ($firstNumber = 5) { break;
$secondNumber = mt_rand(1, 4);
}
elseif ($firstNumber = 6 ) {
$secondNumber = mt_rand(1, 3);
}
elseif ($firstNumber > 6) {
$secondNumber = mt_rand(1, 2);
} }
if ($firstNumber > 6) $limit = 2;
$secondNumber = mt_rand(1, $limit);
$firstNumber = $firstNumber * $secondNumber; $firstNumber = $firstNumber * $secondNumber;
$result = $firstNumber / $secondNumber; $result = $firstNumber / $secondNumber;
break; break;
} }
$result = password_hash($result, PASSWORD_BCRYPT); $result = password_hash($result, PASSWORD_BCRYPT);
$firstLetter = uniqid(); $firstLetter = uniqid();
$secondLetter = uniqid(); $secondLetter = uniqid();