Skip to content

Commit

Permalink
Merge branch '2.5' into 2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed May 12, 2014
2 parents 4f0845d + 63ab865 commit d0b995a
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
4 changes: 4 additions & 0 deletions lib/Cake/Controller/Component/AuthComponent.php
Expand Up @@ -776,6 +776,10 @@ public function constructAuthenticate() {
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');
Expand Down
4 changes: 3 additions & 1 deletion lib/Cake/Core/Configure.php
Expand Up @@ -287,7 +287,7 @@ public static function drop($name) {
* @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) {
Expand Down Expand Up @@ -424,6 +424,7 @@ public static function clear() {
self::$_values = array();
return true;
}

/**
* Set the error and exception handlers.
*
Expand All @@ -444,4 +445,5 @@ protected static function _setErrorHandlers($error, $exception) {
set_exception_handler($exception['handler']);
}
}

}
2 changes: 1 addition & 1 deletion lib/Cake/Model/Datasource/Database/Sqlserver.php
Expand Up @@ -208,7 +208,7 @@ public function describe($model) {
}

$fields = array();
$schema = $model->schemaName;
$schema = is_object($model) ? $model->schemaName : false;

$cols = $this->_execute(
"SELECT
Expand Down
21 changes: 21 additions & 0 deletions lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php
Expand Up @@ -590,6 +590,27 @@ public function testAllConfigWithAuthenticate() {
$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
*
Expand Down

0 comments on commit d0b995a

Please sign in to comment.