From fbd798da6c049bf7526a6adb0e013696c9af36ca Mon Sep 17 00:00:00 2001 From: mark_story Date: Sun, 6 Feb 2011 16:59:47 -0500 Subject: [PATCH] Reordering parameters to make it easier to remember the order. --- cake/libs/controller/components/auth/digest_authenticate.php | 4 +++- .../controller/components/auth/digest_authenticate.test.php | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cake/libs/controller/components/auth/digest_authenticate.php b/cake/libs/controller/components/auth/digest_authenticate.php index 26272894c53..cde347110d2 100644 --- a/cake/libs/controller/components/auth/digest_authenticate.php +++ b/cake/libs/controller/components/auth/digest_authenticate.php @@ -231,10 +231,12 @@ public function generateResponseHash($digest, $password) { /** * Creates an auth digest password hash to store * + * @param string $username The username to use in the digest hash. * @param string $password The unhashed password to make a digest hash for. + * @param string $realm The realm the password is for. * @return string the hashed password that can later be used with Digest authentication. */ - public static function password($username, $realm, $password) { + public static function password($username, $password, $realm) { return md5($username . ':' . $realm . ':' . $password); } diff --git a/cake/tests/cases/libs/controller/components/auth/digest_authenticate.test.php b/cake/tests/cases/libs/controller/components/auth/digest_authenticate.test.php index 1ef4ccc5f8b..16b17589018 100644 --- a/cake/tests/cases/libs/controller/components/auth/digest_authenticate.test.php +++ b/cake/tests/cases/libs/controller/components/auth/digest_authenticate.test.php @@ -47,7 +47,7 @@ function setUp() { 'opaque' => '123abc' )); - $password = DigestAuthenticate::password('mariano', 'localhost', 'cake'); + $password = DigestAuthenticate::password('mariano', 'cake', 'localhost'); ClassRegistry::init('User')->updateAll(array('password' => '"' . $password . '"')); $_SERVER['REQUEST_METHOD'] = 'GET'; @@ -296,7 +296,7 @@ function testParseAuthEmailAddress() { * @return void */ function testPassword() { - $result = DigestAuthenticate::password('mark', 'localhost', 'password'); + $result = DigestAuthenticate::password('mark', 'password', 'localhost'); $expected = md5('mark:localhost:password'); $this->assertEquals($expected, $result); }