Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix authentication issue #8

Merged
merged 2 commits into from
Dec 11, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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