Example #1
0
function DeleteAccount($Email)
{
    try {
        $pdo = new PDO('sqlite:bd.sqlite3');
    } catch (PDOException $e) {
        echo 'Connection failed: ' . $e->getMessage();
    }
    $Delete = "DELETE FROM Compte WHERE CompteEmail = :Email";
    $req = $pdo->prepare($Delete);
    $req->bindValue(':Email', $Email);
    $req->execute();
    Admin();
    echo "<script> alert('Le compte : (" . $Email . ") a ete supprimer')</script>";
    $pdo = null;
}
Example #2
0
 * Time: 16:30
 */
include "BD.php";
if (isset($_POST['Add_btn'])) {
    //si le bouton ajouter a été peser appelle la fontion add
    if ($_POST['email'] == "" || $_POST['password'] == "") {
        echo "<script> alert('email ou mot de passe invalide') </script>";
        Admin();
    } else {
        if (isset($_POST['admin'])) {
            AddAccount($_POST['email'], $_POST['password'], $_POST['admin']);
        } else {
            AddAccount($_POST['email'], $_POST['password'], 0);
        }
    }
} else {
    if (isset($_POST['Modify_btn'])) {
        //si le bouton modifier a été peser appelle la fontion modify
        if ($_POST['email'] == "" || $_POST['password'] == "") {
            echo "<script> alert('email ou mot de passe invalide') </script>";
            Admin();
        } else {
            ModifyAccount($_POST['Liste'], $_POST['email'], $_POST['password'], $_POST['admin']);
        }
    } else {
        if (isset($_POST['Delete_btn'])) {
            //si le bouton Supprimer a été peser appelle la fontion Delete
            DeleteAccount($_POST['Liste']);
        }
    }
}
Example #3
0
function HaveAuthority($pos)
{
    if ($pos == "./group.php") {
        return Login() && Admin();
    }
    if ($pos == "./admin.php") {
        return Login() && Admin();
    }
    if ($pos == "./action/action_apply.php") {
        return Login() && Apply();
    }
    if ($pos == "./action/action_alterkey.php") {
        return Login();
    }
    if ($pos == "./page/group/action/*") {
        return Login() && Admin();
    }
    if ($pos == "./page/admin/action/*") {
        return Login() && Admin();
    }
    return true;
}
Example #4
0
function Sessions()
{
    $check = array();
    $check['status'] = Status();
    $check['user'] = User();
    $check['moderator'] = Moderator();
    $check['admin'] = Admin();
    $check['session'] = $_SESSION;
    return $check;
}