Moved user items to user directory

This commit is contained in:
johnnyq
2025-07-28 17:57:06 -04:00
parent 0494bfc1cf
commit 95950700d8
407 changed files with 701 additions and 670 deletions

40
custom/post.php Normal file
View File

@@ -0,0 +1,40 @@
<?php
/*
* ITFlow - Custom GET/POST request handler
*/
require_once "../config.php";
require_once "../functions.php";
require_once "../includes/check_login.php";
// Define a variable that we can use to only allow running post files via inclusion (prevents people/bots poking them)
define('FROM_POST_HANDLER', true);
// Determine which files we should load
// Parse URL & get the path
$path = parse_url($_SERVER['HTTP_REFERER'], PHP_URL_PATH);
// Get the base name (the page name)
$module = explode(".", basename($path))[0];
// Strip off any _details bits
$module = str_ireplace('_details', '', $module);
// Dynamically load admin-related module POST logic
if (str_contains($module, 'custom')) {
// Dynamically load any custom POST logic
include_once "post/$module.php";
}
// Logout is the same for user and admin
require_once "../post/logout.php";
// TODO: Find a home for these
require_once "../post/ai.php";
require_once "../post/misc.php";

13
custom/post/readme.php Normal file
View File

@@ -0,0 +1,13 @@
<?php
/*
- Custom Pages -
If you wish to add custom pages to ITFlow, add them to the xcustom folder in the root directory with the prefix "xcustom_"
e.g. If your page was called my_page_one, name it "xcustom/xcustom_my_page_one.php"
Note: If required, you can use the Custom Links module to have the page show on the user sidebar.
To process POST data via your custom pages, create a file in this directory (post/xcustom) named after your page (e.g. xcustom_my_page_one.php).
The relevant file will be automatically loaded upon a POST request based on the referer - your form just needs to target the standard root/post.php.
*/

9
custom/readme.php Normal file
View File

@@ -0,0 +1,9 @@
<?php
/*
- Custom Pages -
If you wish to add custom pages to ITFlow, add them to this directory with the prefix "xcustom_"
*/

18
custom/test.php Normal file
View File

@@ -0,0 +1,18 @@
<?php
require_once "../includes/inc_xcustom.php";
?>
<!-- Breadcrumbs-->
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="index.html">Dashboard</a>
</li>
<li class="breadcrumb-item active">Blank Page</li>
</ol>
<!-- Page Content -->
<h1>Blank Page</h1>
<hr>
<p>This is a great starting point for new custom pages.</p>
<?php require_once "../includes/footer.php";