Skip to content

Commit 256481f

Browse files
Merge pull request chriskacerguis#563 from ares242/master
Session auth override
2 parents bb0850e + ecec95f commit 256481f

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

application/libraries/REST_Controller.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,6 +1188,14 @@ protected function _auth_override_check()
11881188
return TRUE;
11891189
}
11901190

1191+
// Session auth override found, check session
1192+
if ($auth_override_class_method[$this->router->class]['*'] === 'session')
1193+
{
1194+
$this->_check_php_session();
1195+
1196+
return TRUE;
1197+
}
1198+
11911199
// Whitelist auth override found, check client's ip against config whitelist
11921200
if ($auth_override_class_method[$this->router->class]['*'] === 'whitelist')
11931201
{
@@ -1222,6 +1230,14 @@ protected function _auth_override_check()
12221230
return TRUE;
12231231
}
12241232

1233+
// Session auth override found, check session
1234+
if ($auth_override_class_method[$this->router->class][$this->router->method] === 'session')
1235+
{
1236+
$this->_check_php_session();
1237+
1238+
return TRUE;
1239+
}
1240+
12251241
// Whitelist auth override found, check client's ip against config whitelist
12261242
if ($auth_override_class_method[$this->router->class][$this->router->method] === 'whitelist')
12271243
{
@@ -1263,6 +1279,14 @@ protected function _auth_override_check()
12631279
return TRUE;
12641280
}
12651281

1282+
// Session auth override found, check session
1283+
if ($auth_override_class_method_http[$this->router->class]['*'][$this->request->method] === 'session')
1284+
{
1285+
$this->_check_php_session();
1286+
1287+
return TRUE;
1288+
}
1289+
12661290
// Whitelist auth override found, check client's ip against config whitelist
12671291
if ($auth_override_class_method_http[$this->router->class]['*'][$this->request->method] === 'whitelist')
12681292
{
@@ -1297,6 +1321,14 @@ protected function _auth_override_check()
12971321
return TRUE;
12981322
}
12991323

1324+
// Session auth override found, check session
1325+
if ($auth_override_class_method_http[$this->router->class][$this->router->method][$this->request->method] === 'session')
1326+
{
1327+
$this->_check_php_session();
1328+
1329+
return TRUE;
1330+
}
1331+
13001332
// Whitelist auth override found, check client's ip against config whitelist
13011333
if ($auth_override_class_method_http[$this->router->class][$this->router->method][$this->request->method] === 'whitelist')
13021334
{

0 commit comments

Comments
 (0)