mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
error.php, index.php, upload-file.php, upload2usb.php: Updating error message to refer to FAQs, titles to be more succinct, adding exception when directory can't be created.
This commit is contained in:
parent
312ddce9ec
commit
f8b743dafc
4 changed files with 8 additions and 8 deletions
|
@ -6,10 +6,10 @@
|
|||
|
||||
?>
|
||||
|
||||
AN ERROR occurred! Please make sure <span style="color:red; font-weight:bold"> one and ONLY one </span>(no more, no less) removable USB stick is plugged into your Internet-in-a-Box. <!-- Also make sure the <span style="color:red; font-weight:bold;">usb_lib_umask0000_for_kolibri</span> parameter in your IIAB configuration file is set to True. --> Reach out to TK for help if you have any questions or continue having trouble with the setup.
|
||||
ERROR: Please make sure <span style="color:red; font-weight:bold;"> one and ONLY one </span>(no more, no less) removable USB stick is plugged into your Internet-in-a-Box. Please see IIAB FAQs for additional support: <a href="https://wiki.iiab.io/go/FAQ#Can_teachers_display_their_own_content%3F">FAQ #4 - Can teachers display their own content?</a>, <a href="https://wiki.iiab.io/go/FAQ#What_are_the_best_places_for_community_support%3F">FAQ #49 - What are the best places for community support?.</a>
|
||||
|
||||
<br/><br/>
|
||||
|
||||
Share the below error message with IIAB developers at TK for debugging:
|
||||
<pre><?php if (isset($exception)) {echo (string)$exception;} ?></pre>
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* Upload2USB App Index Page
|
||||
*/
|
||||
|
||||
$title = "IIAB Upload to USB";
|
||||
$title = "Upload to USB";
|
||||
include("header.php");
|
||||
|
||||
//Check if folder for today exists, and get file count if it does
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* Upload2USB App - Process Submission
|
||||
*/
|
||||
|
||||
$title = "IIAB Upload to USB App Results";
|
||||
$title = "Upload to USB Results";
|
||||
include("header.php");
|
||||
|
||||
//get folder path where file will be stored
|
||||
|
|
|
@ -20,15 +20,15 @@ function getTargetUSBDriveLocation () {
|
|||
# error if 1<>usb sticks are installed
|
||||
$rmv_usb_path_count = shell_exec('lsblk --output NAME,TRAN,RM,MOUNTPOINT --pairs |grep RM=\"1\" | grep -v MOUNTPOINT=\"\" | cut -d " " -f 4 | wc -l');
|
||||
if ($rmv_usb_path_count == 0) {
|
||||
throw new RuntimeException('0 USB sticks found <br/><br/>');
|
||||
throw new RuntimeException('0 USB sticks found. <br/><br/>');
|
||||
} elseif ($rmv_usb_path_count > 1) {
|
||||
throw new RuntimeException('More than 1 USB sticks installed <br/><br/>');
|
||||
throw new RuntimeException('More than 1 USB sticks installed. <br/><br/>');
|
||||
}
|
||||
|
||||
$rmv_usb_path = trim(str_replace('"', '', shell_exec('lsblk --output NAME,TRAN,RM,MOUNTPOINT --pairs |grep RM=\"1\" | grep -v MOUNTPOINT=\"\" | cut -d " " -f 4 | cut -d "=" -f 2')));
|
||||
|
||||
if (empty($rmv_usb_path)) {
|
||||
throw new RuntimeException('Not able to find USB stick <br/><br/>');
|
||||
throw new RuntimeException('Not able to find USB stick. <br/><br/>');
|
||||
} else {
|
||||
return $rmv_usb_path . "/";
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ function getTargetFolderPath ($create_folder_p) {
|
|||
$target_folder_path = $parent_dir . $today_folder_name;
|
||||
|
||||
if (!file_exists($target_folder_path) && $create_folder_p) {
|
||||
mkdir($target_folder_path, 0777);
|
||||
mkdir($target_folder_path, 0777) or throw new RuntimeException("Not able to create upload directory. <br/>Make sure 'usb_lib_umask0000_for_kolibri' is set to 'True'. <br/><br/>");
|
||||
}
|
||||
return $target_folder_path;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue