Example #1
0
require_once "../librairies/user.php";
$auth_user = new USER();
$stmt = $auth_user->runQuery("SELECT * FROM user ORDER BY login");
$stmt->execute();
$utilisateurs = $stmt->fetchAll();
if (isset($_POST['btn-edit'])) {
    $uname = strip_tags($_POST['ulogin']);
    $upass = strip_tags($_POST['upassword']);
    if ($upass == "") {
        $error[] = "Il manque le mot de passe !";
    } else {
        if (strlen($upass) < 6) {
            $error[] = "Le mot de passe doit au moins contenir 6 caractères";
        } else {
            try {
                if ($auth_user->updateUser($uname, $upass)) {
                    $auth_user->redirect('editUser.php?joined');
                }
            } catch (PDOException $e) {
                echo $e->getMessage();
            }
        }
    }
}
?>
<!DOCTYPE>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link href="../bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
    <link href="../bootstrap/css/bootstrap-theme.min.css" rel="stylesheet" media="screen">