Fix adding auth string screwing up url to remote api in zmaControl and zmcControl
This commit is contained in:
parent
9febf60228
commit
7787ba1040
|
@ -284,12 +284,12 @@ class Monitor extends ZM_Object {
|
||||||
$url = $Server->UrlToApi().'/monitors/daemonControl/'.$this->{'Id'}.'/'.$mode.'/zmc.json';
|
$url = $Server->UrlToApi().'/monitors/daemonControl/'.$this->{'Id'}.'/'.$mode.'/zmc.json';
|
||||||
if ( ZM_OPT_USE_AUTH ) {
|
if ( ZM_OPT_USE_AUTH ) {
|
||||||
if ( ZM_AUTH_RELAY == 'hashed' ) {
|
if ( ZM_AUTH_RELAY == 'hashed' ) {
|
||||||
$url .= '?auth='.generateAuthHash( ZM_AUTH_HASH_IPS );
|
$url .= '?auth='.generateAuthHash(ZM_AUTH_HASH_IPS);
|
||||||
} elseif ( ZM_AUTH_RELAY == 'plain' ) {
|
} elseif ( ZM_AUTH_RELAY == 'plain' ) {
|
||||||
$url = '?user='.$_SESSION['username'];
|
$url .= '?user='.$_SESSION['username'];
|
||||||
$url = '?pass='.$_SESSION['password'];
|
$url .= '?pass='.$_SESSION['password'];
|
||||||
} elseif ( ZM_AUTH_RELAY == 'none' ) {
|
} elseif ( ZM_AUTH_RELAY == 'none' ) {
|
||||||
$url = '?user='.$_SESSION['username'];
|
$url .= '?user='.$_SESSION['username'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Logger::Debug("sending command to $url");
|
Logger::Debug("sending command to $url");
|
||||||
|
@ -342,12 +342,12 @@ class Monitor extends ZM_Object {
|
||||||
$url = ZM_BASE_PROTOCOL . '://'.$Server->Hostname().'/zm/api/monitors/daemonControl/'.$this->{'Id'}.'/'.$mode.'/zma.json';
|
$url = ZM_BASE_PROTOCOL . '://'.$Server->Hostname().'/zm/api/monitors/daemonControl/'.$this->{'Id'}.'/'.$mode.'/zma.json';
|
||||||
if ( ZM_OPT_USE_AUTH ) {
|
if ( ZM_OPT_USE_AUTH ) {
|
||||||
if ( ZM_AUTH_RELAY == 'hashed' ) {
|
if ( ZM_AUTH_RELAY == 'hashed' ) {
|
||||||
$url .= '?auth='.generateAuthHash( ZM_AUTH_HASH_IPS );
|
$url .= '?auth='.generateAuthHash(ZM_AUTH_HASH_IPS);
|
||||||
} elseif ( ZM_AUTH_RELAY == 'plain' ) {
|
} elseif ( ZM_AUTH_RELAY == 'plain' ) {
|
||||||
$url = '?user='.$_SESSION['username'];
|
$url .= '?user='.$_SESSION['username'];
|
||||||
$url = '?pass='.$_SESSION['password'];
|
$url .= '?pass='.$_SESSION['password'];
|
||||||
} elseif ( ZM_AUTH_RELAY == 'none' ) {
|
} elseif ( ZM_AUTH_RELAY == 'none' ) {
|
||||||
$url = '?user='.$_SESSION['username'];
|
$url .= '?user='.$_SESSION['username'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Logger::Debug("sending command to $url");
|
Logger::Debug("sending command to $url");
|
||||||
|
|
Loading…
Reference in New Issue