Welcome Guest, Not a member yet? Register   Sign In
How to disable CSRF temporaly for callback controllers ?
#26

[eluser]jonez[/eluser]
Another alternative using hooks. CSRF is disabled by default, use URL checks to enable for specific paths.

config/hooks.php
Code:
$hook['pre_system'][] = array(
'function' => 'check_csrf',
'filename' => 'csrf.php',
'filepath' => 'hooks',
);

hooks/csrf.php
Code:
function check_csrf( ) {
$segments = explode( '/', trim( parse_url( $_SERVER[ 'REQUEST_URI' ], PHP_URL_PATH ), '/' ) );

if ( ... ) {
  $config =& load_class( 'Config', 'core' );
  $config->set_item( 'csrf_protection', true );
}
}


Messages In This Thread
How to disable CSRF temporaly for callback controllers ? - by El Forum - 06-24-2014, 05:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB