Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix DigestAuthenticate component userModel setting #3001

Merged
merged 1 commit into from

3 participants

@vekakela

DigestAuthenticate component's userModel setting incorrectly defaulted
to User instead of Users. Fixes issue #2998.

@vekakela vekakela Fix DigestAuthenticate component userModel setting
DigestAuthenticate component's userModel setting incorrectly defaulted
to User instead of Users.
1e9bcbb
@ADmad ADmad merged commit 135c4e5 into from
@ADmad
Collaborator

Thanks.

@markstory markstory added this to the 3.0.0 milestone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 11, 2014
  1. @vekakela

    Fix DigestAuthenticate component userModel setting

    vekakela authored
    DigestAuthenticate component's userModel setting incorrectly defaulted
    to User instead of Users.
This page is out of date. Refresh to see the latest.
View
4 src/Controller/Component/Auth/DigestAuthenticate.php
@@ -64,7 +64,7 @@ class DigestAuthenticate extends BasicAuthenticate {
* Settings for this object.
*
* - `fields` The fields to use to identify a user by.
- * - `userModel` The model name of the User, defaults to User.
+ * - `userModel` The model name of the User, defaults to Users.
* - `scope` Additional conditions to use when looking up and authenticating users,
* i.e. `array('User.is_active' => 1).`
* - `recursive` The value of the recursive key passed to find(). Defaults to 0.
@@ -82,7 +82,7 @@ class DigestAuthenticate extends BasicAuthenticate {
'username' => 'username',
'password' => 'password'
),
- 'userModel' => 'User',
+ 'userModel' => 'Users',
'scope' => array(),
'recursive' => 0,
'contain' => null,
View
6 tests/TestCase/Controller/Component/Auth/DigestAuthenticateTest.php
@@ -46,8 +46,6 @@ public function setUp() {
$this->Collection = $this->getMock('Cake\Controller\ComponentRegistry');
$this->auth = new DigestAuthenticate($this->Collection, array(
- 'fields' => array('username' => 'username', 'password' => 'password'),
- 'userModel' => 'Users',
'realm' => 'localhost',
'nonce' => 123,
'opaque' => '123abc'
@@ -68,11 +66,11 @@ public function setUp() {
public function testConstructor() {
$object = new DigestAuthenticate($this->Collection, array(
'userModel' => 'AuthUser',
- 'fields' => array('username' => 'user', 'password' => 'password'),
+ 'fields' => array('username' => 'user', 'password' => 'pass'),
'nonce' => 123456
));
$this->assertEquals('AuthUser', $object->settings['userModel']);
- $this->assertEquals(array('username' => 'user', 'password' => 'password'), $object->settings['fields']);
+ $this->assertEquals(array('username' => 'user', 'password' => 'pass'), $object->settings['fields']);
$this->assertEquals(123456, $object->settings['nonce']);
$this->assertEquals(env('SERVER_NAME'), $object->settings['realm']);
}
Something went wrong with that request. Please try again.