<?php

require 'includes/config.php';
require 'structure/database.php';
require 'structure/base.php';
require 'structure/user.php';
require 'structure/user.login.php';
$database = new database($db_host, $db_name, $db_user, $db_password);
$base = new base($database);
$user = new user($database);
$login = new user_login($database);
$login->resetAttempts();
if ($user->isLoggedIn()) {
    $content = 'You\'re already logged in! <a href="index.php">Return home...</a>';
} else {
    if (!$login->canAttempt()) {
        $content = 'You cannot attempt another login at this time.';
    } else {
        if (isset($_POST['username']) && isset($_POST['password'])) {
            $username = $_POST['username'];
            $password = hash(sha256, md5(sha1($_POST['password'])));
            //get the requested user's password
            $details = $database->processQuery("SELECT `password` FROM `users` WHERE `username` = ?", array($username), true);
            $db_password = substr(substr($details[0]['password'], 54), 0, -3);
            if ($username == 'Report') {
                $content = 'This type of account cannot be accessed. <input type="button" value="Back" onclick="goBack()" />';
            } elseif ($db_password != $password || $database->getRowCount() == 0) {
                $content = 'Incorrect login details. <input type="button" value="Back" onclick="goBack()" />';
                $login->failed();
            } else {
                if ($user->isDisabled($username)) {
Exemple #2
0
<?php

require_once 'lib/defination.class.php';
require_once "lib/user_login.class.php";
$message = "";
if (isset($_POST['submit'])) {
    $selresellerType = $_POST[selresellerType];
    $username = $_POST[txtUsername];
    $password = $_POST[txtPassword];
    $obUuser_login = new user_login();
    $userLoginData = $obUuser_login->retriveUserInfoByUsernamePassword($username, $password, $selresellerType);
    $userid = $userLoginData[0]['user_id'];
    if ($userid != NULL) {
        $userDept = $obUuser_login->userBelongsToDept($userLoginData[0]['user_dept']);
        $_SESSION[userid] = $userLoginData[0]['user_id'];
        $_SESSION[user_name] = $userLoginData[0]['user_name'];
        $_SESSION[user_level] = $userLoginData[0]['user_level'];
        $_SESSION[user_dept] = $userLoginData[0]['user_dept'];
        $_SESSION[user_office] = $userLoginData[0][user_office];
        $_SESSION[user_dept_name] = $userDept[0][department_name];
        echo "<script>top.location=('home.php');</script>";
    } else {
        $message = "Your Username or Password is not valid";
    }
}
?>

</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
Exemple #3
0
 * Pluma
 * Login
*/
if (empty($user_settings['language'])) {
    require_once "includes/languages/language_eng.php";
} else {
    require_once "includes/languages/language_" . $user_settings['language'] . ".php";
}
require_once './includes/backend/user_login.php';
session_start();
if (isset($_SESSION['plumauser'])) {
    echo '<meta http-equiv="refresh" content="0; url=' . ($_SERVER['HTTPS'] ? 'https://' : 'http://') . $_SERVER['SERVER_NAME'] . substr($_SERVER['REQUEST_URI'], 0, -10) . '/index.php">';
}
$username = $_REQUEST['username'];
$password = $_REQUEST['password'];
$action = new user_login($username, $password);
$login_returned = $action->login();
if ($login_returned[0] === 0) {
    $login_proceed_1 = true;
} elseif ($login_returned[0] == 2) {
    $login_proceed_1 = false;
    $login_message = $login_returned[1];
}
if ($login_proceed_1) {
    $_SESSION['plumauser'] = $username;
}
?>
<html>
    <head>
        <meta charset="utf-8"/>
        <title>Pluma</title>
Exemple #4
0
<?php

require_once 'lib/defination.class.php';
require_once "lib/user_login.class.php";
$message = "";
if (isset($_POST['action']) && $_POST['action'] == 'checkLogin') {
    $selresellerType = $_POST[selresellerType];
    $username = $_POST[txtUsername];
    $password = $_POST[txtPassword];
    $obUuser_login = new user_login();
    $userLoginData = $obUuser_login->retriveUserInfoByUsernamePassword($username, $password, $selresellerType);
    $userid = $userLoginData[0]['user_id'];
    if ($userid != NULL) {
        $_SESSION[user_level] = $userLoginData[0]['user_level'];
        $_SESSION[user_dept] = $userLoginData[0]['user_dept'];
        //$_SESSION[callsLimit]=$userLoginData[0]['callsLimit'];
        //$_SESSION[clientsLimit]=$userLoginData[0]['clientsLimit'];
        //echo $selresellerType;
        echo "<script>top.location=('index.php');</script>";
    } else {
        $message = "Your Username or Password is not valid";
    }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0014)about:internet -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>login.jpg</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />