function delete() { $item_url = new ItemURL($this->o_loaded_item_object); # delete the file $s_writing_file_path = $item_url->writing_file_path(FLOT_CACHE_PATH); if (file_exists($s_writing_file_path)) { unlink($s_writing_file_path); } # if it was the last file in folder, delete folder, repeat this recursively until back to root $fu_FileUtility = new FileUtilities(); $s_directory_containing_file = $fu_FileUtility->s_lowest_directory_of_path($s_writing_file_path); // delete folder if it's empty if ($fu_FileUtility->b_is_dir_empty($s_directory_containing_file)) { rmdir($s_directory_containing_file); } }
<?php # log in and forward user to route admin section require_once 'flot-admin/core/base.php'; require S_BASE_PATH . 'flot-admin/core/flot.php'; $flot = new Flot(); $requirements = new FlotRequirements(); $ufUF = new UtilityFunctions(); $fuFU = new FileUtilities(); # are we handling the form submission? if ($ufUF->b_post_vars()) { // user has entered an email and password okay if (isset($_POST["email"]) && isset($_POST["password"])) { // are the requirements met? if ($requirements->b_requirements_met()) { // // set up flot // $flot->_create_start_dirs(); // add username/pass, store to datastore if ($flot->datastore->b_add_user($_POST["email"], sha1($_POST["password"]))) { // log the user in too, with the same email and password that was posted as part of their registration $flot->_handle_auth_attempt(); # at a later date, add some starter items ## web page oncology ## a few pages ## a menu // generate all pages $flot->_render_all_pages(); // delete this start.php page for security $flot->_delete_start_page();
<?php // include core $s_b_p = str_replace($_SERVER['SCRIPT_NAME'], "", str_replace("\\", "/", $_SERVER['SCRIPT_FILENAME'])) . '/'; require $s_b_p . 'flot_flot/core/base.php'; require_once S_BASE_PATH . 'flot_flot/core/flot.php'; $flot = new Flot(); // if authorized if (!$flot->b_is_user_admin()) { # forward them to login page $flot->_page_change("/flot_flot/admin/login.php"); } else { $sfSF = new SettingsUtilities(); $fuFU = new FileUtilities(); $s_start_version = $sfSF->s_literal_flot_version(); // // do update // // download new flot $s_download_to = S_BASE_PATH . 'flot_flot' . DIRECTORY_SEPARATOR . 'temp' . DIRECTORY_SEPARATOR . 'new_flot.zip'; $s_unzip_to = S_BASE_PATH . 'flot_flot' . DIRECTORY_SEPARATOR . 'temp' . DIRECTORY_SEPARATOR . 'new_flot' . DIRECTORY_SEPARATOR . ''; echo "download to: " . $s_download_to . "<br/>"; echo "download from: " . FLOT_DOWNLOAD_URL . "<br/>"; file_put_contents($s_download_to, fopen(FLOT_DOWNLOAD_URL, 'r')); // unpack $zip = new ZipArchive(); $res = $zip->open($s_download_to); if ($res === TRUE) { $zip->extractTo($s_unzip_to); $zip->close(); echo 'unpacked flot<br/>';
$s_oncology_id = $ufUf->s_get_var('id', false); if ($s_oncology_id) { // remove from datastore $flot->datastore->_delete_oncology($s_oncology_id); $s_new_page = "/flot-admin/admin/index.php?section=oncologies&action=list"; $flot->_page_change($s_new_page); } break; } break; case "errors": $s_action = $ufUf->s_get_var_from_allowed("action", array("view", "clear"), "view"); switch ($s_action) { case "clear": // clear log $fu_FileUtil = new FileUtilities(); $fu_FileUtil->_wipe_errors(); // reload to view $flot->_page_change("/flot-admin/admin/index.php?section=errors&action=view"); break; case "view": $html_main_admin_content = '<a class="btn btn-default btn-sm" href="' . S_BASE_EXTENSION . 'flot-admin/admin/index.php?section=errors&action=clear"><i class="glyphicon glyphicon-trash"></i> clear/delete log</a><hr/>'; $html_main_admin_content .= $admin_ui->html_make_error_page(); break; } break; case "requirements": $s_action = $ufUf->s_get_var_from_allowed("action", array("view"), "view"); switch ($s_action) { case "view": $html_main_admin_content .= $admin_ui->html_requirements_list();
function html_make_error_page() { $fu_FileUtil = new FileUtilities(); return $fu_FileUtil->s_errors(); }