-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.php
35 lines (34 loc) · 1.02 KB
/
login.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
include_once('include/application_top.php');
if(array_key_exists('email', $_POST) && array_key_exists('password', $_POST)){
//print_r($_POST);
$submit = $_POST['submit'];
if ($submit) {
// Validation
$email = trim($_POST['email']);
$password = $_POST['password'];
$login_validate = $_core->userLoginValidate($email, $password);
if ($login_validate) {
$_core->redirect('activity.php');
exit;
} else {
$_SESSION['messege'] = array('type' => 'fail', 'text' => 'Let\'s try again');
$_core->redirect('index.php');
exit;
}
}
}
// is user logged in ? if not then redirect to Login page
$user_logged_in = $_core->isUserLoggedIn();
if(!$user_logged_in){
//$_SESSION['msg']['error']="";
$_SESSION['messege'] = array('type'=>'fail','text'=>'please login first to access your account');
$_core->redirect('index.php');
$_core->close();
exit;
}
else{
$_core->redirect('activity.php');
exit;
}
?>