This commit is contained in:
2023-01-22 10:19:05 -05:00
parent e880b389be
commit 4b714c182d
9 changed files with 7865 additions and 15623 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ class App extends BaseConfig
*
* @var string
*/
public $baseURL = 'http://localhost:8080/';
public $baseURL = 'https://dev142.bko.myfit.mermsemr.com/'; //'http://localhost:8080/';
/**
* --------------------------------------------------------------------------
+2
View File
@@ -37,9 +37,11 @@ $routes->set404Override();
// route since we don't have to scan directories.
$routes->get('/', 'Home::index');
$routes->get('dash', 'Dash::index');
$routes->post('dash', 'Dash::index');
$routes->get('contacts', 'Dash::contacts');
$routes->post('startlogin', 'Home::startlogin');
$routes->get('startlogin', 'Home::startlogin');
/*
* --------------------------------------------------------------------
* Additional Routing
+4 -2
View File
@@ -6,11 +6,13 @@ class Dash extends BaseController
{
public function index()
{
return view('bko/dash');
$data['page_title'] ='Dashboard';
return view('bko/dash',$data);
}
public function contacts(){
return view('bko/contacts');
$data['page_title'] ='Contacts';
return view('bko/contacts',$data);
}
+49 -5
View File
@@ -2,19 +2,63 @@
namespace App\Controllers;
use Config\Services;
class Home extends BaseController
{
public function index()
{
// $segments = ['news', 'local', '123'];
// echo site_url($segments);
return view('welcome_message');
}
public function startlogin()
{
/*Load the URL helper*/
$this->load->helper('url');
// return view('welcome_message');
/*Redirect the user to some internal controllers method*/
redirect('dash');
$request = \Config\Services::request();
if ($request->getMethod() == 'post') {
$out = [];
$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;
}
}
File diff suppressed because it is too large Load Diff
+1 -7807
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -37,7 +37,7 @@
</div>
<div class="fv-row mb-10">
<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 class="fv-row mb-10">
<div class="d-flex flex-stack mb-2">
+4
View File
@@ -15,5 +15,9 @@ services:
- ./apache_log:/var/log/apache2
ports:
- 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:
src: