Skip to content

Commit 34d78ae

Browse files
author
Chris Kacerguis
committed
1 parent 0939dbe commit 34d78ae

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

application/libraries/REST_Controller.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,12 +1257,16 @@ protected function _perform_library_auth($username = '', $password = null)
12571257
* @param string $password The user's password
12581258
* @return boolean
12591259
*/
1260-
protected function _check_login($username = '', $password = null)
1260+
protected function _check_login($username = '', $password = false)
12611261
{
12621262
if (empty($username)) {
12631263
return false;
12641264
}
12651265

1266+
if ($password === false) {
1267+
return false;
1268+
}
1269+
12661270
$auth_source = strtolower($this->config->item('auth_source'));
12671271

12681272
if ($auth_source == 'ldap') {
@@ -1279,12 +1283,11 @@ protected function _check_login($username = '', $password = null)
12791283

12801284
$valid_logins = $this->config->item('rest_valid_logins');
12811285

1282-
if ( ! array_key_exists($username, $valid_logins)) {
1286+
if (!array_key_exists($username, $valid_logins)) {
12831287
return false;
12841288
}
12851289

1286-
// If actually null (not empty string) then do not check it
1287-
if ($password === null and $valid_logins[$username] != $password) {
1290+
if ($valid_logins[$username] != $password) {
12881291
return false;
12891292
}
12901293

0 commit comments

Comments
 (0)