From e6b8a7bc66d7b18ea7ce87dfef9833250aab6f98 Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Thu, 29 Nov 2018 09:21:10 -0500 Subject: [PATCH] resolves #2327 --- web/api/app/Controller/HostController.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/web/api/app/Controller/HostController.php b/web/api/app/Controller/HostController.php index 017bce798..d4e19fd77 100644 --- a/web/api/app/Controller/HostController.php +++ b/web/api/app/Controller/HostController.php @@ -65,18 +65,17 @@ class HostController extends AppController { $isZmAuth = $this->Config->find('first',array('conditions' => array('Config.' . $this->Config->primaryKey => 'ZM_OPT_USE_AUTH')))['Config']['Value']; if ( $isZmAuth ) { + // In future, we may want to completely move to AUTH_HASH_LOGINS and return &auth= for all cases require_once "../../../includes/auth.php"; # in the event we directly call getCredentials.json $this->Session->read('user'); # this is needed for command line/curl to recognize a session $zmAuthRelay = $this->Config->find('first',array('conditions' => array('Config.' . $this->Config->primaryKey => 'ZM_AUTH_RELAY')))['Config']['Value']; if ( $zmAuthRelay == 'hashed' ) { $zmAuthHashIps = $this->Config->find('first',array('conditions' => array('Config.' . $this->Config->primaryKey => 'ZM_AUTH_HASH_IPS')))['Config']['Value']; $credentials = 'auth='.generateAuthHash($zmAuthHashIps); - } else if ( $zmAuthRelay == 'plain' ) { + } else { // user will need to append the store password here $credentials = 'user='.$this->Session->read('user.Username').'&pass='; $appendPassword = 1; - } else if ( $zmAuthRelay == 'none' ) { - $credentials = 'user='.$this->Session->read('user.Username'); } } return array($credentials, $appendPassword);