Ejemplo n.º 1
0
function adminLoginNow()
{
    $username = $_REQUEST['login_user'];
    $password = $_REQUEST['login_password'];
    $admin = new administrator();
    $admin->setUsername($username);
    $data = $admin->getAdminFromUsername();
    if (count($data) > 0) {
        $admin->extractor($data);
        if ($admin->password() == md5($password)) {
            $session = new Sessions();
            $session->setAdminLoginSessions($admin->id(), $admin->name(), $admin->email());
            Common::jsonSuccess("Success");
        } else {
            Common::jsonError("Login Error");
        }
    } else {
        Common::jsonError("Login Error");
    }
}