naming consistency of attribute (#2096)
This commit is contained in:
parent
a3158fcc97
commit
e953a04f61
|
@ -33,30 +33,31 @@ class HostController extends AppController {
|
||||||
function getCredentials() {
|
function getCredentials() {
|
||||||
// ignore debug warnings from other functions
|
// ignore debug warnings from other functions
|
||||||
$this->view='Json';
|
$this->view='Json';
|
||||||
|
$credentials = "";
|
||||||
$appendPassword = 0;
|
$appendPassword = 0;
|
||||||
|
|
||||||
$this->loadModel('Config');
|
$this->loadModel('Config');
|
||||||
$isZmAuth = $this->Config->find('first',array('conditions' => array('Config.' . $this->Config->primaryKey => 'ZM_OPT_USE_AUTH')))['Config']['Value'];
|
$isZmAuth = $this->Config->find('first',array('conditions' => array('Config.' . $this->Config->primaryKey => 'ZM_OPT_USE_AUTH')))['Config']['Value'];
|
||||||
$authVal = "";
|
|
||||||
if ($isZmAuth) {
|
if ($isZmAuth) {
|
||||||
$zmAuthRelay = $this->Config->find('first',array('conditions' => array('Config.' . $this->Config->primaryKey => 'ZM_AUTH_RELAY')))['Config']['Value'];
|
$zmAuthRelay = $this->Config->find('first',array('conditions' => array('Config.' . $this->Config->primaryKey => 'ZM_AUTH_RELAY')))['Config']['Value'];
|
||||||
if ($zmAuthRelay == 'hashed') {
|
if ($zmAuthRelay == 'hashed') {
|
||||||
|
|
||||||
$zmAuthHashIps= $this->Config->find('first',array('conditions' => array('Config.' . $this->Config->primaryKey => 'ZM_AUTH_HASH_IPS')))['Config']['Value'];
|
$zmAuthHashIps= $this->Config->find('first',array('conditions' => array('Config.' . $this->Config->primaryKey => 'ZM_AUTH_HASH_IPS')))['Config']['Value'];
|
||||||
$authVal = 'auth='.generateAuthHash($zmAuthHashIps);
|
$credentials = 'auth='.generateAuthHash($zmAuthHashIps);
|
||||||
}
|
}
|
||||||
elseif ($zmAuthRelay == 'plain') {
|
elseif ($zmAuthRelay == 'plain') {
|
||||||
// user will need to append the store password here
|
// user will need to append the store password here
|
||||||
$authVal = "user=".$this->Session->read('user.Username')."&pass=";
|
$credentials = "user=".$this->Session->read('user.Username')."&pass=";
|
||||||
$appendPassword = 1;
|
$appendPassword = 1;
|
||||||
}
|
}
|
||||||
elseif ($zmAuthRelay == 'none') {
|
elseif ($zmAuthRelay == 'none') {
|
||||||
$authVal = "user=".$this->Session->read('user.Username');
|
$credentials = "user=".$this->Session->read('user.Username');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->set(array(
|
$this->set(array(
|
||||||
'auth_key'=> $authVal,
|
'credentials'=> $credentials,
|
||||||
'append_password'=>$appendPassword,
|
'append_password'=>$appendPassword,
|
||||||
'_serialize' => array('auth_key', 'append_password')
|
'_serialize' => array('credentials', 'append_password')
|
||||||
) );
|
) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue