5
This commit is contained in:
@ -1,16 +0,0 @@
|
|||||||
# 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
|
|
@ -1,74 +0,0 @@
|
|||||||
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..."
|
|
Binary file not shown.
Before Width: | Height: | Size: 56 KiB |
Binary file not shown.
Before Width: | Height: | Size: 117 KiB |
Binary file not shown.
Before Width: | Height: | Size: 26 KiB |
Binary file not shown.
Before Width: | Height: | Size: 47 KiB |
@ -19,27 +19,3 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<legend class="text-center my-2">Results</legend>
|
|
||||||
<form method="post">
|
|
||||||
<fieldset>
|
|
||||||
<!-- Search -->
|
|
||||||
<div class="mb-3 row">
|
|
||||||
<label for="searchTerm" class="col-lg-6 col-form-label text-end">Search:</label>
|
|
||||||
<div class="col-lg-2">
|
|
||||||
<input type="text" class="form-control" name="searchTerm" id="searchTerm">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Hidden Token -->
|
|
||||||
<input type="hidden" name="token" value="{TOKEN}">
|
|
||||||
|
|
||||||
<!-- Submit Button -->
|
|
||||||
<div class="text-center">
|
|
||||||
<button type="submit" name="submit" value="submit" class="btn btn-primary btn-lg">Search</button>
|
|
||||||
</div>
|
|
||||||
</fieldset>
|
|
||||||
</form>
|
|
||||||
<div class="col-5 offset-1">
|
|
||||||
{searchResults}
|
|
||||||
</div>
|
|
@ -42,7 +42,7 @@
|
|||||||
<li>Removed unused code</li>
|
<li>Removed unused code</li>
|
||||||
<li>View organization</li>
|
<li>View organization</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p class="text-muted">
|
<p class="text-center">
|
||||||
<a class="btn btn-md btn-outline-primary mt-2"href="https://git.thetempusproject.com/the-tempus-project/TheTempusProject/-/tags/5.0" target="_blank">
|
<a class="btn btn-md btn-outline-primary mt-2"href="https://git.thetempusproject.com/the-tempus-project/TheTempusProject/-/tags/5.0" target="_blank">
|
||||||
<span class="fa-brands fa-fw fa-gitlab"></span> Tag
|
<span class="fa-brands fa-fw fa-gitlab"></span> Tag
|
||||||
</a>
|
</a>
|
||||||
@ -139,7 +139,7 @@
|
|||||||
<li>Bugfixes</li>
|
<li>Bugfixes</li>
|
||||||
<li>Comment updates</li>
|
<li>Comment updates</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p class="text-muted">
|
<p class="text-center">
|
||||||
<a class="btn btn-md btn-outline-primary mt-2"href="https://git.thetempusproject.com/the-tempus-project/TheTempusProject/-/tags/4.0" target="_blank">
|
<a class="btn btn-md btn-outline-primary mt-2"href="https://git.thetempusproject.com/the-tempus-project/TheTempusProject/-/tags/4.0" target="_blank">
|
||||||
<span class="fa-brands fa-fw fa-gitlab"></span> Tag
|
<span class="fa-brands fa-fw fa-gitlab"></span> Tag
|
||||||
</a>
|
</a>
|
||||||
@ -157,7 +157,7 @@
|
|||||||
<li>Composer update</li>
|
<li>Composer update</li>
|
||||||
<li>Switch to composer dependencies for front-end assets</li>
|
<li>Switch to composer dependencies for front-end assets</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p class="text-muted">
|
<p class="text-center">
|
||||||
<a class="btn btn-md btn-outline-primary mt-2"href="https://git.thetempusproject.com/the-tempus-project/TheTempusProject/-/tags/3.0.17" target="_blank">
|
<a class="btn btn-md btn-outline-primary mt-2"href="https://git.thetempusproject.com/the-tempus-project/TheTempusProject/-/tags/3.0.17" target="_blank">
|
||||||
<span class="fa-brands fa-fw fa-gitlab"></span> Tag
|
<span class="fa-brands fa-fw fa-gitlab"></span> Tag
|
||||||
</a>
|
</a>
|
||||||
@ -174,7 +174,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li>Composer update</li>
|
<li>Composer update</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p class="text-muted">
|
<p class="text-center">
|
||||||
<a class="btn btn-md btn-outline-primary mt-2"href="https://git.thetempusproject.com/the-tempus-project/TheTempusProject/-/tags/3.0.16" target="_blank">
|
<a class="btn btn-md btn-outline-primary mt-2"href="https://git.thetempusproject.com/the-tempus-project/TheTempusProject/-/tags/3.0.16" target="_blank">
|
||||||
<span class="fa-brands fa-fw fa-gitlab"></span> Tag
|
<span class="fa-brands fa-fw fa-gitlab"></span> Tag
|
||||||
</a>
|
</a>
|
||||||
@ -191,7 +191,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li>Composer update</li>
|
<li>Composer update</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p class="text-muted">
|
<p class="text-center">
|
||||||
<a class="btn btn-md btn-outline-primary mt-2"href="https://git.thetempusproject.com/the-tempus-project/TheTempusProject/-/tags/3.0.15" target="_blank">
|
<a class="btn btn-md btn-outline-primary mt-2"href="https://git.thetempusproject.com/the-tempus-project/TheTempusProject/-/tags/3.0.15" target="_blank">
|
||||||
<span class="fa-brands fa-fw fa-gitlab"></span> Tag
|
<span class="fa-brands fa-fw fa-gitlab"></span> Tag
|
||||||
</a>
|
</a>
|
||||||
@ -209,7 +209,7 @@
|
|||||||
<li>Numerous bugfixes</li>
|
<li>Numerous bugfixes</li>
|
||||||
<li>Composer update</li>
|
<li>Composer update</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p class="text-muted">
|
<p class="text-center">
|
||||||
<a class="btn btn-md btn-outline-primary mt-2"href="https://git.thetempusproject.com/the-tempus-project/TheTempusProject/-/tags/3.0.14" target="_blank">
|
<a class="btn btn-md btn-outline-primary mt-2"href="https://git.thetempusproject.com/the-tempus-project/TheTempusProject/-/tags/3.0.14" target="_blank">
|
||||||
<span class="fa-brands fa-fw fa-gitlab"></span> Tag
|
<span class="fa-brands fa-fw fa-gitlab"></span> Tag
|
||||||
</a>
|
</a>
|
||||||
@ -233,7 +233,7 @@
|
|||||||
<li>Composer updates</li>
|
<li>Composer updates</li>
|
||||||
<li>Readme update</li>
|
<li>Readme update</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p class="text-muted">
|
<p class="text-center">
|
||||||
<a class="btn btn-md btn-outline-primary mt-2"href="https://git.thetempusproject.com/the-tempus-project/TheTempusProject/-/tags/3.0.13" target="_blank">
|
<a class="btn btn-md btn-outline-primary mt-2"href="https://git.thetempusproject.com/the-tempus-project/TheTempusProject/-/tags/3.0.13" target="_blank">
|
||||||
<span class="fa-brands fa-fw fa-gitlab"></span> Tag
|
<span class="fa-brands fa-fw fa-gitlab"></span> Tag
|
||||||
</a>
|
</a>
|
||||||
|
@ -1,35 +0,0 @@
|
|||||||
{installer-nav}
|
|
||||||
<div class="container">
|
|
||||||
<div class="row justify-content-center">
|
|
||||||
<div class="col-md-10 pt-4">
|
|
||||||
<form method="post">
|
|
||||||
<fieldset>
|
|
||||||
<div class="mb-3 col-md-4 offset-md-4">
|
|
||||||
<label for="newUsername" class="form-label">Username:</label>
|
|
||||||
<input class="form-control" type="text" name="newUsername" id="newUsername" value="">
|
|
||||||
</div>
|
|
||||||
<div class="mb-3 col-md-4 offset-md-4">
|
|
||||||
<label for="userEmail" class="form-label">Email:</label>
|
|
||||||
<input class="form-control" type="email" name="userEmail" id="userEmail" value="">
|
|
||||||
</div>
|
|
||||||
<div class="mb-3 col-md-4 offset-md-4">
|
|
||||||
<label for="userEmail2" class="form-label">Re-enter Email:</label>
|
|
||||||
<input class="form-control" type="email" name="userEmail2" id="userEmail2" value="">
|
|
||||||
</div>
|
|
||||||
<div class="mb-3 col-md-4 offset-md-4">
|
|
||||||
<label for="userPassword" class="form-label">Password:</label>
|
|
||||||
<input class="form-control" type="password" name="userPassword" id="userPassword">
|
|
||||||
</div>
|
|
||||||
<div class="mb-3 col-md-4 offset-md-4">
|
|
||||||
<label for="userPassword2" class="form-label">Re-enter Password:</label>
|
|
||||||
<input class="form-control" type="password" name="userPassword2" id="userPassword2">
|
|
||||||
</div>
|
|
||||||
</fieldset>
|
|
||||||
<input type="hidden" name="token" value="{TOKEN}">
|
|
||||||
<div class="text-center">
|
|
||||||
<button class="btn btn-lg btn-primary center-block" type="submit" name="submit" value="submit">Complete</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
@ -1,16 +0,0 @@
|
|||||||
{installer-nav}
|
|
||||||
<div class="container">
|
|
||||||
<div class="row justify-content-center">
|
|
||||||
<div class="col-md-10">
|
|
||||||
<div class="install-terms col-lg-8 mx-auto mt-4">
|
|
||||||
{TERMS}
|
|
||||||
</div>
|
|
||||||
<div class="text-center my-4">
|
|
||||||
<form method="post">
|
|
||||||
<input type="hidden" name="token" value="{TOKEN}">
|
|
||||||
<button class="btn btn-lg btn-primary center-block" type="submit" name="submit" value="submit">I Agree</button><br>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
@ -1,23 +0,0 @@
|
|||||||
{installer-nav}
|
|
||||||
<div class="container">
|
|
||||||
<div class="row justify-content-center">
|
|
||||||
<div class="col-md-10">
|
|
||||||
<h2 class="mt-4">Requirements</h2>
|
|
||||||
<ul>
|
|
||||||
<li>PHP version greater than 5.6</li>
|
|
||||||
<li>Session storage must be enabled</li>
|
|
||||||
<li>PHP mail must be enabled.</li>
|
|
||||||
<li>Safe mode must be disabled.</li>
|
|
||||||
<li>Rewrite rule must be on</li>
|
|
||||||
<li>file uploads must be on</li>
|
|
||||||
<li>mysql_pdo must be enabled</li>
|
|
||||||
</ul>
|
|
||||||
<div class="text-center">
|
|
||||||
<form method="post">
|
|
||||||
<input type="hidden" name="token" value="{TOKEN}">
|
|
||||||
<button class="btn btn-lg btn-primary center-block" type="submit" name="submit" value="submit">Check</button><br>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
@ -1,32 +0,0 @@
|
|||||||
<div class="container py-5">
|
|
||||||
<div class="row justify-content-center">
|
|
||||||
<div class="col-lg-8 text-center">
|
|
||||||
<!-- Success Icon -->
|
|
||||||
<div class="mb-4">
|
|
||||||
<i class="fa fa-check-circle text-success display-3"></i>
|
|
||||||
</div>
|
|
||||||
<!-- Title -->
|
|
||||||
<h1 class="display-5 fw-bold text-success">Success</h1>
|
|
||||||
<!-- Subtitle -->
|
|
||||||
<h3 class="mt-3">
|
|
||||||
The Tempus Project has been successfully installed.
|
|
||||||
</h3>
|
|
||||||
<p class="lead mt-3">
|
|
||||||
You can now log in and manage your site or jump straight into building your new features!
|
|
||||||
</p>
|
|
||||||
<!-- Info Readout Placeholder -->
|
|
||||||
<p class="mt-4 text-muted">
|
|
||||||
<em>Some plugins may need additional configuration and there are already some pre-made resources to get you started. (Both in the files and the Admin Panel)</em>
|
|
||||||
</p>
|
|
||||||
<!-- Call-to-Action Buttons -->
|
|
||||||
<div class="d-flex justify-content-center gap-3 mt-4">
|
|
||||||
<a href="/home/login" class="btn btn-success btn-lg">
|
|
||||||
<i class="fa fa-sign-in-alt me-2"></i> Log In
|
|
||||||
</a>
|
|
||||||
<a href="/home/index" class="btn btn-outline-success btn-lg">
|
|
||||||
<i class="fa fa-cogs me-2"></i> Go to Homepage
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
@ -1,44 +0,0 @@
|
|||||||
<div class="context-main-bg my-3 pb-3 rounded col-10 offset-1">
|
|
||||||
{installer-nav}
|
|
||||||
<div class="row justify-content-center">
|
|
||||||
<div class="col-md-10">
|
|
||||||
<legend class="my-3 text-center">Configure</legend>
|
|
||||||
<form method="post" enctype="multipart/form-data">
|
|
||||||
<fieldset>
|
|
||||||
<div class="mb-3 col-md-4 offset-md-4">
|
|
||||||
<label for="siteName" class="form-label">Site Name:</label>
|
|
||||||
<input class="form-control" type="text" name="siteName" id="siteName" value="">
|
|
||||||
</div>
|
|
||||||
<div class="mb-3 col-md-4 offset-md-4">
|
|
||||||
<label for="logo" class="form-label">Logo (200 x 200px):</label>
|
|
||||||
<input class="form-control" type="file" name="logo" id="logo">
|
|
||||||
</div>
|
|
||||||
<div class="mb-3 col-md-4 offset-md-4">
|
|
||||||
<label for="dbPrefix" class="form-label">Database Table Prefix:</label>
|
|
||||||
<input class="form-control" type="text" name="dbPrefix" id="dbPrefix" value="">
|
|
||||||
</div>
|
|
||||||
<div class="mb-3 col-md-4 offset-md-4">
|
|
||||||
<label for="dbHost" class="form-label">Database Host:</label>
|
|
||||||
<input class="form-control" type="text" name="dbHost" id="dbHost" value="">
|
|
||||||
</div>
|
|
||||||
<div class="mb-3 col-md-4 offset-md-4">
|
|
||||||
<label for="dbName" class="form-label">Database Name:</label>
|
|
||||||
<input class="form-control" type="text" name="dbName" id="dbName" value="">
|
|
||||||
</div>
|
|
||||||
<div class="mb-3 col-md-4 offset-md-4">
|
|
||||||
<label for="dbUsername" class="form-label">Database Username:</label>
|
|
||||||
<input class="form-control" type="text" name="dbUsername" id="dbUsername" value="">
|
|
||||||
</div>
|
|
||||||
<div class="mb-3 col-md-4 offset-md-4">
|
|
||||||
<label for="dbPassword" class="form-label">Database Password:</label>
|
|
||||||
<input class="form-control" type="password" name="dbPassword" id="dbPassword">
|
|
||||||
</div>
|
|
||||||
</fieldset>
|
|
||||||
<input type="hidden" name="token" value="{TOKEN}">
|
|
||||||
<div class="text-center mb-3">
|
|
||||||
<button class="btn btn-lg btn-primary center-block" type="submit" name="submit" value="submit">Save</button><br>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
@ -1,37 +0,0 @@
|
|||||||
<div class="context-main-bg my-3 pb-3 rounded col-10 offset-1">
|
|
||||||
{installer-nav}
|
|
||||||
<div class="row justify-content-center">
|
|
||||||
<div class="col-md-10">
|
|
||||||
<p class="my-4">All models are required for proper installation of The Tempus Project. In this step, we will add the database tables required for these models. In the next step, you'll be able to select which plugins you would like installed.</p>
|
|
||||||
<form method="post">
|
|
||||||
<table class="table table-striped">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th class="px-5" style="width: 70%">Model Name</th>
|
|
||||||
<th class="text-center" style="width: 20%">Version</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{LOOP}
|
|
||||||
<tr>
|
|
||||||
<td class="px-5">{name}</td>
|
|
||||||
<td class="text-center">{version}</td>
|
|
||||||
</tr>
|
|
||||||
{/LOOP}
|
|
||||||
{ALT}
|
|
||||||
<tr>
|
|
||||||
<td class="text-center" colspan="3">
|
|
||||||
No models to install.
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{/ALT}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<input type="hidden" name="token" value="{TOKEN}">
|
|
||||||
<div class="text-center">
|
|
||||||
<button class="btn btn-lg btn-primary center-block" type="submit" name="submit" value="submit">Install</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
@ -1,12 +0,0 @@
|
|||||||
<div class="nav nav-tabs justify-content-center pt-3 col-10 offset-1" id="nav-tab" role="tablist">
|
|
||||||
<button class="nav-link {menu-Welcome}" type="button" role="tab">Welcome</button>
|
|
||||||
<button class="nav-link {menu-Terms}" type="button" role="tab">Terms</button>
|
|
||||||
<button class="nav-link {menu-Verify}" type="button" role="tab">Verify</button>
|
|
||||||
<button class="nav-link {menu-Configure}" type="button" role="tab">Configure</button>
|
|
||||||
<button class="nav-link {menu-Routing}" type="button" role="tab">Routing</button>
|
|
||||||
<button class="nav-link {menu-Models}" type="button" role="tab">Models</button>
|
|
||||||
<button class="nav-link {menu-Plugins}" type="button" role="tab">Plugins</button>
|
|
||||||
<button class="nav-link {menu-Resources}" type="button" role="tab">Resources</button>
|
|
||||||
<button class="nav-link {menu-User}" type="button" role="tab">User</button>
|
|
||||||
<button class="nav-link {menu-Complete}" type="button" role="tab">Complete</button>
|
|
||||||
</div>
|
|
@ -1,45 +0,0 @@
|
|||||||
<div class="context-main-bg my-3 pb-3 rounded col-10 offset-1">
|
|
||||||
{installer-nav}
|
|
||||||
<div class="row justify-content-center">
|
|
||||||
<div class="col-md-10">
|
|
||||||
<p class="my-4">
|
|
||||||
The Tempus Project was built to utilize all of the plugins provided with the installer. You can choose not to enable any one of them, but it may negatively impact the operation of your site.
|
|
||||||
</p>
|
|
||||||
<form method="post">
|
|
||||||
<table class="table table-striped">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th class="px-5" style="width: 70%">Plugin Name</th>
|
|
||||||
<th class="text-center" style="width: 20%">Version</th>
|
|
||||||
<th class="text-center" style="width: 10%">
|
|
||||||
<input type="checkbox" onchange="checkAll(this)" name="check.m" value="P_[]" checked="checked">
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{LOOP}
|
|
||||||
<tr>
|
|
||||||
<td class="px-5">{name}</td>
|
|
||||||
<td class="text-center">{version}</td>
|
|
||||||
<td class="text-center">
|
|
||||||
<input type="checkbox" value="{name}" name="P_[]" checked="checked">
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{/LOOP}
|
|
||||||
{ALT}
|
|
||||||
<tr>
|
|
||||||
<td align="center" colspan="3">
|
|
||||||
No models to install.
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{/ALT}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<input type="hidden" name="token" value="{TOKEN}">
|
|
||||||
<div class="text-center mb-3">
|
|
||||||
<button class="btn btn-lg btn-primary center-block" type="submit" name="submit" value="submit">Install</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
@ -1,16 +0,0 @@
|
|||||||
<div class="context-main-bg my-3 pb-3 rounded col-10 offset-1">
|
|
||||||
{installer-nav}
|
|
||||||
<div class="row justify-content-center">
|
|
||||||
<div class="col-md-10">
|
|
||||||
<p class="my-4">
|
|
||||||
Some models such as groups will need additional database resources and configurations to function properly. In this step, we will install those features.
|
|
||||||
</p>
|
|
||||||
<form method="post">
|
|
||||||
<input type="hidden" name="token" value="{TOKEN}">
|
|
||||||
<div class="text-center my-3">
|
|
||||||
<button class="btn btn-lg btn-primary center-block" type="submit" name="submit" value="submit">Install Resources</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
@ -1,18 +0,0 @@
|
|||||||
<div class="context-main-bg my-3 pb-3 rounded col-10 offset-1">
|
|
||||||
{installer-nav}
|
|
||||||
<div class="row justify-content-center">
|
|
||||||
<div class="col-md-10">
|
|
||||||
<p class="mt-4">The Tempus Project uses rewrites in htaccess files (Apache), or location directives (Nginx), to automatically route all incoming traffic through the app. In this step, we will help set-up and then test that the required configurations have been made.</p>
|
|
||||||
<h3>Apache Users</h3>
|
|
||||||
<p>In this step, we will attempt to generate the appropriate files for Apache servers.</p>
|
|
||||||
<h3>Nginx Users</h3>
|
|
||||||
<p>If you are using Nginx, you will need to update your server's configuration manually. Please see the documentation, for convenience, an example configuration has been provided with TheTempusProject and can be found in the app/resources directory.</p>
|
|
||||||
<form method="post">
|
|
||||||
<input type="hidden" name="token" value="{TOKEN}">
|
|
||||||
<div class="text-center">
|
|
||||||
<button class="btn btn-lg btn-primary center-block mb-3" type="submit" name="submit" value="submit">Generate</button><br>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
@ -1,13 +0,0 @@
|
|||||||
<div class="container">
|
|
||||||
<div class="row justify-content-center">
|
|
||||||
<div class="col-md-10 text-center">
|
|
||||||
{installer-nav}
|
|
||||||
<h1 class="mt-4">Welcome to The Tempus Project Installer.</h1>
|
|
||||||
<p>This installer will guide you through the process of installing and configuring The Tempus Project. Do not forget to delete this file once you have completed installation.</p>
|
|
||||||
<form action="" method="post">
|
|
||||||
<input type="hidden" name="token" value="{TOKEN}">
|
|
||||||
<button class="btn btn-lg btn-primary center-block" type="submit" name="submit" id="submit" value="submit">Begin Installation</button><br>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
@ -1,16 +0,0 @@
|
|||||||
<div class="context-main-bg my-3 pb-3 rounded col-10 offset-1">
|
|
||||||
{installer-nav}
|
|
||||||
<div class="row justify-content-center">
|
|
||||||
<div class="col-10">
|
|
||||||
<div class="install-terms col-lg-8 mx-auto mt-4">
|
|
||||||
{TERMS}
|
|
||||||
</div>
|
|
||||||
<div class="text-center my-4">
|
|
||||||
<form method="post">
|
|
||||||
<input type="hidden" name="token" value="{TOKEN}">
|
|
||||||
<button class="btn btn-lg btn-primary center-block mb-3" type="submit" name="submit" value="submit">I Agree</button><br>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
@ -1,35 +0,0 @@
|
|||||||
<div class="context-main-bg my-3 pb-3 rounded col-10 offset-1">
|
|
||||||
{installer-nav}
|
|
||||||
<div class="row justify-content-center">
|
|
||||||
<div class="col-md-10 pt-4">
|
|
||||||
<form method="post">
|
|
||||||
<fieldset>
|
|
||||||
<div class="mb-3 col-md-4 offset-md-4">
|
|
||||||
<label for="newUsername" class="form-label">Username:</label>
|
|
||||||
<input class="form-control" type="text" name="newUsername" id="newUsername" value="">
|
|
||||||
</div>
|
|
||||||
<div class="mb-3 col-md-4 offset-md-4">
|
|
||||||
<label for="userEmail" class="form-label">Email:</label>
|
|
||||||
<input class="form-control" type="email" name="userEmail" id="userEmail" value="">
|
|
||||||
</div>
|
|
||||||
<div class="mb-3 col-md-4 offset-md-4">
|
|
||||||
<label for="userEmail2" class="form-label">Re-enter Email:</label>
|
|
||||||
<input class="form-control" type="email" name="userEmail2" id="userEmail2" value="">
|
|
||||||
</div>
|
|
||||||
<div class="mb-3 col-md-4 offset-md-4">
|
|
||||||
<label for="userPassword" class="form-label">Password:</label>
|
|
||||||
<input class="form-control" type="password" name="userPassword" id="userPassword">
|
|
||||||
</div>
|
|
||||||
<div class="mb-3 col-md-4 offset-md-4">
|
|
||||||
<label for="userPassword2" class="form-label">Re-enter Password:</label>
|
|
||||||
<input class="form-control" type="password" name="userPassword2" id="userPassword2">
|
|
||||||
</div>
|
|
||||||
</fieldset>
|
|
||||||
<input type="hidden" name="token" value="{TOKEN}">
|
|
||||||
<div class="text-center">
|
|
||||||
<button class="btn btn-lg btn-primary center-block" type="submit" name="submit" value="submit">Complete</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
@ -1,23 +0,0 @@
|
|||||||
<div class="context-main-bg my-3 pb-3 rounded col-10 offset-1">
|
|
||||||
{installer-nav}
|
|
||||||
<div class="row justify-content-center">
|
|
||||||
<div class="col-md-10">
|
|
||||||
<h2 class="mt-4">Requirements</h2>
|
|
||||||
<ul>
|
|
||||||
<li>PHP version greater than 5.6</li>
|
|
||||||
<li>Session storage must be enabled</li>
|
|
||||||
<li>PHP mail must be enabled.</li>
|
|
||||||
<li>Safe mode must be disabled.</li>
|
|
||||||
<li>Rewrite rule must be on</li>
|
|
||||||
<li>file uploads must be on</li>
|
|
||||||
<li>mysql_pdo must be enabled</li>
|
|
||||||
</ul>
|
|
||||||
<div class="text-center">
|
|
||||||
<form method="post">
|
|
||||||
<input type="hidden" name="token" value="{TOKEN}">
|
|
||||||
<button class="btn btn-lg btn-primary center-block mb-3" type="submit" name="submit" value="submit">Check</button><br>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
@ -1,17 +0,0 @@
|
|||||||
<div class="container">
|
|
||||||
<div class="row justify-content-center">
|
|
||||||
<div class="col-md-10 text-center">
|
|
||||||
<div class="context-main-bg my-3 pb-3 rounded">
|
|
||||||
{installer-nav}
|
|
||||||
<h1 class="mt-5 mb-4">Welcome to The Tempus Project Installer.</h1>
|
|
||||||
<p class="lead p-3">
|
|
||||||
This installer will guide you through the process of installing and configuring The Tempus Project. Do not forget to delete this file once you have completed installation.
|
|
||||||
</p>
|
|
||||||
<form method="post">
|
|
||||||
<input type="hidden" name="token" value="{TOKEN}">
|
|
||||||
<button class="btn btn-lg btn-primary center-block mb-3" type="submit" name="submit" id="submit" value="submit">Begin Installation</button><br>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
407
install.php
407
install.php
@ -1,407 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* install.php
|
|
||||||
*
|
|
||||||
* This is the install controller for the application.
|
|
||||||
* After completion: YOU SHOULD DELETE THIS FILE.
|
|
||||||
*
|
|
||||||
* @version 3.0
|
|
||||||
* @author Joey Kimsey <Joey@thetempusproject.com>
|
|
||||||
* @link https://TheTempusProject.com
|
|
||||||
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
|
||||||
*/
|
|
||||||
namespace TheTempusProject\Controllers;
|
|
||||||
|
|
||||||
require_once 'bin/autoload.php';
|
|
||||||
|
|
||||||
use TheTempusProject\TheTempusProject;
|
|
||||||
use TheTempusProject\Classes\Controller;
|
|
||||||
use TheTempusProject\Classes\Plugin;
|
|
||||||
use TheTempusProject\Classes\Installer;
|
|
||||||
use TheTempusProject\Classes\Forms;
|
|
||||||
use TheTempusProject\Models\User;
|
|
||||||
use TheTempusProject\Classes\Email;
|
|
||||||
use TheTempusProject\Bedrock\Functions\Code;
|
|
||||||
use TheTempusProject\Bedrock\Functions\Check;
|
|
||||||
use TheTempusProject\Bedrock\Functions\Cookie;
|
|
||||||
use TheTempusProject\Bedrock\Functions\Input;
|
|
||||||
use TheTempusProject\Bedrock\Functions\Upload;
|
|
||||||
use TheTempusProject\Bedrock\Functions\Hash;
|
|
||||||
use TheTempusProject\Bedrock\Functions\Session;
|
|
||||||
use TheTempusProject\Houdini\Classes\Issues;
|
|
||||||
use TheTempusProject\Houdini\Classes\Views;
|
|
||||||
use TheTempusProject\Houdini\Classes\Components;
|
|
||||||
use TheTempusProject\Houdini\Classes\Template;
|
|
||||||
use TheTempusProject\Hermes\Functions\Redirect;
|
|
||||||
use TheTempusProject\Hermes\Functions\Route;
|
|
||||||
use TheTempusProject\Canary\Bin\Canary as Debug;
|
|
||||||
|
|
||||||
class Install extends Controller {
|
|
||||||
private $installer;
|
|
||||||
private $location = false;
|
|
||||||
private $steps = [
|
|
||||||
'Welcome',
|
|
||||||
'Terms',
|
|
||||||
'Verify',
|
|
||||||
'Configure',
|
|
||||||
'Routing',
|
|
||||||
'Models',
|
|
||||||
'Plugins',
|
|
||||||
'Install',
|
|
||||||
'Resources',
|
|
||||||
'User',
|
|
||||||
'Complete',
|
|
||||||
];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is the main builder for the rest of the controller. It mostly handle template variables used on all pages.
|
|
||||||
*/
|
|
||||||
public function __construct() {
|
|
||||||
parent::__construct();
|
|
||||||
self::$title = 'TP Installer';
|
|
||||||
self::$pageDescription = 'This is the install script for The Tempus Project.';
|
|
||||||
$this->installer = new Installer();
|
|
||||||
Template::noIndex();
|
|
||||||
Template::noFollow();
|
|
||||||
foreach ( $this->steps as $step ) {
|
|
||||||
Components::set( 'menu-' . $step, 'disabled' );
|
|
||||||
}
|
|
||||||
if ( $this->checkSession() !== false ) {
|
|
||||||
$this->location = $this->getStep();
|
|
||||||
Components::set( 'menu-' . ucfirst( $this->location ), 'active' );
|
|
||||||
} else {
|
|
||||||
Components::set( 'menu-Welcome', 'active' );
|
|
||||||
}
|
|
||||||
Components::set( 'installer-nav', Views::simpleView( 'install.nav' ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This method will reset the install hash, set the saved install step, update the session and cookie, and refresh if required.
|
|
||||||
*
|
|
||||||
* @param string $page
|
|
||||||
* @param boolean $redirect
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function nextStep( $page, $redirect = false ) {
|
|
||||||
$newHash = Code::genInstall();
|
|
||||||
$this->installer->setNode( 'installHash', $newHash, true );
|
|
||||||
$this->installer->setNode( 'installStep', $page, true );
|
|
||||||
Session::put( 'installHash', $newHash );
|
|
||||||
Cookie::put( 'installHash', $newHash );
|
|
||||||
if ( $redirect === true ) {
|
|
||||||
Redirect::reload();
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function checkSession() {
|
|
||||||
if ( empty( $this->installer->getNode('installHash') ) ) {
|
|
||||||
Debug::error( 'install hash not found on file.' );
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
$session = Session::get( 'installHash' );
|
|
||||||
$cookie = Cookie::get( 'installHash' );
|
|
||||||
$file = $this->installer->getNode('installHash');
|
|
||||||
|
|
||||||
if ( ! $session && ! $cookie ) {
|
|
||||||
Debug::error( 'install hash not found in session or cookie.' );
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if ( $cookie && ! $session ) {
|
|
||||||
if ( $cookie !== $file ) {
|
|
||||||
Debug::error( 'install cookie did not match install file.' );
|
|
||||||
Cookie::delete( 'installHash' );
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
Debug::error( 'cookie matches file, using as session' );
|
|
||||||
Session::put( 'installHash', $cookie );
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if ( $session !== $file ) {
|
|
||||||
Debug::error( 'session did not match file, deleting session' );
|
|
||||||
Session::delete( 'installHash' );
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getStep() {
|
|
||||||
if ( !empty( $this->installer->getNode('installStep') ) ) {
|
|
||||||
return $this->installer->getNode('installStep');
|
|
||||||
}
|
|
||||||
Debug::error( 'install status not found.' );
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The index method is called on the first request and all requests thereafter and is responsible for routing
|
|
||||||
* the current request to the appropriate installer step/method.
|
|
||||||
*/
|
|
||||||
public function index() {
|
|
||||||
if ( false === $this->location ) {
|
|
||||||
return $this->welcome();
|
|
||||||
}
|
|
||||||
// this seems dumb, i could probably do this better
|
|
||||||
$location = $this->location;
|
|
||||||
return $this->$location();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The welcome method is is just a page to submit a form and save the install.json for the first time.
|
|
||||||
*/
|
|
||||||
public function welcome() {
|
|
||||||
if ( Forms::Check( 'installStart' ) ) {
|
|
||||||
return $this->nextStep( 'terms', true );
|
|
||||||
}
|
|
||||||
// dv( $_POST );
|
|
||||||
if ( Input::exists('submit') ) {
|
|
||||||
Issues::add( 'error', ['There was an error with the Installation.' => Check::userErrors()] );
|
|
||||||
}
|
|
||||||
Views::view( 'install.start' );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The terms step is pretty straight forward. You simply need to continue to the next step, understanding
|
|
||||||
* that you agree to these terms when you continue the installation.
|
|
||||||
*/
|
|
||||||
public function terms() {
|
|
||||||
if ( Forms::Check( 'installAgreement' ) ) {
|
|
||||||
return $this->nextStep( 'verify', true );
|
|
||||||
}
|
|
||||||
if ( Input::exists( 'submit' ) ) {
|
|
||||||
Issues::add( 'error', [ 'There was an error with the Installation.' => Check::userErrors() ] );
|
|
||||||
}
|
|
||||||
Components::set( 'TERMS', Views::simpleView( 'terms' ) );
|
|
||||||
Views::view( 'install.agreement' );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* There is a small list a of requirements for the application to run properly. These are things like sessions, emails, cookies, etc.
|
|
||||||
* This step verifies that all of these features are working as expected.
|
|
||||||
*/
|
|
||||||
public function verify() {
|
|
||||||
if ( Forms::Check( 'installCheck' ) ) {
|
|
||||||
return $this->nextStep( 'configure', true );
|
|
||||||
}
|
|
||||||
if ( Input::exists( 'submit' ) ) {
|
|
||||||
Issues::add( 'error', ['There was an error with the Installation.' => array_merge( Check::userErrors(), Check::systemErrors() )] );
|
|
||||||
}
|
|
||||||
Views::view( 'install.check' );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* One of the most important steps for installation, is the configuration. In this step, we will define some very core settings
|
|
||||||
* for the app including the app's name and database credentials.
|
|
||||||
*/
|
|
||||||
public function configure() {
|
|
||||||
if ( Forms::Check( 'installConfigure' ) ) {
|
|
||||||
$logo = 'images/logo.png';
|
|
||||||
if ( Input::exists( 'logo' ) && Upload::image( 'logo', 'System' ) ) {
|
|
||||||
$logo = 'Uploads/Images/System/' . Upload::last();
|
|
||||||
}
|
|
||||||
TheTempusProject::$activeConfig->load( BEDROCK_CONFIG_JSON );
|
|
||||||
$baseConfig = TheTempusProject::$configMatrix;
|
|
||||||
$baseConfig['main']['logo']['value'] = $logo;
|
|
||||||
$baseConfig['main']['name']['value'] = Input::postNull( 'siteName' );
|
|
||||||
$baseConfig['main']['template']['value'] = $baseConfig['main']['template']['default'];
|
|
||||||
$baseConfig['main']['tokenEnabled']['value'] = $baseConfig['main']['tokenEnabled']['default'];
|
|
||||||
$baseConfig['main']['loginLimit']['value'] = $baseConfig['main']['loginLimit']['default'];
|
|
||||||
$baseConfig['database']['dbEnabled']['value'] = $baseConfig['database']['dbEnabled']['default'];
|
|
||||||
$baseConfig['database']['dbHost']['value'] = Input::postNull( 'dbHost' );
|
|
||||||
$baseConfig['database']['dbMaxQuery']['value'] = $baseConfig['database']['dbMaxQuery']['default'];
|
|
||||||
$baseConfig['database']['dbName']['value'] = Input::postNull( 'dbName' );
|
|
||||||
$baseConfig['database']['dbPassword']['value'] = Input::postNull( 'dbPassword' );
|
|
||||||
$baseConfig['database']['dbPrefix']['value'] = Input::postNull( 'dbPrefix' );
|
|
||||||
$baseConfig['database']['dbUsername']['value'] = Input::postNull( 'dbUsername' );
|
|
||||||
if ( ! TheTempusProject::$activeConfig->generate( CONFIG_JSON, $baseConfig ) ) {
|
|
||||||
return Issues::add( 'error', 'Config file already exists so the installer has been halted. If there was an error with installation, please delete app/config/config.json manually and try again. The installer should automatically bring you back to this step.' );
|
|
||||||
}
|
|
||||||
Session::flash( 'success', 'Config saved successfully.' );
|
|
||||||
return $this->nextStep( 'routing', true );
|
|
||||||
}
|
|
||||||
if ( Input::exists( 'submit' ) ) {
|
|
||||||
Issues::add( 'error', ['There was an error with your form.' => Check::userErrors()] );
|
|
||||||
}
|
|
||||||
Views::view( 'install.configure' );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* For the application to function properly on nginx or apache, the web servers must be configured correctly.
|
|
||||||
* Depending on which server you use, this step will help you set up and test the routing required for the
|
|
||||||
* application to function as expected.
|
|
||||||
*/
|
|
||||||
public function routing() {
|
|
||||||
if ( Input::exists( 'submit' ) && Forms::Check( 'installRouting' ) ) {
|
|
||||||
// if its Apache, attempt to generate the htaccess file before testing
|
|
||||||
if ( Check::isApache() ) {
|
|
||||||
if ( !$this->installer->checkHtaccess() ) {
|
|
||||||
if ( !$this->installer->saveHtaccess() ) {
|
|
||||||
Issues::add( 'error', 'There was an unexpected error when generating your htaccess file. Please see the error logs for more information.' );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Apache should have the htaccess now, and Nginx should have been configured this way out of the box
|
|
||||||
if ( Route::testRouting() ) {
|
|
||||||
Session::flash( 'success', 'Routing is working as expected.' );
|
|
||||||
return $this->nextStep( 'models', true );
|
|
||||||
} else {
|
|
||||||
Issues::add( 'error', 'Could not verify url routing' );
|
|
||||||
}
|
|
||||||
// routing is busted, if its Apache, we already have the error from htaccess generation
|
|
||||||
// so Nginx is the only one that needs more info
|
|
||||||
if ( Check::isNginx() ) {
|
|
||||||
Issues::add( 'error', 'There appears to be an issue with your configuration. Certain urls are not being routed as expected.' );
|
|
||||||
}
|
|
||||||
} elseif ( Input::exists( 'submit' ) ) {
|
|
||||||
Issues::add( 'error', ['There was an error with your form.' => Check::userErrors()] );
|
|
||||||
}
|
|
||||||
Views::view( 'install.routing' );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Since models are required for the proper function of the app, this step is required and has no selection to make.
|
|
||||||
* This step will install all the required models excluding resources.
|
|
||||||
*/
|
|
||||||
public function models() {
|
|
||||||
$errors = [];
|
|
||||||
$options = [ 'installResources' => false ];
|
|
||||||
$models = $this->installer->getModelList( MODEL_DIRECTORY );
|
|
||||||
if ( Input::exists( 'submit' ) && Forms::Check( 'installModels' ) ) {
|
|
||||||
$error = false;
|
|
||||||
foreach ( $models as $model ) {
|
|
||||||
$result = $this->installer->installModel( $model, $options );
|
|
||||||
|
|
||||||
if ( $result === false ) {
|
|
||||||
$error = true;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ( $error ) {
|
|
||||||
Issues::add( 'error', [ 'There was an error with the Installation.' => $this->installer->getErrors() ] );
|
|
||||||
} else {
|
|
||||||
Session::flash( 'success', [ 'Models Have been installed successfully.' => $this->installer->getErrors() ] );
|
|
||||||
return $this->nextStep( 'plugins', true );
|
|
||||||
}
|
|
||||||
} elseif ( Input::exists( 'submit' ) ) {
|
|
||||||
Issues::add( 'error', [ 'There was an error with your form.' => Check::userErrors() ] );
|
|
||||||
}
|
|
||||||
Views::view( 'install.models', $models );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This step will allow the user to install any plugins currently available for installing excluding resources.
|
|
||||||
*/
|
|
||||||
public function plugins() {
|
|
||||||
$errors = [];
|
|
||||||
$options = [ 'resources_installed' => false ];
|
|
||||||
$plugins = $this->installer->getAvailablePlugins();
|
|
||||||
$selected_plugins = Input::post( 'P_' );
|
|
||||||
|
|
||||||
if ( Input::exists( 'submit' ) && Forms::Check( 'installPlugins' ) ) {
|
|
||||||
$error = false;
|
|
||||||
foreach ( $plugins as $plugin ) {
|
|
||||||
if ( ! in_array( $plugin->name, $selected_plugins ) ) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$result = $this->installer->installPlugin( $plugin, $options );
|
|
||||||
|
|
||||||
if ( !$result ) {
|
|
||||||
$error = true;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
Plugin::enable( $plugin->name, true );
|
|
||||||
}
|
|
||||||
if ( $error ) {
|
|
||||||
Issues::add( 'error', ['There was an error with the Installation.' => $this->installer->getErrors()] );
|
|
||||||
} else {
|
|
||||||
Session::flash( 'success', [ 'Plugins Have been installed successfully.' => $this->installer->getErrors() ] );
|
|
||||||
return $this->nextStep( 'resources', true );
|
|
||||||
}
|
|
||||||
} elseif ( Input::exists( 'submit' ) ) {
|
|
||||||
Issues::add( 'error', ['There was an error with your form.' => Check::userErrors()] );
|
|
||||||
}
|
|
||||||
Views::view( 'install.plugins', $plugins );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The resource step will cycle through the partially installed models and install any missing resources.
|
|
||||||
*/
|
|
||||||
public function resources() {
|
|
||||||
$errors = [];
|
|
||||||
if ( Input::exists( 'submit' ) && Forms::Check( 'installResources' ) ) {
|
|
||||||
$error = false;
|
|
||||||
$allModules = $this->installer->getModules(true);
|
|
||||||
foreach ( $allModules as $name => $module ) {
|
|
||||||
if ( empty( $module ) || 'unknown' === $name || empty( $name ) || empty( $module['installedVersion'] ) ) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( 'plugin' == $module['type'] ) {
|
|
||||||
$installResult = $this->installer->installPlugin( (object) $module, [ 'resources_installed' => true ], false );
|
|
||||||
} else {
|
|
||||||
$installResult = $this->installer->installModel( (object) $module, [ 'installResources' => true ], false );
|
|
||||||
}
|
|
||||||
if ( !$installResult ) {
|
|
||||||
$error = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ( $error ) {
|
|
||||||
Issues::add( 'error', ['There was an error with the Installation.' => $this->installer->getErrors()] );
|
|
||||||
} else {
|
|
||||||
Session::flash( 'success', ['Resources have been installed successfully.' => $this->installer->getErrors()] );
|
|
||||||
return $this->nextStep( 'user', true );
|
|
||||||
}
|
|
||||||
} elseif ( Input::exists( 'submit' ) ) {
|
|
||||||
Issues::add( 'error', ['There was an error with your form.' => Check::userErrors()] );
|
|
||||||
}
|
|
||||||
Views::view( 'install.resources' );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is the registration step; allowing the installer to create the super admin account.
|
|
||||||
*/
|
|
||||||
public function user() {
|
|
||||||
if ( Input::exists( 'submit' ) && Forms::Check( 'installAdminUser' ) ) {
|
|
||||||
$user = new User();
|
|
||||||
if ( !$user->create( [
|
|
||||||
'username' => Input::post( 'newUsername' ),
|
|
||||||
'password' => Hash::make( Input::post( 'userPassword' ) ),
|
|
||||||
'email' => Input::post( 'userEmail' ),
|
|
||||||
'lastLogin' => time(),
|
|
||||||
'registered' => time(),
|
|
||||||
'confirmed' => 1,
|
|
||||||
'terms' => 1,
|
|
||||||
'userGroup' => 1,
|
|
||||||
] ) ) {
|
|
||||||
Issues::add( 'error', 'There was an error creating the admin user.' );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$this->nextStep( 'complete' );
|
|
||||||
return $this->complete( true );
|
|
||||||
} elseif ( Input::exists( 'submit' ) ) {
|
|
||||||
Issues::add( 'error', ['There was an error with your form.' => Check::userErrors()] );
|
|
||||||
}
|
|
||||||
Views::view( 'install.adminUser' );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is the final step of installation. On first load it will send an email and show the final view.
|
|
||||||
* It will then redirect to the index controller and prompt the user to delete this file on any subsequent loads.
|
|
||||||
*
|
|
||||||
* @param bool $sendEmail
|
|
||||||
*/
|
|
||||||
public function complete( $sendEmail = false ) {
|
|
||||||
if ( $sendEmail ) {
|
|
||||||
Issues::add( 'success', 'The Tempus Project has been installed successfully.' );
|
|
||||||
Email::send( Input::post( 'email' ), 'install', null, [ 'template' => true ] );
|
|
||||||
return Views::view( 'install.complete' );
|
|
||||||
}
|
|
||||||
Session::flash( 'notice', 'Installation has been completed. Updates and installation can be managed in the admin panel. Please delete the install.php file.' );
|
|
||||||
Redirect::to( 'home/index' );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$app = new TheTempusProject();
|
|
||||||
$app->setUrl( 'install/index' );
|
|
||||||
$app->load();
|
|
||||||
exit;
|
|
@ -7,8 +7,8 @@
|
|||||||
"background_color": "#7d7f83",
|
"background_color": "#7d7f83",
|
||||||
"theme_color": "#3fa9f5",
|
"theme_color": "#3fa9f5",
|
||||||
"icons": [
|
"icons": [
|
||||||
{ "src": "/images/logoWhite192.png", "type": "image/png", "sizes": "192x192" },
|
{ "src": "/images/logo192.png", "type": "image/png", "sizes": "192x192" },
|
||||||
{ "src": "/images/logoWhite512.png", "type": "image/png", "sizes": "512x512" },
|
{ "src": "/images/logo512.png", "type": "image/png", "sizes": "512x512" },
|
||||||
{ "src": "/images/icon-mask.png", "type": "image/png", "sizes": "512x512", "purpose": "maskable" }
|
{ "src": "/images/icon-mask.png", "type": "image/png", "sizes": "512x512", "purpose": "maskable" }
|
||||||
],
|
],
|
||||||
"screenshots": [
|
"screenshots": [
|
||||||
|
Reference in New Issue
Block a user