'. PHP_EOL;
@@ -61,7 +61,7 @@ function html_generate_success_message(){
}
function html_generate_ok_to_go_home(){
- echo ' '. PHP_EOL;
}
@@ -115,10 +115,10 @@ function current_rascsi_config() {
echo '
'.$scsi_ids[$id]['file'].'
'. PHP_EOL;
echo '
'. PHP_EOL;
echo ' '. PHP_EOL;
echo '
'.PHP_EOL;
+ echo ' '.PHP_EOL;
+ echo '
'.PHP_EOL;
+ echo '
'.PHP_EOL;
+ echo '
File Name:
'.PHP_EOL;
+ echo '
'.PHP_EOL;
+ echo ' '.PHP_EOL;
+ echo '
'.PHP_EOL;
+ echo '
Size:
'.PHP_EOL;
+ echo '
'.PHP_EOL;
+ echo ' '.PHP_EOL;
+ echo '
'.PHP_EOL;
+ echo '
MB
'.PHP_EOL;
+ echo '
'.PHP_EOL;
+ echo ' '.PHP_EOL;
+ echo '
'.PHP_EOL;
+ echo '
'.PHP_EOL;
+ echo '
'.PHP_EOL;
+ echo '
'.PHP_EOL;
+ echo ' Note: Creating a large file may take a long time!'.PHP_EOL;
+ echo '
'.PHP_EOL;
+ echo '
'.PHP_EOL;
+ echo ' '.PHP_EOL;
+ echo '
'.PHP_EOL;
+ }
+}
+
function action_delete_file(){
// Check to see if the user has confirmed
if(isset($_POST['confirmed'])){
- echo ' exec(rm '.$_POST['file'].')'.PHP_EOL;
+ $command = 'rm '.$GLOBALS['FILE_PATH'].'/'.$_POST['file_name'];
+ exec($command, $retArray, $result);
+ check_result($result, $command, $retArray);
html_generate_ok_to_go_home();
}
else{
- check_are_you_sure('Are you sure you want to PERMANENTLY delete '.$_POST['file'].'?');
+ check_are_you_sure('Are you sure you want to PERMANENTLY delete '.$_POST['file_name'].'?');
}
}
@@ -169,7 +214,7 @@ function action_stop_rascsi_service(){
function action_reboot_raspberry_pi(){
// Check to see if the user has confirmed
if(isset($_POST['confirmed'])){
- echo(' exec(sudo reboot)');
+ echo(' exec(sleep 2 && sudo reboot)');
// The unit should reboot at this point. Doesn't matter what we do now...
}
else{
@@ -180,7 +225,7 @@ function action_reboot_raspberry_pi(){
function action_shutdown_raspberry_pi(){
// Check to see if the user has confirmed
if(isset($_POST['confirmed'])){
- echo(' exec(sudo shutdown -h now)');
+ echo(' exec(sleep 2 && sudo shutdown -h now)');
// The unit should reboot at this point. Doesn't matter what we do now...
html_generate_ok_to_go_home();
}
@@ -196,21 +241,23 @@ function action_unknown_command(){
function check_result($result,$command,$output){
if(!$result){
- echo '