PHP Method User::check_login, codiad Code Examples

This page contains top rated real world PHP examples of method User::check_login from package codiad extracted from open source projects. You can rate examples to help us improve the quality of examples
Example #1
Show file File: BisController.php Project: bis2909/lar_demo
0
 public function login()
 {
     if (User::check_login(Input::get("user_input"), md5(sha1(Input::get("password"))))) {
         Session::put("logined", "true");
         return Redirect::to("edit-profile");
     } else {
         return View::make("login")->with("error_message", "Tên đăng nhập hoặc mật khẩu không chính xác!");
     }
 }
Example #2
Show file File: login.php Project: andreas83/Videosharing
0
 function index()
 {
     $user = new User();
     if (isset($_POST) && !empty($_POST)) {
         if ($user->check_login($_POST['user'], $_POST['password'])) {
             $_SESSION['user'] = $user->username;
             $_SESSION['user_id'] = $user->id;
             header("Location: " . Config::get('address') . "/user/video");
         } else {
             $this->login_error = _("Sorry, please check your Credentials");
         }
     }
 }
Example #3
Show file File: UserController.php Project: tieuquangmg/demo-php
0
 public function postLogin()
 {
     if (User::check_login(Input::get("user_input"), md5(sha1(Input::get("password"))))) {
         //Đăng nhập thành công
         Session::put("logined", "true");
         //$role = Userrole::Where("user_id","=",Session::get('id_taikhoan'))->get()->first();
         $role = User::find(Session::get('id_taikhoan'))->roles()->first();
         var_dump($role->id);
         Session::put("role", $role->id);
         //Tạo session login
         if ($role->id == 2) {
             return Redirect::to("admin");
         } else {
             return Redirect::to("/");
         }
     } else {
         return View::make("frontend.users.login")->with("error_message", "Tên đăng nhập hoặc mật khẩu không đúng");
     }
     //Thông báo lõi
 }
Example #4
Show file File: login.php Project: visnik21/cass
0
<?php

session_start();
include_once 'include/class.user.php';
$user = new User();
if (isset($_REQUEST['submit'])) {
    extract($_REQUEST);
    $login = $user->check_login($emailusername, $password);
    if ($login) {
        // Registration Success
        header("location:home.php");
    } else {
        // Registration Failed
        echo 'Wrong username or password';
    }
}
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
OOP Login Module
<style><!--
            #container{width:400px; margin: 0 auto;}

--></style>

<script type="text/javascript" language="javascript">

            function submitlogin() {
                var form = document.login;
				if(form.emailusername.value == ""){
					alert( "Enter email or username." );
					return false;
Example #5
Show file File: check_login.php Project: phictd/hethongwebhai
0
if (isset($_POST['ok'])) {
    if ($_POST['txtuser'] == NULL) {
        echo "<div align='center' style='margin:10px 0px 5px 0px;'><font size='+1' color='#FF0033'>Chưa gõ tên đăng nhập</font></div><br />";
    } else {
        $u = $_POST['txtuser'];
    }
    if ($_POST['txtpass'] == NULL) {
        echo "<div align='center' style='margin:10px 0px 5px 0px;'><font size='+1' color='#FF0033'>Chưa nhập mật khẩu</font></div>";
    } else {
        $p = $_POST['txtpass'];
    }
    if ($u && $p) {
        $login = new User();
        $login->set_user($u);
        $login->set_pass($p);
        $data1 = $login->check_login();
        if ($login->check_login() == FALSE) {
            echo "<div align='center' style='margin:10px;'><font size='+1' color='#FF0033'>Sai tên đăng nhập hoặc mật khẩu</font></div>";
        } else {
            foreach ($data1 as $user1) {
                $_SESSION['username'] = $user1[Username];
                $_SESSION['hoten'] = $user1[HoTen];
                $_SESSION['dienthoai'] = $user1[DienThoai];
                $_SESSION['diachi'] = $user1[DiaChi];
                $_SESSION['level'] = $user1[Level];
            }
            if ($_GET['co'] == 2) {
                header("location:index.php?module=giohang&act=xem");
            } else {
                header("location:index.php");
            }
            exit;
Example #6
Show file File: index.php Project: tsolucio/coreBOSMYCCP
0
<?php

/* * *******************************************************************************
 * The content of this file is subject to the MYC Vtiger Customer Portal license.
 * ("License"); You may not use this file except in compliance with the License
 * The Initial Developer of the Original Code is Proseguo s.l. - MakeYourCloud
 * Portions created by Proseguo s.l. - MakeYourCloud are Copyright(C) Proseguo s.l. - MakeYourCloud
 * All Rights Reserved.
 * ****************************************************************************** */
$app_stus = "PRODUCTION";
//SET TO PRODUCTION TO DISABLE ERRORS
if ($app_stus == "PRODUCTION") {
    error_reporting(0);
}
//Require all files necessary for the application to start, including user settings, soap library for enstablish the connection, and the portal classes
require_once "portal.php";
//Load the portal configuration if presents or run the wizard
PortalConfig::load();
//Establish the connection with the crm customer portal webservices
Portal::connect();
//Check if there are stored variables then if the user is previously logged or if has sent some login/forgot request, else provide him a logging screen
User::check_login();
//Start the vtlib api connection if parameters are given in the config file
Api::connect();
//Load the plugins from the plugins directory
Plugins::load_plugins();
//If the login is passed analyze the REQUEST and call the requested action.
Router::start();
Example #7
Show file File: login.php Project: HelanGracy/TrainingAmeex
0
<?php

session_start();
include "class.user.php";
$user = new User();
if (isset($_REQUEST['submit'])) {
    extract($_REQUEST);
    $login = $user->check_login($name, $pass, $cnfpass);
    if ($login) {
        // Registration Success
        $uid = $_SESSION['uid'];
        $_SESSION['uid'] = $uid;
        $_SESSION['name'] = $name;
        //$name=$_SESSION['name'];
        header("location:file1.php");
    } else {
        // Registration Failed
        echo 'Wrong username or password';
    }
}
?>
<html>

        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<style><!--
        #container{width:400px; margin: 0 auto;}
	--></style><div id="container">	 	 
	<h1>Login Here</h1>
	<form action="" method="post" name="login">
	<table>
	<tbody>
Example #8
Show file File: routes.php Project: nhom5UET/tichhophethong
0
        }
    }
});
Route::get("login", function () {
    if (isset($_SESSION["session_user"])) {
        return View::make("module");
    } else {
        return View::make("login");
    }
    //	}
});
Route::get("welcome", function () {
    return View::make("module");
});
Route::post("welcome", function () {
    if (User::check_login(Input::get("user_input"), md5(sha1(Input::get("password"))))) {
        //		return View::make("session");
        //        setcookie("cookie_user",Input::get("user_input"),time() + 3600);
        //        setcookie("cookie_pass",Input::get("password"),time() + 3600);
        //        $_SESSION["session_users"] = $_COOKIE["cookie_user"];
        //        $_SESSION["session_passwords"] = $_COOKIE["cookie_pass"];
        $_SESSION["session_user"] = Input::get("user_input");
        $_SESSION["session_password"] = Input::get("password");
        //		$_SESSION["session_passwordCK"]=base64_encode(Input::get("password"));
        return View::make("module");
    } else {
        //		unset($_SESSION["session_user"]);
        //		unset($_SESSION["session_password"]);
        return "Logn fail";
    }
});
Example #9
Show file File: login.php Project: arshanam/pharmacy_app
0
<?php

error_reporting(E_ALL);
session_start();
include_once 'classes/class.mysqli.php';
include_once 'includes/required.inc.php';
require_once 'classes/class.encryption.php';
include_once 'classes/class.user.php';
$user = new User();
if ($user->get_session()) {
    echo '<meta http-equiv="refresh" content="0;url=' . BASEURL . '">';
}
if ($_SERVER['REQUEST_METHOD'] && $_SERVER['REQUEST_METHOD'] == 'POST') {
    $login = $user->check_login(post_text_variable($_POST['username']), post_text_variable($_POST['password']));
    if ($login) {
        // Registration Success
        echo '<meta http-equiv="refresh" content="0;url=' . BASEURL . '">';
        //echo"logged in";
    } else {
        // Registration Failed
        echo '<div align="center" style="color: red; font-size: 12px; position: relative; top: 80px;">Username or Password is Wrong</div>';
    }
} else {
    ?>
	<!DOCTYPE html>
	<html lang="en">
	  <head>
	    <meta charset="utf-8">
	    <title>Login</title>
	    <meta name="viewport" content="width=device-width, initial-scale=1.0">
	    <meta name="description" content="">
Example #10
Show file File: login.php Project: Rzelmiszel/CarShop
0
<?php

session_start();
include_once 'functions.php';
$user = new User();
if ($user->get_session()) {
    header("location:index.php");
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $login = $user->check_login($_POST['emailusername'], $_POST['password']);
    if ($login) {
        // Login Success
        header("location:login.php");
    } else {
        // Login Failed
        $msg = 'Username / password wrong';
    }
}
?>

<?php 
include "header.php";
?>
 	<div class="section-header">
 		<h1> Sign In </h1>
 	</div>
  	<form id="Form1" method="POST" action="" name="login">
		<div class="form-group">
			<span>Login</span>
			<input type="text" name="emailusername"/>
		</div>
Example #11
Show file File: login.php Project: pratishshr/leapfrog
0
<?php

session_start();
include_once "../config/config.php";
include_once "../system/dbutil/DBConnection.class.php";
include_once "../system/model/login.class.php";
$user = new User();
if (isset($_POST['submit'])) {
    $_SESSION['login'] = $user->check_login($_POST['username'], $_POST['password']);
    if ($_SESSION['login']) {
        $_SESSION['username'] = $_POST['username'];
        header("Location: index.php?page=admin");
        exit;
    }
}
?>

<!DOCTYPE html>
<html>
<head>
  <title>LOG IN</title>
  <!-- Latest compiled and minified CSS -->
  <link rel="stylesheet" href="../assets/css/bootstrap.min.css">
  <link rel="stylesheet" href="../assets/css/custom.css">
  <!-- Optional theme -->
  <!-- <link rel="stylesheet" href="<?php 
echo BASE_URL;
?>
assets/css/bootstrap-theme.min.css">-->
  
  <!-- jQuery -->
Example #12
Show file File: UserController.php Project: Hungmaix94/Medusa
0
 public function postLogin()
 {
     //echo "Touch";
     $credentials = array('user_input' => Input::get('user_input'), 'password' => Input::get('password'));
     $rules = array('user_input' => 'required', 'password' => 'required');
     $validator = Validator::make($credentials, $rules);
     if ($validator->passes()) {
         //kiem tra dieu kien credentials da thoa man rule hay chua
         $check = User::check_login($credentials['user_input'], $credentials['password']);
         // dd(Session::get('user_name'));
         if ($check) {
             $username = Auth::user()->username;
             $userId = $check['_id'];
             Session::put('theme', Auth::user()->theme);
             return Redirect::to($username . '/backend');
         } else {
             return Redirect::back()->with('success', "Tài khoản không chính xác. Đăng nhập thất bại");
         }
     }
 }
Example #13
Show file File: user.php Project: sanjsuper/framework_blog
0
 * Time: 15:41
 */
if (!isset($_SESSION['user']) || $_SESSION['user']['activate'] !== "1") {
    header("Location: /main");
    exit;
}
config::$page = "Профиль пользователя " . $_SESSION['user']['login'];
//Смена логина
if (isset($_POST['sub']) && $_POST['captcha'] == $_SESSION['captcha']) {
    $update_login = new User();
    $passwords = $update_login->check_password($_POST['password']);
    if ($_POST['password'] !== $_POST['password1'] || $_SESSION['user']['password'] !== $passwords) {
        $_SESSION['user_error_pass'] = "Пароли не совпадают или пароль введен не верно";
        return false;
    }
    $login = $update_login->check_login($_POST['login']);
    if ($login === false) {
        $_SESSION['user_error_login'] = "Такой логин уже существует";
        return false;
    }
    $row = array();
    $row['login'] = $_POST['login'];
    $row['password'] = $passwords;
    $success = $update_login->update_user($row);
    unset($update_login);
    if ($success === false) {
        $_SESSION['success'] = "Ошибка при обновлении";
        return false;
    } else {
        $_SESSION['success'] = "Логин успешно обновлен";
        header("Location: /reg/user/" . $_SESSION['user']['login']);
Example #14
Show file File: users.php Project: enishant/PHP_LOGIN_SCRIPT
0
        $this->_result = mysqli_query($this->_connStr, $this->_sql);
        $this->_row = mysqli_fetch_array($this->_result);
        $pass = md5($pass);
        if ($this->_row['username'] == $user && $this->_row['password'] == $pass) {
            echo "User Name And Password are correct";
            $_SESSION['id'] = $this->_row['id'];
            return 1;
        } else {
            echo "Kindly enter the Correct Username & Password";
            return 0;
        }
        mysqli_close($this->_connStr);
    }
    public function get_user_details()
    {
        $sql = "SELECT * FROM members";
        $result = mysqli_query($this->_connStr, $sql);
        while ($row = mysqli_fetch_array($result)) {
            $this->user_pass[$row['username']] = $row['password'];
        }
        return $this->user_pass;
    }
}
$user = new User();
//$user->createUser("Dominic", "alfa@123", "d_nic14@yahoo.in");
echo "<pre>";
print_r($user->get_user_details());
echo "</pre>";
echo "<br />";
$user->check_login("Dominic", "alfa@123");
echo "<br />" . $_SESSION['id'];
Example #15
Show file File: login.php Project: giulianofiorotto/IoT-Framework-ESP8266
0
<?php

session_start();
require_once "php/functions.php";
$user = new User();
$user->checkCookies();
$user->checkSession();
if (isset($_POST["submit"])) {
    $codPassword = sha1(md5($_POST["pass"]));
    $login = $user->check_login($_POST['user'], $codPassword);
    if ($login) {
        if (isset($_POST['remember'])) {
            $user->setCookies($_POST['user']);
        }
        header("location: /iot/#/home");
    } else {
        $error = "Sorry username or password is wrong!";
    }
}
?>
<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>IoT | Login</title>

    <link href="css/bootstrap.min.css" rel="stylesheet">