Cleanup
This commit is contained in:
+1
-1
@@ -24,7 +24,7 @@ class App extends BaseConfig
|
|||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $baseURL = 'http://localhost:8080/';
|
public $baseURL = 'https://dev142.bko.myfit.mermsemr.com/'; //'http://localhost:8080/';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -37,9 +37,11 @@ $routes->set404Override();
|
|||||||
// route since we don't have to scan directories.
|
// route since we don't have to scan directories.
|
||||||
$routes->get('/', 'Home::index');
|
$routes->get('/', 'Home::index');
|
||||||
$routes->get('dash', 'Dash::index');
|
$routes->get('dash', 'Dash::index');
|
||||||
|
$routes->post('dash', 'Dash::index');
|
||||||
$routes->get('contacts', 'Dash::contacts');
|
$routes->get('contacts', 'Dash::contacts');
|
||||||
|
|
||||||
$routes->post('startlogin', 'Home::startlogin');
|
$routes->post('startlogin', 'Home::startlogin');
|
||||||
|
$routes->get('startlogin', 'Home::startlogin');
|
||||||
/*
|
/*
|
||||||
* --------------------------------------------------------------------
|
* --------------------------------------------------------------------
|
||||||
* Additional Routing
|
* Additional Routing
|
||||||
|
|||||||
@@ -6,11 +6,13 @@ class Dash extends BaseController
|
|||||||
{
|
{
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
return view('bko/dash');
|
$data['page_title'] ='Dashboard';
|
||||||
|
return view('bko/dash',$data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function contacts(){
|
public function contacts(){
|
||||||
return view('bko/contacts');
|
$data['page_title'] ='Contacts';
|
||||||
|
return view('bko/contacts',$data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,19 +2,63 @@
|
|||||||
|
|
||||||
namespace App\Controllers;
|
namespace App\Controllers;
|
||||||
|
|
||||||
|
use Config\Services;
|
||||||
|
|
||||||
|
|
||||||
class Home extends BaseController
|
class Home extends BaseController
|
||||||
{
|
{
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
|
// $segments = ['news', 'local', '123'];
|
||||||
|
// echo site_url($segments);
|
||||||
return view('welcome_message');
|
return view('welcome_message');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function startlogin()
|
public function startlogin()
|
||||||
{
|
{
|
||||||
/*Load the URL helper*/
|
$request = \Config\Services::request();
|
||||||
$this->load->helper('url');
|
|
||||||
// return view('welcome_message');
|
if ($request->getMethod() == 'post') {
|
||||||
/*Redirect the user to some internal controller’s method*/
|
$out = [];
|
||||||
redirect('dash');
|
$username = trim($request->getPost('username'));
|
||||||
|
$password = trim($request->getPost('password'));
|
||||||
|
if ($this->loginUser($username, $password, $out) == true) {
|
||||||
|
$segments = ['dash'];
|
||||||
|
return redirect()->to(site_url($segments));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return view('welcome_message');
|
||||||
|
}
|
||||||
|
return view('welcome_message'); // may get here in case of error login
|
||||||
|
}
|
||||||
|
|
||||||
|
private function loginUser($username, $password, &$out)
|
||||||
|
{
|
||||||
|
$loginComplete = false;
|
||||||
|
//entries sent
|
||||||
|
if ($username == '' || $password == '') {
|
||||||
|
$loginComplete = false;
|
||||||
|
$out['error'] = 'All parameters required';
|
||||||
|
}
|
||||||
|
if ($username == 'ameye@chiefsoft.com' && $password == 'may12002') {
|
||||||
|
$loginComplete = true;
|
||||||
|
$out['username'] = 'ameye@chiefsoft.com';
|
||||||
|
$out['firstname'] = 'Olusesan';
|
||||||
|
$out['lastname'] = 'Ameye';
|
||||||
|
$out['uid'] = 'gdgdgdgd-dhdhshdh-gshshshhs-hdhdhuu';
|
||||||
|
$out['id'] = '100';
|
||||||
|
// $_SESSION['bko_session'] = rand(10000,9999999).'-hhdsdyuyu487484398439843jjhjfhjfdhjfdhjfdhj89498498598jfjfhjf';
|
||||||
|
// $_SESSION['bko_user'] = $out;
|
||||||
|
|
||||||
|
Services::session()->set([
|
||||||
|
'bko_user' => $out,
|
||||||
|
'bko_session' => rand(10000,9999999).'-hhdsdyuyu487484398439843jjhjfhjfdhjfdhjfdhj89498498598jfjfhjf',
|
||||||
|
'lastName'=> $out['lastname'],
|
||||||
|
'firstName'=> $out['firstname'],
|
||||||
|
'username'=> $out['username']
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $loginComplete;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-7807
File diff suppressed because it is too large
Load Diff
+1
-7807
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -37,7 +37,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="fv-row mb-10">
|
<div class="fv-row mb-10">
|
||||||
<label class="form-label fs-6 fw-bolder text-dark">Username</label>
|
<label class="form-label fs-6 fw-bolder text-dark">Username</label>
|
||||||
<input class="form-control form-control-lg form-control-solid" type="text" name="email" autocomplete="off" />
|
<input class="form-control form-control-lg form-control-solid" type="text" name="username" autocomplete="off" />
|
||||||
</div>
|
</div>
|
||||||
<div class="fv-row mb-10">
|
<div class="fv-row mb-10">
|
||||||
<div class="d-flex flex-stack mb-2">
|
<div class="d-flex flex-stack mb-2">
|
||||||
|
|||||||
@@ -15,5 +15,9 @@ services:
|
|||||||
- ./apache_log:/var/log/apache2
|
- ./apache_log:/var/log/apache2
|
||||||
ports:
|
ports:
|
||||||
- 7015:80
|
- 7015:80
|
||||||
|
extra_hosts:
|
||||||
|
- backend.wrenchboard.api.live:10.10.33.15
|
||||||
|
- backend.wrenchboard.api.test:10.10.33.15
|
||||||
|
- dev142.bko.myfit.mermsemr.com:10.10.33.15
|
||||||
volumes:
|
volumes:
|
||||||
src:
|
src:
|
||||||
Reference in New Issue
Block a user