mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-22 09:26:27 +02:00
add capacity to modify user
This commit is contained in:
parent
f9e0312c89
commit
4a39865903
12 changed files with 687 additions and 143 deletions
|
@ -144,6 +144,27 @@ namespace controllers\internals;
|
|||
|
||||
return $objectDate && $objectDate->format($format) === $date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a sting represent a valid PHP period for creating an interval.
|
||||
*
|
||||
* @param string $period : Period string to check
|
||||
*
|
||||
* @return bool : True if valid period, false else
|
||||
*/
|
||||
public static function validate_period($period)
|
||||
{
|
||||
try
|
||||
{
|
||||
$interval = new \DateInterval($period);
|
||||
}
|
||||
catch (\Throwable $e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cette fonction retourne un mot de passe généré aléatoirement.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue