web-app/init.inc.php
File init.inc.php
has 631 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/*
Copyright 2020 Guillaume Boudreau
This file is part of Greyhole.
Avoid deeply nested control flow statements. Open
Open
if (file_exists($path_to_delete)) {
$rm_command = "rm -rf " . escapeshellarg($path_to_delete);
error_log($rm_command);
exec($rm_command);
Avoid deeply nested control flow statements. Open
Open
if ($return_var) {
$output = implode(" ", $output);
echo json_encode(['result' => 'error', 'message' => "Error: UNIX user doesn't not exist, and failed to create ($output).\nYou can only create Samba users for existing UNIX users."]);
}
Avoid deeply nested control flow statements. Open
Open
if (!is_dir($v)) {
echo json_encode(['result' => 'error', 'message' => "Specified dir not found: " . $v]);
exit();
}