minor changes for testing
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
2
api.php
2
api.php
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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?
|
||||
|
||||
Reference in New Issue
Block a user