component, "3576-MTL Firmware") == 0) { $version->version = substr($version->version, 0, 3); error_log("version->version: $version->version"); error_log("restoreVersion: $restoreVersion"); if(strcmp($version->version, $restoreVersion) == 0) { $fileResults = true; } else { $fileResults = false; } } } } if($fileResults) { error_log("Calling -> restore_system_state($user, $uploads_dir/$name, 0);\n" ); restore_system_state($user, "$uploads_dir/$name", 0); } else { $ask = true; } } else { if (!file_exists("$uploads_dir/$name")) { $returnMessage = "The file you are trying to upload is missing."; $errorCode = "4109"; } else { switch ($_FILES['restoreFile']['error']) { case 1 : //uploaded file exceeds the upload_max_filesize directive in php.ini case 2 : //uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the html form //error_log("The file you are trying to upload is too big. Error 2"); $returnMessage = "The file you are trying to upload is too big."; $errorCode ="4109"; break; case 3 : //uploaded file was only partially uploaded //error_log("The file you are trying upload was only partially uploaded."); $returnMessage = "The file you are trying upload was only partially uploaded."; $errorCode ="4110"; break; case 4 : //no file was uploaded //error_log("You must select an image for upload."); $returnMessage = "You must select an image for upload."; $errorCode ="4111"; break; default : //a default error, just in case! :) //error_log("There was a problem with your upload."); $returnMessage = "There was a problem with your upload."; $errorCode ="4108"; break; } } } } } else { // Run the disSpace clean script when the user enters this page. // Note this CAN-NOT be run after the post, because the file is uploaded at the // beginning of the post and this will delete the file that was just uploaded. $sRet = system("/usr/bin/cmdwrap -NO_END_OF_FILE /home/embedded/library/DiskSpaceClean.sh > /dev/null > /home/embedded/library/diskclean.log", $iRet); error_log("Call to cmdwrap DiskSpaceClean.sh returned a \"$iRet\" and the output was \"$sRet\""); $diskSpace = disk_free_space("/home/embedded/library/upload"); error_log("NEW - Free Diskspace for Firmware upload is: ". $diskSpace ); } ?> if ($operation == "restore") { ?>