first commit

This commit is contained in:
2019-05-25 23:11:05 -04:00
commit 16f48376bc
6139 changed files with 990356 additions and 0 deletions
@@ -0,0 +1,50 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Login extends AGT_Controller {
function __construct() {
parent::__construct();
}
public function index() {
$data['action_message'] = '';
// temporary data to fix all aspect
$data['username'] = 'ses66181+agent456@gmail.com';
$data['password'] = 'agentpass';
if ($this->input->post()) {
// echo 'ameye';
$valid_entry = false;
$username = $password = $error_message = '';
$this->testLoginInput($username, $password, $error_message, $valid_entry);
if ($valid_entry == true) {
$in['username'] = $username;
$in['password'] = $password;
$in['action'] = MEDTRANS_TRANSP_LOGIN;
$out = array();
$ret = $this->medtrans_call_api(MEDTRANS_TRANSP_LOGIN, $in, $out);
//print_r($out);
// echo $ret;
// print_r($_SESSION);
if ($ret == PHP_LOGIN_OK) {
$out = $this->populateAgentsession($out); // just for testing - will be removed
// $this->buildUserSession($ret, $out);
redirect('dash');
} else {
$data['action_message'] = $this->formatedMesage('ERROR', 'Invalid Username/Password');
}
} else {
$data['action_message'] = $this->formatedMesage('ERROR', $error_message);
}
}
$this->load->view('user/view_login', $data);
}
}