I have a system on the production server which I want to emulate in local to update it but the previous programmer have use a strange architecture. There is a codeigniter architecture and another one inside the first...
- application
- admin (which content controller and models... probably unused)
- common (language and models...)
- controllers
- js (why here...)
- kanri
- cache, config, controllers, core, helpers, models, views, ...
- user
- cache, config, controllers, core, helpers, models, views, ...
- system
- etc...
I had a lot of fun to emulate this on my local machine because all path are absolute, yeepee.
So currently, it's on my localhost, correctly configurated but when I try to login, the page just reload. I found out the method login of the controller login (so kanri/login/login) is called but always routed to kanri/login/index.
On the index page, there is only a form which redirect to the kanri/login/login method, so even the simple redirection do not work.
The file kanri/route.php :
defined('BASEPATH') OR exit('No direct script access allowed');
$route['default_controller'] = 'login';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;
The main .htaccess :
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^kanri(/(.*))?$ kanri.php?/$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^user(/(.*))?$ user.php?/$2 [L]
</IfModule>
MY_Controller :
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class MY_Controller extends CI_Controller {
public function __construct()
{
parent::__construct();
if($this->session->userdata('flag_admin_login')===FALSE || empty($this->session->userdata('flag_admin_login'))){
//print "***".$this->session->userdata('member_id')."!!!!!";
redirect('/', 'refresh');
}
}
}
My Login controller :
class Login extends CI_Controller {
public function __construct()
{
parent::__construct();
echo $this->router->fetch_class() . "<br/>"; // display the controller
echo $this->router->fetch_method() . "<br/>"; //display the method
}
public function index(){
//all code commented
}
public function login(){
//all code commented
}
}
I have a lot to work to do on it and I'm still stuck on the running... Thanks for your time!
MX_Controller? - Alex