File: /home/imensosw/www/imenso.co/demo/zuruuna/administrator/common/login.php
<?php include_once('model/conn.php'); ?>
<?php include_once('model/function.php'); ?>
<?php
header('Content-Type: application/json');
if(isset($_POST['username']) && !empty($_POST['username']))
{
//echo $_POST['username']; exit;
$where = "WHERE (username = '".$_POST['username']."' OR useremail = '".$_POST['username']."') AND userpassword = '".$_POST['userpassword']."' ";
$tb_site_user = select_data_array('we_user','',$where);
//print_r($tb_site_user);
if(is_array($tb_site_user) && count($tb_site_user) == 1)
{
if($tb_site_user[0]['active'] == 'Y')
{
$_SESSION['ID'] = $tb_site_user[0]['ID'];
$_SESSION['useremail'] = $tb_site_user[0]['useremail'];
$_SESSION['username'] = $tb_site_user[0]['username'];
$_SESSION['userpassword'] = $tb_site_user[0]['userpassword'];
//login success
echo "{\"VerficationStatus\":\"Y\"}";
exit;
}
else
{
echo "{\"VerficationStatus\":\"A\"}";
exit;
}
}
else
{
// Wrong id pass
echo "{\"VerficationStatus\":\"N\"}";
exit;
}
}
else
{
echo "{\"VerficationStatus\":\"W\"}";
exit;
}
?>