minor changes for testing

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2018-02-25 11:47:28 +01:00
parent 2f30d85d32
commit 243b68cc37
4 changed files with 21 additions and 12 deletions

View File

@@ -54,11 +54,13 @@ exit();
*/
function json_response($status, $status_message = '', $data = null)
{
if (isset($_SERVER["SERVER_PROTOCOL"]) && ! empty($_SERVER["SERVER_PROTOCOL"])) {
$resheader = $_SERVER["SERVER_PROTOCOL"] . " " . $status;
if (! empty($status_message)) {
$resheader .= ' ' . str_replace("\n", " ", $status_message);
}
header($resheader);
}
$response['status'] = $status;
$response['status_message'] = $status_message;

View File

@@ -161,13 +161,13 @@ abstract class ApiCommand
// include every english language file we can get
foreach ($langs['English'] as $key => $value) {
include_once makeSecurePath($value['file']);
include_once makeSecurePath(FROXLOR_INSTALL_DIR . '/' . $value['file']);
}
// now include the selected language if its not english
if ($language != 'English') {
foreach ($langs[$language] as $key => $value) {
include_once makeSecurePath($value['file']);
include_once makeSecurePath(FROXLOR_INSTALL_DIR . '/' . $value['file']);
}
}
@@ -400,11 +400,13 @@ abstract class ApiCommand
*/
protected function response($status, $status_message, $data = null)
{
if (isset($_SERVER["SERVER_PROTOCOL"]) && ! empty($_SERVER["SERVER_PROTOCOL"])) {
$resheader = $_SERVER["SERVER_PROTOCOL"] . " " . $status;
if (! empty($status_message)) {
$resheader .= ' ' . str_replace("\n", " ", $status_message);
}
header($resheader);
}
$response['status'] = $status;
$response['status_message'] = $status_message;

View File

@@ -45,7 +45,7 @@ class Ftps extends ApiCommand implements ResourceEntity
$params = array();
if ($this->isAdmin()) {
if ($this->getUserDetail('customers_see_all') != 1) {
if ($this->getUserDetail('customers_see_all') == false) {
// if it's a reseller or an admin who cannot see all customers, we need to check
// whether the database belongs to one of his customers
$json_result = Customers::getLocal($this->getUserData())->list();

View File

@@ -100,6 +100,11 @@ class Autoloader {
return true;
}
// don't load anything from a namespace, it's not our responsibility
if (strpos($class, "\\") !== false) {
return true;
}
// now iterate through the paths
foreach ($paths as $path) {
// valid directory?