@@ -71,8 +71,7 @@ |
||
| 71 | 71 | html_generate_warning("There was an unknown error uploading your file."); |
| 72 | 72 | } |
| 73 | 73 | } |
| 74 | - } |
|
| 75 | - else |
|
| 74 | + } else |
|
| 76 | 75 | { |
| 77 | 76 | html_generate_warning('The Submit POST information was not populated. Something went wrong'); |
| 78 | 77 | } |
@@ -27,8 +27,7 @@ |
||
| 27 | 27 | if (trim($output) == "active") { |
| 28 | 28 | $color='green'; |
| 29 | 29 | $text='Running'; |
| 30 | - } |
|
| 31 | - else{ |
|
| 30 | + } else{ |
|
| 32 | 31 | $color='red'; |
| 33 | 32 | $text='Stopped'; |
| 34 | 33 | } |
@@ -65,8 +65,7 @@ discard block |
||
| 65 | 65 | action_unknown_command(); |
| 66 | 66 | break; |
| 67 | 67 | } |
| 68 | - } |
|
| 69 | - else{ |
|
| 68 | + } else{ |
|
| 70 | 69 | html_generate_warning("HTTP command was missing POST information. Are you trying to access this page directly? That won't work"); |
| 71 | 70 | echo "<br>".PHP_EOL; |
| 72 | 71 | html_generate_ok_to_go_home(); |
@@ -86,8 +85,7 @@ discard block |
||
| 86 | 85 | exec($command, $retArray, $result); |
| 87 | 86 | check_result($result, $command,$retArray); |
| 88 | 87 | html_generate_ok_to_go_home(); |
| 89 | - } |
|
| 90 | - else{ |
|
| 88 | + } else{ |
|
| 91 | 89 | check_are_you_sure('Are you sure you want to disconnect SCSI ID ' . $_POST['id'].'? If the host is running, this could cause undesirable behavior.'); |
| 92 | 90 | } |
| 93 | 91 | } |
@@ -105,8 +103,7 @@ discard block |
||
| 105 | 103 | exec($command, $retArray, $result); |
| 106 | 104 | check_result($result, $command, $retArray); |
| 107 | 105 | html_generate_ok_to_go_home(); |
| 108 | - } |
|
| 109 | - else{ |
|
| 106 | + } else{ |
|
| 110 | 107 | echo '<h2>Create a new empty file</h2>'.PHP_EOL; |
| 111 | 108 | echo '<form action=rascsi_action.php method="post">'.PHP_EOL; |
| 112 | 109 | echo ' <input type="hidden" name="command" value="'.$_POST['command'].'"/>'.PHP_EOL; |
@@ -142,8 +139,7 @@ discard block |
||
| 142 | 139 | exec($command, $retArray, $result); |
| 143 | 140 | check_result($result, $command, $retArray); |
| 144 | 141 | html_generate_ok_to_go_home(); |
| 145 | - } |
|
| 146 | - else{ |
|
| 142 | + } else{ |
|
| 147 | 143 | check_are_you_sure('Are you sure you want to PERMANENTLY delete '.$_POST['file_name'].'?'); |
| 148 | 144 | } |
| 149 | 145 | } |
@@ -172,8 +168,7 @@ discard block |
||
| 172 | 168 | // The unit should reboot at this point. Doesn't matter what we do now... |
| 173 | 169 | check_result($result, $command,$retArray); |
| 174 | 170 | html_generate_ok_to_go_home(); |
| 175 | - } |
|
| 176 | - else{ |
|
| 171 | + } else{ |
|
| 177 | 172 | check_are_you_sure("Are you sure you want to reboot the Raspberry Pi?"); |
| 178 | 173 | } |
| 179 | 174 | } |
@@ -186,8 +181,7 @@ discard block |
||
| 186 | 181 | // The unit should shutdown at this point. Doesn't matter what we do now... |
| 187 | 182 | check_result($result, $command,$retArray); |
| 188 | 183 | html_generate_ok_to_go_home(); |
| 189 | - } |
|
| 190 | - else{ |
|
| 184 | + } else{ |
|
| 191 | 185 | check_are_you_sure("Are you sure you want to shut down the Raspberry Pi?"); |
| 192 | 186 | } |
| 193 | 187 | } |
@@ -200,8 +194,7 @@ discard block |
||
| 200 | 194 | function check_result($result,$command,$output){ |
| 201 | 195 | if(!$result){ |
| 202 | 196 | html_generate_success_message('Command succeeded!'); |
| 203 | - } |
|
| 204 | - else{ |
|
| 197 | + } else{ |
|
| 205 | 198 | html_generate_warning('Command failed!'); |
| 206 | 199 | } |
| 207 | 200 | echo '<br><code>'.$command.'</code><br>'.PHP_EOL; |
@@ -246,8 +239,7 @@ discard block |
||
| 246 | 239 | exec($command, $retArray, $result); |
| 247 | 240 | check_result($result, $command, $retArray); |
| 248 | 241 | html_generate_ok_to_go_home(); |
| 249 | - } |
|
| 250 | - else{ |
|
| 242 | + } else{ |
|
| 251 | 243 | |
| 252 | 244 | |
| 253 | 245 | $id = $_POST['id']; |
@@ -160,8 +160,7 @@ discard block |
||
| 160 | 160 | echo ' <input type="submit" name="insert_disk" value="Insert" />'. PHP_EOL; |
| 161 | 161 | echo ' </form>'. PHP_EOL; |
| 162 | 162 | echo ' </td>'.PHP_EOL; |
| 163 | - } |
|
| 164 | - else{ |
|
| 163 | + } else{ |
|
| 165 | 164 | // rascsi inserts "WRITEPROTECT" for the read-only drives. We want to display that differently. |
| 166 | 165 | echo ' <form action="rascsi_action.php" method="post">'. PHP_EOL; |
| 167 | 166 | echo ' <td>'.str_replace('(WRITEPROTECT)', '', $scsi_ids[$id]['file']). PHP_EOL; |
@@ -182,8 +181,7 @@ discard block |
||
| 182 | 181 | echo ' <input type="submit" name="remove_device" value="Disconnect" />'. PHP_EOL; |
| 183 | 182 | echo ' </form>'. PHP_EOL; |
| 184 | 183 | echo ' </td>'. PHP_EOL; |
| 185 | - } |
|
| 186 | - else |
|
| 184 | + } else |
|
| 187 | 185 | { |
| 188 | 186 | echo ' <td style="text-align:center">-</td>'. PHP_EOL; |
| 189 | 187 | echo ' <td>-</td>'. PHP_EOL; |