2015-07-09 14:26:07 +02:00
|
|
|
<?php
|
2016-08-25 11:59:49 +02:00
|
|
|
|
2015-07-09 14:26:07 +02:00
|
|
|
function printError($str) {
|
|
|
|
echo '<div class="alert alert-danger" role="alert">' . $str . '</div>';
|
|
|
|
}
|
2016-08-25 11:59:49 +02:00
|
|
|
|
2015-07-09 14:26:07 +02:00
|
|
|
function printSuccess($str) {
|
|
|
|
echo '<div class="alert alert-success" role="alert">' . $str . '</div>';
|
|
|
|
}
|
2016-08-25 11:59:49 +02:00
|
|
|
|
2015-07-09 14:26:07 +02:00
|
|
|
function isInstalled($bdd) {
|
|
|
|
$req = $bdd->prepare("SHOW TABLES LIKE 'admin'");
|
|
|
|
$req->execute();
|
2016-08-25 11:59:49 +02:00
|
|
|
|
2015-07-09 14:26:07 +02:00
|
|
|
if(!$req->fetch())
|
|
|
|
return false;
|
2016-08-25 11:59:49 +02:00
|
|
|
|
2015-07-09 14:26:07 +02:00
|
|
|
return true;
|
|
|
|
}
|
2016-08-25 11:59:49 +02:00
|
|
|
|
2015-07-09 14:26:07 +02:00
|
|
|
function hashPass($pass) {
|
|
|
|
return password_hash($pass, PASSWORD_DEFAULT);
|
|
|
|
}
|
2016-08-25 11:59:49 +02:00
|
|
|
|
2015-07-09 14:26:07 +02:00
|
|
|
function passEqual($pass, $hash) {
|
|
|
|
return password_verify($pass, $hash);
|
|
|
|
}
|
2016-08-25 11:59:49 +02:00
|
|
|
|
|
|
|
?>
|