• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can i move force_https in before filter

#1
How can i move force_https in before filter ? I wan't remove this force_https from system/Controller.php and i want add in filter.
I created an login sistem in filters where i recive informations from $_POST. In this case the redirect to https it will be done after i checked some informations from $_POST. I want first the redirect to be done.

I tried this but didn't work. app/GlobalFilter.php

PHP Code:
<?php namespace App\Filters;
use 
CodeIgniter\Filters\FilterInterface;
use 
CodeIgniter\HTTP\RequestInterface;
use 
CodeIgniter\HTTP\ResponseInterface

class 
GlobalFilter implements FilterInterface {
    
    protected 
$session;
    
    public function 
before(RequestInterface $requestResponseInterface $response) {

        
force_https(31536000$request$response);
    
   
    
}
    
    public function 
after(RequestInterface $requestResponseInterface $response) {
       
    
}
   


How can i override system/Controller.php ?
I tried copy this system/Controller.php in app/Controller.php folder but didn't work for me
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.