Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From 1e135cce95489e8efa71b10b3d7ded4859830f20 Mon Sep 17 00:00:00 2001
- From: Ruben Herold <ruben@puettmann.net>
- Date: Mon, 26 Mar 2012 10:43:07 +0200
- Subject: [PATCH] Add support for auth digest with savemode enabled
- ---
- application/libraries/REST_Controller.php | 8 +++++++-
- 1 files changed, 7 insertions(+), 1 deletions(-)
- diff --git a/application/libraries/REST_Controller.php b/application/libraries/REST_Controller.php
- index b6b024d..7072a61 100644
- --- a/application/libraries/REST_Controller.php
- +++ b/application/libraries/REST_Controller.php
- @@ -808,6 +808,12 @@ class REST_Controller extends CI_Controller {
- $valid_pass = $valid_logins[$digest['username']];
- // This is the valid response expected
- + if (6 > (int)PHP_VERSION //safe_mode will be removed in PHP 6.0
- + && (int)ini_get("safe_mode") !== 0) {
- + $A1 = md5($digest['username'] . ':' . $this->config->item('rest_realm')."-".getmyuid() . ':' . $valid_pass);
- + }else{
- + $A1 = md5($digest['username'] . ':' . $this->config->item('rest_realm') . ':' . $valid_pass);
- + }
- $A1 = md5($digest['username'] . ':' . $this->config->item('rest_realm') . ':' . $valid_pass);
- $A2 = md5(strtoupper($this->request->method) . ':' . $digest['uri']);
- $valid_response = md5($A1 . ':' . $digest['nonce'] . ':' . $digest['nc'] . ':' . $digest['cnonce'] . ':' . $digest['qop'] . ':' . $A2);
- @@ -873,4 +879,4 @@ class REST_Controller extends CI_Controller {
- {
- return $this->get('callback') . '(' . json_encode($data) . ')';
- }
- -}
- \ No newline at end of file
- +}
- --
- 1.7.8.3
Add Comment
Please, Sign In to add comment