commit fd36f0f4bff7b6617844e02b2be44a88a0a8e489 Author: Local Dev Date: Mon Feb 3 12:03:51 2025 -0500 hfkfhkfhgjkuhgfkjfghkj diff --git a/.gitattribute b/.gitattribute new file mode 100644 index 0000000..d664430 --- /dev/null +++ b/.gitattribute @@ -0,0 +1,16 @@ +# Force LF for all text files +* text=auto eol=lf + +# Ensure specific file types always use LF +*.sh text eol=lf +*.js text eol=lf +*.php text eol=lf +*.html text eol=lf +*.css text eol=lf +*.json text eol=lf +*.md text eol=lf + +# Keep binary files untouched +*.png binary +*.jpg binary +*.gif binary diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..2c74cbb --- /dev/null +++ b/.gitignore @@ -0,0 +1,67 @@ +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# OSX +.DS_Store +.AppleDouble +.LSOverride + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# keep specific directories +!uploads/images/.gitignore +!bin/cli/.gitignore + +# keep main directories +!css/.gitignore +!vendor/.gitignore + +# SublimeText +*.sublime-project +*.sublime-workspace + +# TheTempusProject Specific +.htaccess +app/config/* +!app/config/constants.php +uploads/images/* +logs/* +.vscode/ +mail.log +vendor/canary/logs/* +.env +components/* +mailhog.log +uploads/* diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100755 index 0000000..2952fb1 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,74 @@ +stages: + - prepare + - build + - test + - update + - deploy + +variables: + TIMEZONE: "America/New_York" # For the system in general + DATE_TIMEZONE: ${TIMEZONE} # For PHP + + GIT_DEPTH: 1 + GITLAB_API_URL: ${CI_API_V4_URL} + TARGET_BRANCH: ${CI_COMMIT_REF_NAME} # This is the branch chosen in the `Pipeline Schedule` + TARGET_REMOTE: "https://${GITLAB_USERNAME}:${GITLAB_ACCESS_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}.git" + + # These could/should be overridden in an extending job: + UPDATE_BRANCH_PREFIX: "update_PHP_deps_" # Used for the update branch name, it will be followed by the datetime + GIT_USER: "DependBot" # Used for the update commit + GIT_EMAIL: "webmaster@thetempusproject.com" # Used for the update commit + GITLAB_USERNAME: "root" # Used for pushing the new branch and opening the MR + GITLAB_ACCESS_TOKEN: "glpat-PKEmivGtBfbz4DVPdhzk" # Used for pushing the new branch and opening the MR + MERGE_IF_SUCCESSFUL: "true" # Set to true, to merge automatically if the pipeline succeeds + SECONDS_BETWEEN_POOLING: 10 # Nbr of seconds between checking if the MR pipeline is successful, so then it will merge + JOB_GIT_FLAGS: "" + JOB_CURL_FLAGS: "" + JOB_COMPOSER_FLAGS: "" + +composer_update: + stage: update + rules: + - if: '$CI_COMMIT_BRANCH == "main"' + image: composer:latest + interruptible: true # allows to stop the job if a newer pipeline starts, saving resources and allowing new jobs to start because job concurrency is limited + script: + - git ${JOB_GIT_FLAGS} fetch origin ${TARGET_BRANCH} + - git ${JOB_GIT_FLAGS} checkout ${TARGET_BRANCH} + - git reset --hard origin/main + - git pull --allow-unrelated-histories + - export DATE_TIME="$(date '+%Y%m%d%H%M%S')" + - export MR_BRANCH="${UPDATE_BRANCH_PREFIX}${DATE_TIME}" + - git ${JOB_GIT_FLAGS} checkout -b "${MR_BRANCH}" + - composer update ${JOB_COMPOSER_FLAGS} + - if [ "$(git diff)" == "" ]; then echo "No updates needed!"; exit 0; fi + - export TITLE="Update PHP dependencies [${DATE_TIME}]" + - git ${JOB_GIT_FLAGS} commit -a -m "${TITLE}" + - git ${JOB_GIT_FLAGS} push "${TARGET_REMOTE}" "${MR_BRANCH}" + artifacts: + paths: + - vendor/ + cache: + key: ${CI_COMMIT_REF_SLUG} + paths: + - vendor/ + +prepare: + stage: prepare + script: + - echo "Preparing environment..." + +build: + stage: build + script: + - echo "Building the project..." + +test: + stage: test + script: + - echo "Running tests..." + +deploy: + stage: deploy + script: + - echo "Deploying the project..." \ No newline at end of file diff --git a/app/classes/admin_controller.php b/app/classes/admin_controller.php new file mode 100755 index 0000000..7dbc312 --- /dev/null +++ b/app/classes/admin_controller.php @@ -0,0 +1,34 @@ + + * @link https://TheTempusProject.com + * @license https://opensource.org/licenses/MIT [MIT LICENSE] + */ +namespace TheTempusProject\Classes; + +use TheTempusProject\Houdini\Classes\Template; +use TheTempusProject\Houdini\Classes\Filters; +use TheTempusProject\Houdini\Classes\Issues; +use TheTempusProject\TheTempusProject as App; +use TheTempusProject\Hermes\Functions\Redirect; +use TheTempusProject\Bedrock\Functions\Session; + +class AdminController extends Controller { + public function __construct() { + parent::__construct(); + if ( !App::$isAdmin ) { + Session::flash( 'error', 'You do not have permission to view this page.' ); + return Redirect::home(); + } + Template::noFollow(); + Template::noIndex(); + Template::setTemplate( 'admin' ); + Filters::add( 'logMenu', '#