Ejemplo n.º 1
0
<?php

$err = "";
include_once 'objects/taikhoan.php';
include_once 'include/functions.php';
if (!isset($_SESSION)) {
    session_start();
}
if (isset($_POST['submit'])) {
    if (isset($_POST['user'])) {
        if (isset($_POST['pass'])) {
            $user = $_POST['user'];
            $pass = $_POST['pass'];
            $r = TaiKhoan::DangNhap($user, $pass);
            if (isset($r)) {
                if ($r == -1) {
                    $err = "Tài khoản đã bị khóa";
                } else {
                    $_SESSION['taikhoan'] = serialize($r);
                    header("Location: admin.php");
                }
            } else {
                $err = "Tên đăng nhâp hoặc mật khẩu không đúng";
            }
        } else {
            $err = "Bạn chưa nhập pass";
        }
    } else {
        $err = "Bạn chưa nhập tên đăng nhập";
    }
}
Ejemplo n.º 2
0
 if ($_POST['email'] != "" && $_POST['email'] != $email) {
     if (TaiKhoan::DoiEmail($taikhoan->ID, $_POST['email'])) {
         $erroremail = "Đổi email thành công ";
         $stylee = 'style="color:green"';
     } else {
         $erroremail = "Lỗi đổi email!";
     }
 }
 if ($_POST['name'] != "" && $_POST['name'] != $ten) {
     if (TaiKhoan::DoiTenHienThi($taikhoan->ID, $_POST['name'])) {
         $erroremail = "Đổi tên hiển thị thành công ";
         $stylee = 'style="color:green"';
     }
 }
 if ($_POST['matkhaucu'] != "") {
     if (TaiKhoan::DangNhap($taikhoan->TenDangNhap, $_POST['matkhaucu'])) {
         if ($_POST['matkhaumoi'] != "") {
             if ($_POST['matkhaumoi'] == $_POST['nhaplai']) {
                 $matkhaucu = md5($_POST['matkhaucu']);
                 TaiKhoan::DoiPass($taikhoan->TenDangNhap, $matkhaucu, $_POST['matkhaumoi']);
                 $errorpass = "******";
                 $stylep = 'style="color:green"';
             } else {
                 $errorpass = "******";
             }
         } else {
             $errorpass = "******";
         }
     } else {
         $errorpass = "******";
     }
Ejemplo n.º 3
0
<?php

$error = "";
if (!isset($_SESSION)) {
    session_start();
}
if (isset($_SESSION['taikhoan'])) {
    if (isset($_POST['submit'])) {
        if ($_POST['pass'] != "") {
            if ($_POST['pass'] == $_POST['passreplace']) {
                include_once 'objects/taikhoan.php';
                include_once './include/functions.php';
                $taikhoan = unserialize($_SESSION['taikhoan']);
                $tk = TaiKhoan::DoiPass($taikhoan->TenDangNhap, $taikhoan->MatKhau, $_POST['pass']);
                include_once 'logout.php';
                TaiKhoan::DangNhap($taikhoan->TenDangNhap, $_POST['pass']);
                header("location:index.php");
            } else {
                $error = "Nhập sai mật khẩu mới";
            }
        } else {
            $error = "Vui lòng nhập mật khẩu";
        }
    }
}
?>

<form action="" method="POST" id="doimatkhauquen" style="
      padding-top: 100px;
      width: 400px;
      text-align: center;
Ejemplo n.º 4
0
<?php

include_once '../include/functions.php';
include_once '../objects/taikhoan.php';
session_start();
$r = TaiKhoan::DangNhap($_GET['Username'], $_GET['Password']);
if (isset($r)) {
    $_SESSION['taikhoan'] = serialize($r);
    if ($r == -1) {
        echo '-1';
    } else {
        echo '1';
    }
} else {
    echo '0';
}