Merge branch 'hotfix-2.3.63'

pull/484/head v2.3.63
iglocska 2015-05-04 19:03:13 +02:00
commit ed22d14d6b
3 changed files with 10 additions and 3 deletions

View File

@ -12,6 +12,7 @@ Contributions from: (incomplete list, contact us to add your name)
Copyright Christophe Vandeplas
Copyright Belgian Defence
Copyright NATO / NCIRC
Copyright Andras Iklody
This code is licensed under the GNU AFFERO GENERAL PUBLIC LICENSE version 3.

View File

@ -1 +1 @@
{"major":2, "minor":3, "hotfix":62}
{"major":2, "minor":3, "hotfix":63}

View File

@ -87,10 +87,16 @@ class AppController extends Controller {
// disable CSRF for REST access
if (array_key_exists('Security', $this->components))
$this->Security->csrfCheck = false;
// Authenticate user with authkey in Authorization HTTP header
if (!empty($_SERVER['HTTP_AUTHORIZATION'])) {
$user = $this->checkAuthUser($_SERVER['HTTP_AUTHORIZATION']);
$authentication = explode(',', $_SERVER['HTTP_AUTHORIZATION']);
$user = false;
foreach ($authentication as $auth_key) {
if (preg_match('/^[a-zA-Z0-9]{40}$/', trim($auth_key))) {
$user = $this->checkAuthUser(trim($auth_key));
continue;
}
}
if ($user) {
// User found in the db, add the user info to the session
$this->Session->renew();