Skip to content

Commit

Permalink
Restoring deleted fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
leanec authored and chriskacerguis committed Jul 6, 2020
1 parent becfe9b commit b1c15aa
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/RestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,15 +262,15 @@ public function __construct($config = 'rest')
// when output is displayed for not damaging data accidentally
$this->output->parse_exec_vars = false;

// Load the rest.php configuration file
$this->get_local_config($config);

// Log the loading time to the log table
if ($this->config->item('rest_enable_logging') === true) {
// Start the timer for how long the request takes
$this->_start_rtime = microtime(true);
}

// Load the rest.php configuration file
$this->get_local_config($config);

// Determine supported output formats from configuration
$supported_formats = $this->config->item('rest_supported_formats');

Expand Down Expand Up @@ -548,7 +548,7 @@ public function _remap($object_called, $arguments = [])
$this->response([
$this->config->item('rest_status_field_name') => false,
$this->config->item('rest_message_field_name') => $this->lang->line('text_rest_unknown_method'),
], $this->http_status['METHOD_NOT_ALLOWED']);
], self::HTTP_METHOD_NOT_ALLOWED);
}

// Doing key related stuff? Can only do it if they have a key right?
Expand Down Expand Up @@ -1545,7 +1545,7 @@ protected function _perform_ldap_auth($username = '', $password = null)
'basedn' => $this->config->item('basedn', 'ldap'),
];

log_message('debug', 'LDAP Auth: Connect to '.(isset($ldaphost) ? $ldaphost : '[ldap not configured]'));
log_message('debug', 'LDAP Auth: Connect to '.(isset($ldap['host']) ? $ldap['host'] : '[ldap not configured]'));

// Connect to the ldap server
$ldapconn = ldap_connect($ldap['host'], $ldap['port']);
Expand Down Expand Up @@ -1722,7 +1722,7 @@ protected function _check_php_session()
$this->response([
$this->config->item('rest_status_field_name') => false,
$this->config->item('rest_message_field_name') => $this->lang->line('text_rest_unauthorized'),
], $this->http_status['UNAUTHORIZED']);
], self::HTTP_UNAUTHORIZED);
}
}

Expand Down Expand Up @@ -1807,7 +1807,7 @@ protected function _prepare_digest_auth()
$this->response([
$this->config->item('rest_status_field_name') => false,
$this->config->item('rest_message_field_name') => $this->lang->line('text_rest_invalid_credentials'),
], $this->http_status['UNAUTHORIZED']);
], self::HTTP_UNAUTHORIZED);
}
}

Expand All @@ -1827,7 +1827,7 @@ protected function _check_blacklist_auth()
$this->response([
$this->config->item('rest_status_field_name') => false,
$this->config->item('rest_message_field_name') => $this->lang->line('text_rest_ip_denied'),
], $this->http_status['UNAUTHORIZED']);
], self::HTTP_UNAUTHORIZED);
}
}

Expand All @@ -1852,7 +1852,7 @@ protected function _check_whitelist_auth()
$this->response([
$this->config->item('rest_status_field_name') => false,
$this->config->item('rest_message_field_name') => $this->lang->line('text_rest_ip_unauthorized'),
], $this->http_status['UNAUTHORIZED']);
], self::HTTP_UNAUTHORIZED);
}
}

Expand Down Expand Up @@ -1887,7 +1887,7 @@ protected function _force_login($nonce = '')
$this->response([
$this->config->item('rest_status_field_name') => false,
$this->config->item('rest_message_field_name') => $this->lang->line('text_rest_unauthorized'),
], $this->http_status['UNAUTHORIZED']);
], self::HTTP_UNAUTHORIZED);
}

/**
Expand Down

0 comments on commit b1c15aa

Please sign in to comment.