Merge branch '2.5' into 2.6

This commit is contained in:
mark_story 2014-05-11 21:47:42 -04:00
commit d0b995ad79
4 changed files with 29 additions and 2 deletions

View file

@ -776,6 +776,10 @@ class AuthComponent extends Component {
unset($config[AuthComponent::ALL]);
}
foreach ($config as $class => $settings) {
if (!empty($settings['className'])) {
$class = $settings['className'];
unset($settings['className']);
}
list($plugin, $class) = pluginSplit($class, true);
$className = $class . 'Authenticate';
App::uses($className, $plugin . 'Controller/Component/Auth');

View file

@ -287,7 +287,7 @@ class Configure {
* @param string $key name of configuration resource to load.
* @param string $config Name of the configured reader to use to read the resource identified by $key.
* @param boolean $merge if config files should be merged instead of simply overridden
* @return mixed false if file not found, void if load successful.
* @return boolean False if file not found, true if load successful.
* @throws ConfigureException Will throw any exceptions the reader raises.
*/
public static function load($key, $config = 'default', $merge = true) {
@ -424,6 +424,7 @@ class Configure {
self::$_values = array();
return true;
}
/**
* Set the error and exception handlers.
*
@ -444,4 +445,5 @@ class Configure {
set_exception_handler($exception['handler']);
}
}
}

View file

@ -208,7 +208,7 @@ class Sqlserver extends DboSource {
}
$fields = array();
$schema = $model->schemaName;
$schema = is_object($model) ? $model->schemaName : false;
$cols = $this->_execute(
"SELECT

View file

@ -590,6 +590,27 @@ class AuthComponentTest extends CakeTestCase {
$this->assertEquals('AuthUser', $result->settings['userModel']);
}
/**
* test defining the same Authenticate object but with different password hashers
*
* @return void
*/
public function testSameAuthenticateWithDifferentHashers() {
$this->Controller->Auth->authenticate = array(
'FormSimple' => array('className' => 'Form', 'passwordHasher' => 'Simple'),
'FormBlowfish' => array('className' => 'Form', 'passwordHasher' => 'Blowfish'),
);
$objects = $this->Controller->Auth->constructAuthenticate();
$this->assertEquals(2, count($objects));
$this->assertInstanceOf('FormAuthenticate', $objects[0]);
$this->assertInstanceOf('FormAuthenticate', $objects[1]);
$this->assertInstanceOf('SimplePasswordHasher', $objects[0]->passwordHasher());
$this->assertInstanceOf('BlowfishPasswordHasher', $objects[1]->passwordHasher());
}
/**
* Tests that deny always takes precedence over allow
*