New project page
This commit is contained in:
+2
-2
@@ -23,7 +23,7 @@ class App extends BaseConfig
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $baseURL = 'http://localhost:8080/';
|
||||
public $baseURL = 'http://localhost:7072/';
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
@@ -36,7 +36,7 @@ class App extends BaseConfig
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $indexPage = 'index.php';
|
||||
public $indexPage = '';
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
|
||||
@@ -34,11 +34,11 @@ $routes->setAutoRoute(true);
|
||||
$routes->get('/', 'Home::index');
|
||||
|
||||
|
||||
$routes->get('/projects', 'Home::projectstart');
|
||||
$routes->get('/projects', 'Home::projectstart');
|
||||
|
||||
$routes->get('/startproject', 'Projects::start');
|
||||
$routes->post('/startproject', 'Projects::start');
|
||||
$routes->get('/projects/dash', 'Projects::start');
|
||||
$routes->get('/projects/dash', 'ProjectPages::projectView');
|
||||
|
||||
/*
|
||||
* --------------------------------------------------------------------
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controllers;
|
||||
|
||||
use CodeIgniter\Controller;
|
||||
use CodeIgniter\HTTP\CLIRequest;
|
||||
use CodeIgniter\HTTP\IncomingRequest;
|
||||
use CodeIgniter\HTTP\RequestInterface;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
/**
|
||||
* Class BaseController
|
||||
*
|
||||
* BaseController provides a convenient place for loading components
|
||||
* and performing functions that are needed by all your controllers.
|
||||
* Extend this class in any new controllers:
|
||||
* class Home extends BaseController
|
||||
*
|
||||
* For security be sure to declare any new methods as protected or private.
|
||||
*/
|
||||
class ProjectBaseController extends Controller
|
||||
{
|
||||
/**
|
||||
* Instance of the main Request object.
|
||||
*
|
||||
* @var CLIRequest|IncomingRequest
|
||||
*/
|
||||
protected $request;
|
||||
|
||||
/**
|
||||
* An array of helpers to be loaded automatically upon
|
||||
* class instantiation. These helpers will be available
|
||||
* to all other controllers that extend BaseController.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $helpers = [];
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||
{
|
||||
// Do Not Edit This Line
|
||||
parent::initController($request, $response, $logger);
|
||||
|
||||
// Preload any models, libraries, etc, here.
|
||||
|
||||
// E.g.: $this->session = \Config\Services::session();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controllers;
|
||||
|
||||
class ProjectPages extends ProjectBaseController
|
||||
{
|
||||
protected $session;
|
||||
function __construct()
|
||||
{
|
||||
$this->session = \Config\Services::session();
|
||||
}
|
||||
public function index()
|
||||
{
|
||||
// return view('projects/index');
|
||||
}
|
||||
|
||||
public function projectView()
|
||||
{
|
||||
$data=[];
|
||||
|
||||
return view('projects/projpage',$data);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,8 +2,15 @@
|
||||
|
||||
namespace App\Controllers;
|
||||
|
||||
//$session = \Config\Services::session();
|
||||
class Projects extends BaseController
|
||||
{
|
||||
protected $session;
|
||||
function __construct()
|
||||
{
|
||||
$this->session = \Config\Services::session();
|
||||
$this->session->start();
|
||||
}
|
||||
public function index()
|
||||
{
|
||||
return view('projects/index');
|
||||
@@ -12,13 +19,18 @@ class Projects extends BaseController
|
||||
public function start()
|
||||
{
|
||||
$request = \Config\Services::request();
|
||||
log_message('critical', "Projects-Entered 0" );
|
||||
|
||||
if ($request->getMethod() == 'post') {
|
||||
log_message('critical', "Projects-Entered 1" );
|
||||
$out = [];
|
||||
$username = trim($request->getPost('username'));
|
||||
$username = trim($request->getPost('email'));
|
||||
$password = trim($request->getPost('password'));
|
||||
log_message('critical', "Projects-Entered 1 username->".$username );
|
||||
log_message('critical', "Projects-Entered 1 password->".$password );
|
||||
if ($this->loginUser($username, $password, $out) == true) {
|
||||
$segments = ['dash'];
|
||||
log_message('critical', "Projects-Entered 2" );
|
||||
$segments = ['/projects/dash'];
|
||||
return redirect()->to(site_url($segments));
|
||||
}
|
||||
} else {
|
||||
@@ -46,7 +58,7 @@ class Projects extends BaseController
|
||||
// $_SESSION['bko_session'] = rand(10000,9999999).'-hhdsdyuyu487484398439843jjhjfhjfdhjfdhjfdhj89498498598jfjfhjf';
|
||||
// $_SESSION['bko_user'] = $out;
|
||||
|
||||
Services::session()->set([
|
||||
$this->session->set([
|
||||
'bko_user' => $out,
|
||||
'bko_session' => rand(10000,9999999).'-hhdsdyuyu487484398439843jjhjfhjfdhjfdhjfdhj89498498598jfjfhjf',
|
||||
'lastName'=> $out['lastname'],
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
We got here
|
||||
Reference in New Issue
Block a user