mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Arreglos UI
This commit is contained in:
@ -137,6 +137,11 @@ abstract class GoBaseController extends Controller {
|
||||
//--------------------------------------------------------------------
|
||||
// E.g.:
|
||||
$this->session = \Config\Services::session();
|
||||
|
||||
// Language Validate
|
||||
$language = \Config\Services::language();
|
||||
$language->setLocale($this->session->lang);
|
||||
$this->viewData['currentLocale'] = $this->request->getLocale();
|
||||
|
||||
|
||||
if ((!isset($this->viewData['pageTitle']) || empty($this->viewData['pageTitle']) ) && isset(static::$pluralObjectName) && !empty(static::$pluralObjectName)) {
|
||||
@ -169,10 +174,7 @@ abstract class GoBaseController extends Controller {
|
||||
|
||||
// Preload any models, libraries, etc, here.
|
||||
|
||||
|
||||
// Language Validate
|
||||
$language = \Config\Services::language();
|
||||
$language->setLocale($this->session->lang);
|
||||
|
||||
|
||||
// Set TimeZone
|
||||
if(empty($this->session->get('settings'))){
|
||||
@ -194,8 +196,7 @@ abstract class GoBaseController extends Controller {
|
||||
$this->session->set('notification', []);
|
||||
$this->session->set('pulse', 0);
|
||||
}
|
||||
|
||||
$this->viewData['currentLocale'] = $this->request->getLocale();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@ class Home extends BaseController
|
||||
else
|
||||
$salutation = lang("App.dashboard_good_night");
|
||||
|
||||
echo view(getenv('theme.path').'main/all');
|
||||
echo view(getenv('theme.path').'main/all_selects');
|
||||
|
||||
/*
|
||||
//echo view(getenv('theme.path').'main/header');
|
||||
|
||||
@ -30,6 +30,7 @@ class Tarifaacabado extends \App\Controllers\GoBaseController {
|
||||
$this->viewData['usingClientSideDataTable'] = true;
|
||||
|
||||
$this->viewData['pageSubTitle'] = lang('Basic.global.ManageAllRecords', [lang('Tarifaacabado.tarifaacabado')]);
|
||||
|
||||
parent::index();
|
||||
|
||||
}
|
||||
|
||||
@ -16,119 +16,11 @@ class Test extends BaseController
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
$user_model = new UserModel();
|
||||
echo '<pre>';
|
||||
var_dump($user_model->getGroupsTitles('c0bf18621f78cb2ffc4a67cf8d5173c7'));
|
||||
echo '</pre>';
|
||||
|
||||
echo lang('Tarifaacabado.tarifaacabado');
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function validateControllerAccess(){
|
||||
$request = \Config\Services::request();
|
||||
$uri = $uri = new \CodeIgniter\HTTP\URI('https://sk-jjo.imnavajas.es/envioslogistica/logistica');
|
||||
$language = \Config\Services::language();
|
||||
$language->setLocale(session()->lang);
|
||||
|
||||
$getWhiteList = $this->whiteListController();
|
||||
|
||||
foreach ($getWhiteList as $item){
|
||||
if(strtolower($item) == $uri->getSegment(1)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
$getRules = json_decode(session()->get('rules')??'[]');
|
||||
|
||||
foreach ($this->whiteListMethod() as $item){
|
||||
if(strtolower($item) == $uri->getSegment(2)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($getRules as $key=>$value){
|
||||
if($key=='Digitalizacion') {
|
||||
echo 'Hola';
|
||||
}
|
||||
if(strtolower($key) == $uri->getSegment(1)){
|
||||
if($uri->getTotalSegments() <= 1){
|
||||
return true;
|
||||
}
|
||||
foreach ($value as $item){
|
||||
if(strtolower($item) == $uri->getSegment(2)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
foreach($this->controllerFolderWhiteList() as $folder){
|
||||
|
||||
if(strtolower($folder) == $uri->getSegment(1)){
|
||||
|
||||
if(strtolower($key) == $uri->getSegment(2)){
|
||||
if($uri->getTotalSegments() <= 2){
|
||||
return true;
|
||||
}
|
||||
|
||||
foreach ($value as $item){
|
||||
if(strtolower($item) == $uri->getSegment(3)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function whiteListController(){
|
||||
return [
|
||||
'',
|
||||
'BaseController',
|
||||
'Home',
|
||||
'Login',
|
||||
'Oauth',
|
||||
'Language',
|
||||
'Api',
|
||||
'Cron',
|
||||
'lang',
|
||||
'Ajax',
|
||||
'Integration',
|
||||
'Migrate',
|
||||
'Test',
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
public function whiteListMethod(){
|
||||
return [
|
||||
'initController',
|
||||
'__construct',
|
||||
'validateControllerAccess',
|
||||
'whiteListController',
|
||||
'whiteListMethod'
|
||||
];
|
||||
}
|
||||
|
||||
public function controllerFolderWhiteList(){
|
||||
return [
|
||||
'Catalogo',
|
||||
'Clientes',
|
||||
'Configuracion',
|
||||
'Digitalizacion',
|
||||
'Facturacion',
|
||||
'Informes',
|
||||
'EnviosLogistica',
|
||||
'Pedidos',
|
||||
'Presupuestos',
|
||||
'Produccion',
|
||||
'Proveedores',
|
||||
'Tarifas',
|
||||
'Usuarios',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user