fixes
This commit is contained in:
64
app/controllers/downloads.php
Normal file
64
app/controllers/downloads.php
Normal file
@ -0,0 +1,64 @@
|
||||
<?php
|
||||
/**
|
||||
* app/controllers/hermes.php
|
||||
*
|
||||
* This is the hermes controller.
|
||||
*
|
||||
* @version 3.0
|
||||
* @author Joey Kimsey <Joey@thetempusproject.com>
|
||||
* @link https://TheTempusProject.com
|
||||
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
||||
*/
|
||||
namespace TheTempusProject\Controllers;
|
||||
|
||||
use TheTempusProject\Hermes\Functions\Redirect;
|
||||
use TheTempusProject\Bedrock\Functions\Session;
|
||||
use TheTempusProject\Bedrock\Functions\Check;
|
||||
use TheTempusProject\Bedrock\Functions\Input;
|
||||
use TheTempusProject\Hermes\Functions\Route as Routes;
|
||||
use TheTempusProject\Houdini\Classes\Issues;
|
||||
use TheTempusProject\Houdini\Classes\Views;
|
||||
use TheTempusProject\Houdini\Classes\Components;
|
||||
use TheTempusProject\Houdini\Classes\Template;
|
||||
use TheTempusProject\Classes\Controller;
|
||||
use TheTempusProject\Classes\Forms;
|
||||
use TheTempusProject\TheTempusProject as App;
|
||||
|
||||
class Downloads extends Controller {
|
||||
public function index() {
|
||||
Session::flash( 'success', 'Unknown download.' );
|
||||
return Redirect::to( 'home/index' );
|
||||
}
|
||||
|
||||
public function resume( $extension = 'none' ) {
|
||||
if ( ! in_array( $extension, ['docx','pdf','md','txt'] ) ) {
|
||||
Session::flash( 'success', 'Unknown download.' );
|
||||
return Redirect::to( 'home/index' );
|
||||
}
|
||||
|
||||
$file = APP_ROOT_DIRECTORY . 'downloads' . DIRECTORY_SEPARATOR . 'JoeyKimsey-resume-2025.' . $extension;
|
||||
|
||||
// Check if the file exists
|
||||
if (file_exists($file)) {
|
||||
// Set headers to force the download
|
||||
header('Content-Description: File Transfer');
|
||||
header('Content-Type: application/octet-stream');
|
||||
header('Content-Disposition: attachment; filename="' . basename($file) . '"');
|
||||
header('Expires: 0');
|
||||
header('Cache-Control: must-revalidate');
|
||||
header('Pragma: public');
|
||||
header('Content-Length: ' . filesize($file));
|
||||
|
||||
// Clear the output buffer
|
||||
ob_clean();
|
||||
flush();
|
||||
|
||||
// Read and output the file
|
||||
readfile($file);
|
||||
exit;
|
||||
} else {
|
||||
Session::flash( 'success', 'Unknown download.' );
|
||||
return Redirect::to( 'home/index' );
|
||||
}
|
||||
}
|
||||
}
|
@ -29,22 +29,19 @@ class Home extends Controller {
|
||||
self::$title = '{SITENAME}';
|
||||
self::$pageDescription = 'This is the homepage of your new Tempus Project Installation. Thank you for installing. find more info at https://thetempusproject.com';
|
||||
$optionValues = [
|
||||
(object) [ "post" => "XXXXXXXX", "option" => "Full-Stack Developer" ],
|
||||
(object) [ "post" => "XXXXXXXX", "option" => "DevOps Engineer" ],
|
||||
(object) [ "post" => "XXXXXXXX", "option" => "Web Developer" ],
|
||||
(object) [ "post" => "XXXXXXXX", "option" => "App Developer" ],
|
||||
(object) [ "post" => "XXXXXXXX", "option" => "Senior PHP Developer" ],
|
||||
(object) [ "post" => "XXXXXXXX", "option" => "Server/Waiter" ],
|
||||
(object) [ "post" => "XXXXXXXX", "option" => "Cook" ],
|
||||
(object) [ "post" => "XXXXXXXX", "option" => "Farm-Hand" ],
|
||||
(object) [ "post" => "XXXXXXXX", "option" => "Dish-Boy" ],
|
||||
(object) [ "post" => "XXXXXXXX", "option" => "Brother" ],
|
||||
(object) [ "post" => "XXXXXXXX", "option" => "Son" ],
|
||||
(object) [ "post" => "XXXXXXXX", "option" => "Friend" ],
|
||||
(object) [ "post" => "XXXXXXXX", "option" => "Student" ],
|
||||
(object) [ "post" => "XXXXXXXX", "option" => "Polymath" ],
|
||||
(object) [ "post" => "XXXXXXXX", "option" => "Geek" ],
|
||||
(object) [ "post" => "XXXXXXXX", "option" => "Nerd" ],
|
||||
(object) [ "post" => "python-dev", "option" => "Python Developer" ],
|
||||
(object) [ "post" => "ecommerce-coder", "option" => "eCommerce Coder" ],
|
||||
(object) [ "post" => "php-experience", "option" => "PHP Developer" ],
|
||||
(object) [ "post" => "ai-experience", "option" => "GPT-Agent" ],
|
||||
(object) [ "post" => "operations-experience", "option" => "DevOps Engineer" ],
|
||||
(object) [ "post" => "lua-dev", "option" => "Lua Developer" ],
|
||||
(object) [ "post" => "version-control", "option" => "Git Goblin" ],
|
||||
(object) [ "post" => "laravel-experience", "option" => "Laravel Developer" ],
|
||||
(object) [ "post" => "database-experience", "option" => "Database Admin" ],
|
||||
(object) [ "post" => "education", "option" => "Student" ],
|
||||
(object) [ "post" => "full-stack-developer", "option" => "Full-Stack Developer" ],
|
||||
(object) [ "post" => "stripe-certified-developer", "option" => "Stripe Certified Developer" ],
|
||||
|
||||
];
|
||||
shuffle($optionValues);
|
||||
Views::view( 'index', $optionValues );
|
||||
|
@ -1,3 +0,0 @@
|
||||
<?php
|
||||
// the idea is that this will be info pages for the plugin various/info
|
||||
?>
|
Reference in New Issue
Block a user