fix var-names in DirOptions-ApiCommand; fix pmd issues
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -119,7 +119,6 @@ abstract class ApiCommand extends ApiParameter
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->initLang();
|
$this->initLang();
|
||||||
$this->lng = $lng;
|
|
||||||
$this->initMail();
|
$this->initMail();
|
||||||
|
|
||||||
if ($this->debug) {
|
if ($this->debug) {
|
||||||
@@ -133,7 +132,8 @@ abstract class ApiCommand extends ApiParameter
|
|||||||
*/
|
*/
|
||||||
private function initLang()
|
private function initLang()
|
||||||
{
|
{
|
||||||
global $lng;
|
$lng = array();
|
||||||
|
|
||||||
// query the whole table
|
// query the whole table
|
||||||
$result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_LANGUAGE . "`");
|
$result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_LANGUAGE . "`");
|
||||||
|
|
||||||
@@ -174,6 +174,9 @@ abstract class ApiCommand extends ApiParameter
|
|||||||
|
|
||||||
// last but not least include language references file
|
// last but not least include language references file
|
||||||
include_once makeSecurePath(FROXLOR_INSTALL_DIR . '/lng/lng_references.php');
|
include_once makeSecurePath(FROXLOR_INSTALL_DIR . '/lng/lng_references.php');
|
||||||
|
|
||||||
|
// set array for ApiCommand
|
||||||
|
$this->lng = $lng;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ class DirOptions extends ApiCommand implements ResourceEntity
|
|||||||
);
|
);
|
||||||
Database::pexecute($stmt, $params, true, true);
|
Database::pexecute($stmt, $params, true, true);
|
||||||
$id = Database::lastInsertId();
|
$id = Database::lastInsertId();
|
||||||
$this->logger()->logAction($this->isAdmin() ? ADM_ACTION : USR_ACTION, LOG_INFO, "[API] added directory-protection for '" . $username . " (" . $path . ")'");
|
$this->logger()->logAction($this->isAdmin() ? ADM_ACTION : USR_ACTION, LOG_INFO, "[API] added directory-option for '" . $userpath . "'");
|
||||||
inserttask('1');
|
inserttask('1');
|
||||||
|
|
||||||
$result = $this->apiCall('DirOptions.get', array(
|
$result = $this->apiCall('DirOptions.get', array(
|
||||||
@@ -350,7 +350,7 @@ class DirOptions extends ApiCommand implements ResourceEntity
|
|||||||
"customerid" => $customer_data['customerid'],
|
"customerid" => $customer_data['customerid'],
|
||||||
"id" => $id
|
"id" => $id
|
||||||
));
|
));
|
||||||
$this->logger()->logAction($this->isAdmin() ? ADM_ACTION : USR_ACTION, LOG_INFO, "[API] deleted directory-option for '" . str_replace($userinfo['documentroot'], '/', $result['path']) . "'");
|
$this->logger()->logAction($this->isAdmin() ? ADM_ACTION : USR_ACTION, LOG_INFO, "[API] deleted directory-option for '" . str_replace($customer_data['documentroot'], '/', $result['path']) . "'");
|
||||||
inserttask('1');
|
inserttask('1');
|
||||||
return $this->response(200, "successfull", $result);
|
return $this->response(200, "successfull", $result);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user