$file_extension = strrpos($newPath, '.') > 0 ? substr($newPath, strrpos($newPath, '.'), 10) : ''; if ($debug > 0) { error_log(strrpos($newPath, '.')); } if ($debug > 0) { error_log($file_extension); } /*==== conversion if needed ====*/ if (!in_array(strtolower($file_extension), $image_extension)) { if ($debug > 0) { error_log("converting: " . $file_extension); } $take_slide_name = false; $o_ppt = new OpenofficePresentation($take_slide_name); $o_ppt->set_slide_size(640, 480); $o_ppt->convert_document($_FILES['Filedata'], 'add_docs_to_visio'); } echo '<html><body><script language="javascript">setTimeout(1000,window.close());</script></body></html>'; } else { if ($action == "service") { /*==== List files ====*/ if ($debug > 0) { error_log("sending file list", 0); } $subaction = $_REQUEST["subaction"]; $is_manager = CourseManager::get_user_in_course_status($user_id, $cidReq) == COURSEMANAGER; if ($subaction == "list") { // FIXME: check security around $_REQUEST["cwd"] $cwd = $_REQUEST["cwd"]; // treat /.. $nParent = 0;
require_once 'aicc.class.php'; $oAICC = new aicc(); $config_dir = $oAICC->import_package($_FILES['user_file']); if (!empty($config_dir)) { $oAICC->parse_config_files($config_dir); $oAICC->import_aicc(api_get_course_id()); } $oAICC->set_proximity($proximity); $oAICC->set_maker($maker); $oAICC->set_jslib('aicc_api.php'); break; case 'oogie': require_once 'openoffice_presentation.class.php'; $take_slide_name = empty($_POST['take_slide_name']) ? false : true; $o_ppt = new OpenofficePresentation($take_slide_name); $first_item_id = $o_ppt->convert_document($_FILES['user_file']); break; case 'woogie': require_once 'openoffice_text.class.php'; $split_steps = empty($_POST['split_steps']) || $_POST['split_steps'] == 'per_page' ? 'per_page' : 'per_chapter'; $o_doc = new OpenofficeText($split_steps); $first_item_id = $o_doc->convert_document($_FILES['user_file']); break; case '': default: throw new \Exception(get_lang('ScormUnknownPackageFormat')); } } elseif ($_SERVER['REQUEST_METHOD'] == 'POST') { // end if is_uploaded_file // If file name given to get in /upload/, try importing this way. // A file upload has been detected, now deal with the file...