Forked from huglester/roundcube_mail_disable_csrf_on_login.php
Last active
August 29, 2015 14:23
-
-
Save alexandregz/ba62ab46c3723cb1f974 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Install: | |
1) create a folder: disablecsrf inside 'plugins/' directory. | |
2) place this file there and name it: disablecsrf.php | |
3) go to config/config.inc.php, and add it to plugins, like: | |
$config['plugins'] = array('disablecsrf'); | |
CSRF should now be disabled for login. | |
*/ | |
/** | |
* Sample plugin to disable csrf for RoundCube mail (tested only on 1.0.3) | |
* | |
* @license MIT | |
* @author huglester@gmail.com | |
*/ | |
class disablecsrf extends rcube_plugin | |
{ | |
public $task = 'login'; | |
function init() | |
{ | |
$this->add_hook('authenticate', array($this, 'authenticate')); | |
} | |
function authenticate($args) | |
{ | |
$args['valid'] = true; | |
return $args; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment