Skip to content

Commit

Permalink
Fix authentication issue
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Oct 1, 2018
1 parent 99ac86e commit 20802e7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions inc/ZabbixAPI.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ private function __callAPI($method, $params = array()) {
self::$instance->last_error = false;

// Make sure we're logged in, or trying to login...
if ($this->auth_hash == NULL && $method != 'user.authenticate')
if ($this->auth_hash == NULL && $method != 'user.login')
return false; // If we're not logged in, no wasting our time here

// Try to retrieve this...
Expand Down Expand Up @@ -281,7 +281,7 @@ private function __callAPI($method, $params = array()) {
*/
private function __login() {
// Try to login to our API
$data = $this->__callAPI('user.authenticate', array( 'password' => $this->password, 'user' => $this->username ));
$data = $this->__callAPI('user.login', array( 'password' => $this->password, 'user' => $this->username ));

if ($this->debug)
echo "__login() Got response from API: ($data)\n";
Expand All @@ -300,7 +300,7 @@ private function __login() {
*/
private function __logout() {
// Try to logout of our API
$data = $this->__callAPI('user.logout', array( 'user' => $this->username, 'auth' => self::$instance->auth_hash ));
$data = $this->__callAPI('user.logout', array( ));

if ($this->debug)
echo "__logout() Got response from API: ($data)\n";
Expand Down

0 comments on commit 20802e7

Please sign in to comment.