protected function init($data) { // initialize if (function_exists("my_init")) { my_init($data, $this->config); } // read history data // train your parmaters $this->show_status($data); }
<?php my_init(); if (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on') { header("Location: https://" . $_SERVER['SERVER_NAME']); } elseif (isset($_POST['username']) && isset($_POST['password'])) { my_session_login($_POST['username'], $_POST['password']); } elseif (isset($_GET['logout'])) { my_session_logout(); } elseif (my_session_valid()) { $path = $GLOBALS['config']['my_file_path']; if (isset($_GET['c'])) { $path = my_validate_path($_GET['c']); } if (isset($_GET['p'])) { $path = my_validate_path($_GET['p']); } if (is_file($path) && !is_link($path)) { if (isset($_GET['c'])) { show_checksum($path); } else { show_download($path); } } elseif (is_dir($path)) { show_files($path); } else { header("HTTP/1.0 404 Not Found"); show_error("404 - Not found"); } } else { show_login();