message_die(GENERAL_ERROR, "YubiCloud authentication not configured. Add \$Config['YubiCloud']['ClientID'] and \$Config['YubiCloud']['SecretKey'] to your config.");
}
if (!$key = $_GET['OTP']) message_die(GENERAL_ERROR, "Please add in URL ?OTP=, then put your cursor at right of the = and press your YubiKey button");
$yubi = new Auth_Yubico($Config['YubiCloud']['ClientID'], $Config['YubiCloud']['SecreyKey']);
if (!$data = $yubi->parsePasswordOTP($key)) {
message_die(GENERAL_ERROR, "This is not an YubiKey OTP.");
}
$prefix = $data['prefix'];
$auth = $yubi->verify($key);
if (@PEAR::isError($auth)) {
if ($auth->getMessage() == 'REPLAYED_OTP') message_die("This OTP has already been used.");
* Gets the cache instance, initializing it if needed
- *
+ *
* @return Cache the cache instance, or null if nothing is cached
*/
- static function load () {
+ static function load () {
//Checks extension is okay
if (!extension_loaded('memcached')) {
if (extension_loaded('memcache')) {
message_die(GENERAL_ERROR, "Can't initialize $engine cache engine.<br />PHP extension memcached not loaded.<br /><strong>!!! This class uses the Memcached extension AND NOT the Memcache extension (this one is loaded) !!!</strong>", 'Cache');
+ if (array_key_exists('SASL', $Config['cache']) && $Config['cache']['SASL']) {
+ if (!method_exists(self::$instance->memcached, 'setSaslAuthData')) {
+ message_die(GENERAL_ERROR, "Can't initialize $engine cache engine.<br />PHP extension memcached were compiled without SASL support.<br /> SASL authentication support is disabled by default. To enable it, recompile the PECL memcached extension using --enable-memcached-sasl switch. This requires that libsasl2 has been installed and that libmemcached has been built with SASL support enabled.", 'Cache');