Example #1
0
 static function getUserLoginPage()
 {
     if (Router::get('uri') == '/user/logout') {
         if (isset($_SESSION['user']) && $_SESSION['user'] != null) {
             unserialize($_SESSION['user'])->logOut();
         }
         header('Location: ' . Conf::$BASE_URL . '/');
     } elseif ($_POST != null) {
         extract($_POST);
         if (User::logIn($email, $password)) {
             header('Location: ' . Conf::$BASE_URL . '/');
         }
     }
     echo self::render('userLoginPage');
 }
Example #2
0
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</head>

<body>
	<div class="container">
		<?php 
include '../../models/user.php';
include '../menu_top.php';
if (isset($_POST['email']) && isset($_POST['password'])) {
    $email = $_POST['email'];
    $pass = $_POST['password'];
    if (empty($email) || empty($pass)) {
        echo "<br><div class='alert alert-info col-md-8'>All fields are required!</div>";
    } else {
        $user = User::logIn($email, $pass);
        if ($user) {
            $_SESSION['user'] = $user->email;
            $_SESSION['first_name'] = $user->first_name;
            $_SESSION['last_name'] = $user->last_name;
            $_SESSION['admin'] = $user->admin;
            header('Location: /beers-blog-php/admin');
        } else {
            echo "<br><div class='alert alert-info col-md-8'>Wrong email/password combination!</div>";
        }
    }
}
?>
		<div class='col-md-8'>
			<table class='table table striped'>
				<form action="<?php 
<?php

require_once __DIR__ . "/../class/User.class.php";
if (isset($_POST)) {
    $User = new User();
    $User->setPassword($_POST['password']);
    $User->setUsername($_POST['username']);
    $User->logIn();
}
<?php

/**
 * Developed by Jay Gaha
 * http://jaygaha.com.np
 */
$url = 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']);
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
    header('Location: ' . $url . '/wml_login.php');
    exit;
}
include 'includes/inc-public.php';
include 'includes/classes/class.user.php';
$user = new User();
// echo $user->logOut();
$valid = $user->logIn($_POST['su_email'], $_POST['su_password']);
if ($valid) {
    header('Location: ' . $url);
    exit;
}
$_SESSION['error'] = 'Invalid login credentials. Please try again.';
header('Location: ' . $url . '/wml_login.php');
exit;
Example #5
0
<?php

include_once "../configRoot.php";
require_once ROOT_NAME . "/classes/Database.php";
require_once ROOT_NAME . "/classes/User.php";
if ($_SERVER["REQUEST_METHOD"] === "POST") {
    $email = $_POST["email"];
    $email = trim($email);
    $email = htmlspecialchars($email);
    $password = $_POST["password"];
    $db = Database::getInstance();
    $conn = $db->getConnection();
    $user = new User($conn);
    $user->setEmail($email);
    $user->setPassword($password);
    $result = $user->logIn();
    if ($result) {
        header("location: ../index.php");
    } else {
        header("location: ../login.php?error=log_in_failed");
    }
} else {
    header("location: ../login.php");
}
Example #6
0
 */
require_once 'includes/header.php';
?>

<?php 
//register($Name, $Station, $Username, $Password)
// If the form is submitted to register user
if (isset($_POST['register'])) {
    $registerUser = new User();
    // We instantiate the object
    $registerUser->register($_POST['name'], $_POST['station'], $_POST['username'], $_POST['password']);
}
// If the form is submitted for loging in user
if (isset($_POST['login'])) {
    $loginUser = new User();
    $loginUser->logIn($_POST['username'], $_POST['password']);
}
?>
<div class="container">

    <div class="page-header">
        <h1>Good Shepherd Hospital Panabo Inc. <small>SMS Notification</small></h1>
    </div>

    <div class="row">
        <div class="col-md-4" style="display:none;">
            <!-- Login with existing user credentials -->
            <div class="panel panel-primary">
                <div class="panel-heading">
                    <h3 class="panel-title">Login Here</h3>
                </div>
Example #7
0
require_once "cfg.php";
require_once "shared2/autoload.php";
/* connect to the database */
db_connect($CFG->dbhost, $CFG->dbname, $CFG->dbuser, $CFG->dbpass);
mysql_set_charset('utf8');
session_start();
session_regenerate_id();
Settings::assign($CFG);
Settings::importTable('app_configuration');
$CFG->libdir = "lib";
$CFG->img_dir = "images";
$CFG->self = basename($_SERVER['SCRIPT_FILENAME']);
$CFG->method_id = 0;
$CFG->backstage_mode = true;
$CFG->ajax = true;
$DB_DEBUG = $CFG->db_debug == 'Y';
$DB_DIE_ON_FAIL = $CFG->db_debug == 'Y';
/* header vars */
$CFG->default_meta_desc = 'Backstage2';
$CFG->default_meta_keywords = 'Flexible management program.';
$CFG->default_meta_author = 'Organic Technologies';
$CFG->default_title = 'Organic Technologies';
/* permission selector */
$CFG->permissions = array(2 => 'Edit', 1 => 'View', 0 => 'No Access');
/* Constants */
$CFG->request_widthdrawal_id = $CFG->request_withdrawal_id;
$CFG->form_email = $CFG->support_email;
$CFG->request_widthdrawal_id = $CFG->request_withdrawal_id;
User::logIn($_REQUEST['loginform']['user'], $_REQUEST['loginform']['pass']);
User::logOut($_REQUEST['logout']);
Example #8
0
                    }
                }
                $userList = $user->adminGetUserList();
                include "view/header.php";
                include "view/admin_home.php";
                include "view/footer.php";
                break;
        }
    }
} else {
    $error = array('type' => "none", 'message' => "");
    if (!empty($_POST['action'])) {
        $user = new User($mysqli);
        switch ($_POST['action']) {
            case "login":
                $result = $user->logIn($_POST['username'], $_POST['password'], $_POST['auth']);
                if (!is_array($result)) {
                    $error['type'] = "login";
                    $error['message'] = $result;
                } else {
                    $_SESSION['user_session'] = $result['username'];
                    $_SESSION['user_admin'] = $result['admin'];
                    $_SESSION['user_supportpin'] = $result['supportpin'];
                    $_SESSION['user_id'] = $result['id'];
                    header("Location: index.php");
                }
                break;
            case "register":
                $result = $user->add($_POST['username'], $_POST['password'], $_POST['confirmPassword']);
                if ($result !== true) {
                    $error['type'] = "register";
Example #9
0
<?php

require_once "src/connection.php";
session_start();
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $user = User::logIn($_POST['mail'], $_POST['password']);
    if ($user != false) {
        $_SESSION['user'] = $user;
        header("location: main.php");
    }
    echo "z³y login lub haslo chuju";
}
?>

<form action = "login.php" method="POST">
    <input type = "text" name="mail" placeholder="enter mail">
    <input type ="text" name="password" placeholder="enter password">
    <input type = "submit" value ="login">
</form>
Example #10
0
require_once "classes/class.User.inc.php";
require_once "classes/class.DbConnect.inc.php";
require_once "functions/function.inputSanitizer.inc.php";
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $db = Conn::getInstance();
    $conn = $db->getConnection();
    $user = new User($conn);
    /**
     * Remove dangerous signs
     */
    $email = sanitizeMySQL($conn, $_POST['userEmail']);
    $password = sanitizeMySQL($conn, $_POST['userPassword']);
    /**
     * Check if user can be logged in
     */
    if ($user->logIn($email, $password)) {
        header("Location: index.php");
    }
}
?>

<!DOCTYPE html>
<html lang="pl-PL">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <title>MyTwitt Login</title>

    <!-- Bootstrap -->
Example #11
0
<?php

@session_start();
if (isset($_SESSION['use'])) {
    header("Location:home.php");
}
if (isset($_POST['signin'])) {
    $mail = $_POST['email'];
    $pass = $_POST['password'];
    include "user.class.php";
    $user = new User();
    $user->logIn($mail, $pass);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>UniHelp</title>
  <link rel="stylesheet" href="bootstrap/dist/css/bootstrap.min.css" media="screen">
  <link href='https://fonts.googleapis.com/css?family=Roboto:400,300,500,700,100' rel='stylesheet' type='text/css'>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
    <script src="bootstrap/dist/js/bootstrap.min.js">
    
    </script>
   
  <link rel="shortcut icon" type="image/png" href="../favicon.png"/>
  <style>
  .logo{height: 55px; padding-top: 0px}
  #head-text{color: white}
  </style>
Example #12
0
<?php

require_once "user.php";
$user = new User();
if (isset($_POST['login'])) {
    $user->logIn();
} else {
    if (isset($_POST['signUp'])) {
        $user->newUser();
    } else {
        if (isset($_POST['reset'])) {
            $user->resetAccount($_POST['email']);
        } else {
            header('Location:index.php');
        }
    }
}
Example #13
0
<?php

if (isset($_POST['login'])) {
    $_SESSION['station'] = $_POST['station'];
}
require_once 'includes/header.php';
$user = new User();
// If the form is submitted to register user
if (isset($_POST['register'])) {
    global $user;
    $user->register($_POST['name'], $_POST['station'], $_POST['username'], $_POST['password']);
}
// If the form is submitted for loging in user
if (isset($_POST['login'])) {
    global $user;
    $user->logIn($_POST['station'], $_POST['password']);
}
?>

<div class="container">

    <div class="page-header">
        <h1 style = "color:#ffffff;">Good Shepherd Hospital Panabo Inc.<br><small>Web SMS</small></h1>
    </div>

    <div class="row">

        <div class="col-md-4 divregister" style="display:none;" >
            <!-- Register new user -->
            <div class="panel panel-primary">
                <div class="panel-heading" >
Example #14
0
                        <img class="glyphicon" src="pics/glyphs/user.svg">
                    </div>
                </div>
                <div class="form-group">   
                    <div class="login-form">
                        <input class="password" type="password" name="password" value placeholder="password">
                        <img class="glyph_pswd" src="pics/glyphs/key.svg">
                    </div>
                </div>
                <div class="btn"> 
                    <input class="button" type="submit" value="войти">
                </div>
            </form>
        </div>
         <?php 
require 'functions.php';
if (session_status() < 2) {
    session_start();
}
if (isset($_POST['username'])) {
    $user = new User();
    if ($user->logIn($_POST['username'], $_POST['password']) == true) {
        $_SESSION['current_user'] = $_POST['username'];
        header('location: admin.php');
    } else {
        echo '<br>неверно введено имя пользователя или пароль<br>';
    }
}
?>
    </body>
</html>
Example #15
0
<?php

require_once 'src/connection.php';
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $newUser = User::logIn($_POST['email'], $_POST['password']);
    if ($newUser != false) {
        $_SESSION['user'] = $newUser;
        header('location: index.php');
    }
    $r = 1;
}
require_once 'meta.html';
require_once 'menu.php';
?>

<div class="container">
    <div class="odstep" style="height: 30px;"></div>
    <div class="row">
        <div class="col-md-12">
            <div class="jumbotron" style="color: white; background-color: dimgray;">

                <h1> Panel <span style="color:orangered">logowania </span>
            </div>
        </div>
    </div>


    <form action="login.php" method="post">
        <div class="row">
            <div class="col-md-4"></div>
            <div class="col-md-4 ">
Example #16
0
 function test_logOut()
 {
     //Arrange
     $user_name = "Nathan";
     $password = "******";
     $longitude = 45.516231;
     $latitude = -122.682519;
     $signed_in = 0;
     $id = 1;
     $test_user = new User($user_name, $password, $longitude, $latitude, $signed_in, $id);
     $test_user->save();
     //Act
     $test_user_online = User::logIn("Nathan", "xxx60606");
     $test_user_online->logOut();
     $result = User::getAll();
     //Assert
     $this->assertEquals(0, $result[0]->getSignedIn());
 }
Example #17
0
header('X-XSS-Protection: 1; mode=block');
header('X-Powered-By: WLOX');
/* Readonly Sessions */
if (empty($ajax)) {
    session_start();
    session_regenerate();
} else {
    session_readonly();
}
/* Current File Name */
$CFG->self = basename($_SERVER['SCRIPT_FILENAME']);
/* Check for Email Auth */
if (!empty($_REQUEST['email_auth']) && !empty($_REQUEST['authcode'])) {
    $email_authcode = urlencode($_REQUEST['authcode']);
    $email_authcode_request = $CFG->self == 'withdraw.php';
    User::logIn(false, false, $email_authcode, $email_authcode_request);
}
/* Common Info */
API::add('Lang', 'getTable');
API::add('Currencies', 'get');
API::add('User', 'verifyLogin');
API::add('Settings', 'get');
$query = API::send();
if (empty($ajax)) {
    API::apiUpdateNonce();
}
/* Assign Settings To CFG */
Settings::assign($query['Settings']['get']['results'][0]);
/* Check Login */
User::verifyLogIn($query);
User::logOut(isset($_REQUEST['log_out']));
Example #18
0
 }
 if (empty($pass1)) {
     Errors::add(Lang::string('login-password-empty-error'));
 }
 if (!empty($_REQUEST['submitted']) && (empty($_SESSION["register_uniq"]) || $_SESSION["register_uniq"] != $_REQUEST['uniq'])) {
     Errors::add('Page expired.');
 }
 if (!empty(User::$attempts) && User::$attempts > 3 && !empty($CFG->google_recaptch_api_key) && !empty($CFG->google_recaptch_api_secret)) {
     $captcha = new Form('captcha');
     $captcha->reCaptchaCheck(1);
     if (!empty($captcha->errors) && is_array($captcha->errors)) {
         Errors::add($captcha->errors['recaptcha']);
     }
 }
 if (!is_array(Errors::$errors)) {
     $login = User::logIn($user1, $pass1);
     if ($login && empty($login['error'])) {
         if (!empty($login['message']) && $login['message'] == 'awaiting-token') {
             $_SESSION["register_uniq"] = md5(uniqid(mt_rand(), true));
             Link::redirect('verify-token.php');
         } elseif (!empty($login['message']) && $login['message'] == 'logged-in' && $login['no_logins'] == 'Y') {
             $_SESSION["register_uniq"] = md5(uniqid(mt_rand(), true));
             Link::redirect('first_login.php');
         } elseif (!empty($login['message']) && $login['message'] == 'logged-in') {
             $_SESSION["register_uniq"] = md5(uniqid(mt_rand(), true));
             Link::redirect('account.php');
         }
     } elseif (!$login || !empty($login['error'])) {
         Errors::add(Lang::string('login-invalid-login-error'));
     }
 }
Example #19
0
 function save()
 {
     global $CFG;
     if ($_REQUEST['bypass_save'] || $CFG->save_called || strstr($_REQUEST['form_name'], 'form_filters')) {
         return false;
     }
     $this->save_called = true;
     $CFG->save_called = true;
     if (!$this->get_called && $this->record_id > 0) {
         if (!is_array(self::$old_info_prev)) {
             $this->old_info = DB::getRecord($this->table, $this->record_id, 0, 1);
             self::$old_info_prev = $this->old_info;
         } else {
             $this->old_info = self::$old_info_prev;
         }
         $subtables = DB::getSubtables($this->name);
         if (is_array($subtables)) {
             foreach ($subtables as $subtable) {
                 if (!DB::tableExists($this->table . '_' . $subtable)) {
                     continue;
                 }
                 if (strstr($subtable, 'grid_')) {
                     $name_parts = explode('grid_', $subtable);
                     $name = $name_parts[1];
                     $this->old_info[$name] = DB::getGridValues($this->table . '_grid_' . $name, $subtable_fields, $this->record_id);
                 } elseif (strstr($subtable, 'files')) {
                     //$files = DB::getFiles($this->table.'_files',$this->record_id);
                 } else {
                     if ($this->info['cat_selects'] && $this->info['cat_selects'][$subtable]) {
                         $cats = DB::getCats($this->table . '_' . $subtable, $this->record_id);
                         if ($cats) {
                             foreach ($cats as $cat) {
                                 $this->old_info['cat_selects'][$subtable][] = $cat['row']['c_id'];
                             }
                         }
                     }
                 }
             }
         }
     }
     /*
     		if ($CFG->backstage_mode && !empty($_REQUEST['trigger_field'])) {
     			if (is_array($_REQUEST['trigger_field'])) {
     				foreach ($_REQUEST['trigger_field'] as $k => $tfield) {
     					self::emailNotify($tfield,$_REQUEST['trigger_value'][$k],$_REQUEST['email_field'][$k],$_REQUEST['email_table'][$k],$_REQUEST['email_record'][$k]);
     				}
     				$this->bypass_email = true;
     			}
     		}
     */
     /*
     		if ($CFG->backstage_mode && !empty($_REQUEST['trigger_field1'])) {
     			if (is_array($_REQUEST['trigger_field1'])) {
     				foreach ($_REQUEST['trigger_field1'] as $k => $tfield) {
     					if (!empty($tfield)) {
     						self::createRecord($_REQUEST['create_record_table'][$k],$tfield,$_REQUEST['trigger_value'][$k]);
     					}
     				}
     			}
     		}
     */
     if ($_FILES[$this->name]['name']) {
         foreach ($_FILES[$this->name]['name'] as $input_name => $file_name) {
             if ($file_name) {
                 $temp_files[] = Upload::saveTemp($this->name, $input_name);
             }
         }
         if (is_array($temp_files)) {
             foreach ($temp_files as $file_info) {
                 $field_name = $file_info['input_name'];
                 if ($file_info['error']) {
                     $this->errors[$field_name] = $file_info['error'];
                 } else {
                     $this->temp_files[$field_name] = $file_info['filename'];
                     $CFG->temp_files[$field_name] = $file_info['filename'];
                     $this->temp_descs[$field_name] = $file_info['file_desc'];
                 }
             }
         }
     }
     if ($this->info && !$this->errors) {
         if ($CFG->auto_create_table) {
             if (!DB::tableExists($this->table)) {
                 if (DB::createTable($this->table, $_REQUEST['db_fields'], $_REQUEST['radioinputs'], $this->ignore_fields)) {
                     $this->messages[$this->table] = $CFG->table_created;
                 } else {
                     $this->errors[] = $CFG->table_creation_error;
                 }
             }
         }
         if (!$this->errors) {
             $insert_values = $this->info;
             if (is_array($this->ignore_fields)) {
                 foreach ($this->ignore_fields as $i_name => $i_table) {
                     unset($insert_values[$i_name]);
                 }
             }
             if (is_array($this->includes)) {
                 foreach ($this->includes as $i_table => $i_info) {
                     if (is_array($this->ignore_fields)) {
                         foreach ($this->info as $key => $value) {
                             if (array_key_exists($key, $this->ignore_fields) && $this->ignore_fields[$key] == $i_table) {
                                 $i_values[$key] = $value;
                             }
                         }
                     }
                     if (!$this->record_id) {
                         $include_ids[$i_table] = DB::insert($i_table, $i_values);
                         $this->include_ids = $include_ids;
                     } else {
                         DB::update($i_table, $i_values, $i_info['id']);
                     }
                 }
             }
             if (!$this->record_id) {
                 if ($include_ids) {
                     $t_fields = DB::getTableFields($this->table, 1);
                     if (is_array($t_fields)) {
                         foreach ($include_ids as $i_table => $i_id) {
                             if (!in_array($i_table . '_include_id', $t_fields)) {
                                 db_query('ALTER TABLE ' . $this->table . ' ADD ' . $i_table . '_include_id INT( 10 ) UNSIGNED NOT NULL ');
                             }
                             $insert_values[$i_table . '_include_id'] = $i_id;
                         }
                     }
                 }
                 if ($this->record_id = DB::insert($this->table, $insert_values, false, $this->ignore_fields)) {
                     $this->record_created = true;
                     $CFG->id = $this->record_id;
                     $this->info['id'] = $this->record_id;
                     $this->messages[] = $CFG->form_save_message;
                 } else {
                     $this->errors[] = $CFG->form_save_error;
                 }
             } else {
                 DB::saveImageOrder($_REQUEST['file_order'], $this->table);
                 if (DB::update($this->table, $insert_values, $this->record_id, $this->ignore_fields) != -1) {
                     $this->record_created = false;
                     $this->messages[$this->record_id] = $CFG->form_update_message;
                     if ($this->table == 'admin_users' && $CFG->url != 'users') {
                         User::logOut(1);
                         User::logIn($this->info['user'], $this->info['pass']);
                     }
                 } else {
                     $this->errors[$this->record_id] = $CFG->form_update_error;
                 }
             }
         }
         if (!$this->errors && is_array($this->temp_files)) {
             foreach ($this->temp_files as $field_name => $file_name) {
                 $field_name_parts = explode('__', $field_name);
                 $field_name_n = $field_name_parts[0];
                 $file_reqs = $_REQUEST['files'][$field_name_n];
                 $image_sizes = $file_reqs['image_sizes'] ? $file_reqs['image_sizes'] : $CFG->image_sizes;
                 if (Upload::save($file_name, $field_name_n, $this->table, $this->record_id, $file_reqs['dir'], $image_sizes, $field_name)) {
                     $this->messages[$file_name] = $CFG->file_save_message;
                     unset($this->temp_files[$field_name]);
                     unset($CFG->temp_files[$field_name]);
                 } else {
                     $this->errors[$file_name] = $CFG->file_save_error;
                 }
             }
         }
         if ($_REQUEST['file_descs']) {
             foreach ($_REQUEST['file_descs'] as $i => $desc) {
                 Upload::saveDescriptions($this->table, false, $i);
             }
         }
     }
 }
<?php

include_once 'src/kredyt.php';
include_once 'src/home.php';
session_start();
if ($_SERVER["REQUEST_METHOD"] == "POST" && $_POST['kalklog'] != 1) {
    $newUser = User::logIn($_POST['name'], $_POST['password']);
    if ($newUser != false) {
        $_SESSION['user'] = $newUser;
        header('location: index.php');
    }
    $r = 1;
}
if ($_SERVER["REQUEST_METHOD"] == "POST" && $_POST['kalklog'] == 1) {
    $newUser = User::logIn($_POST['name'], $_POST['password']);
    if ($newUser != false) {
        $_SESSION['user'] = $newUser;
        header('location: kalk.php');
    }
    $r = 1;
}
?>


<!DOCTYPE html>
<html lang="pl">
<head>
    <meta charset="UTF-8">

    <title> Czy opłaca się spłacić wcześniej kredyt hipoteczny </title>
    <meta name="description" content="Czy opłaca się spłacić wcześniej kredyt hipoteczny">