Commit graph

39 commits

Author SHA1 Message Date
Belle Aerni 23e8b18ba3
Implemented multi-user support (#27)
* Implemented rudimentary multi-user support

* Delete src.zip

* Improve the update user function

And added a new function to the auth module to invalidate a session

* Update AntAuth.php

* Rename the configs, a bit more auth stuff

* Fix test and JS regex

* Turn the admin landing page into a twig template

* plugin/admin/ -> admin/

* Refactored templating for plugins

Plus. I finally converted the remaining options in the admin plugin to twig templates. No extra styling, but it'll be easier now

* Fix PHPStan warnings

* Basic "first time" user setup

* Improved styling

* Started implementing user management

* Completed user management in the admin panel

* Renamed templates, added support for sub-dirs

* Limit and validate allowed chars for usernames

* Finished the basics of the profile plugin

* Styling for the bootstrap theme

* Some more final touches

* Added an example to show author

* Tweak to the readme
2023-03-07 02:09:32 -08:00
Belle Aerni 25e1ef9434 Started creating templates for the admin plugin
Also, replaced the old <!--AntCMS-SiteLink--> with a new filter called absUrl, which can be used to convert any link to an absolute URL by adding the base site URL
2023-02-12 17:02:07 -08:00
Belle Aerni 9eb24fee30 First try to render exceptions using twig 2023-01-28 20:54:53 -08:00
Belle Aerni af375a5499 Code styling /w Rector 2023-01-25 22:08:19 -08:00
Belle Aerni e1667b6374 Use actual twig variables for the page body
Replaces <!--AntCMS-Body--> with {{ AntCMSBody | raw }}
2023-01-25 21:32:38 -08:00
Belle Aerni e2ca10d51d Made exception rendering more flexible 2023-01-25 18:45:36 -08:00
Belle Aerni 95ed5059f0 Cleaned up the code a bit 2023-01-24 17:48:40 -08:00
Belle Aerni ecf94d36da Removed the keyword generator
It didn't really work, added a bunch to the overall file size, and computer-generated keywords just won't compare to human created ones, unless you're to use AI or a particularly advanced algorithm, which I feel is outside the scope of the project.

I've left the class in place, so if needed, it'll be really easy to add it back
2023-01-19 18:01:03 -08:00
Belle Aerni 97e6a8a4e6 Make renderWithTiwg a static function
There's zero need to create a new instance of the class before calling it, so this removes a very small amount of overhead, but more importantly removes the need to create and define a new class of it each time, which makes the code very slightly cleaner
2023-01-19 15:07:15 -08:00
Belle Aerni ff9583bfdf
Rector (#19)
* Rector code quality run

* Ran Rector with coding style ruleset

* Ran Rector with the naming setlist
2023-01-14 20:44:27 -08:00
Belle Aerni 44de365946 Fix header regex (again) 2023-01-13 01:18:43 -08:00
Belle Aerni 4f96f5c496 Highlight the active page in the navbar
Closes #6

Also dropped PHPStan back down to level 5 because I decided level 6 was a bit much
2023-01-12 19:08:35 -08:00
Belle Aerni 325221f527 Quick run with Rector 2023-01-12 00:20:13 -08:00
Belle Aerni a2f8c3617a Slightly cleanup auth + enable CGIPassAuth
Should hopefully fix any issues with CGI servers.
Also renamed the 'SiteInfo' config key to 'siteInfo' to follow the naming scheme for everything else
2023-01-11 19:30:34 -08:00
Belle Aerni 891012f6ff Fixed AntCMS matching the page header multiple times 2023-01-11 14:07:39 -08:00
Belle Aerni 7adb5d51a6 Added missing type hints, bumped PHPStan to level 6 2023-01-10 18:20:24 -08:00
Belle Aerni c15bf1f449 Refactor AntConfig::currentConfig 2023-01-10 17:24:30 -08:00
Belle Aerni da69eb3f81 Updated file extension to .twig 2023-01-10 06:32:51 -08:00
Belle Aerni cb0a1917a9 Update admin plugin to render with twig 2023-01-10 00:26:05 -08:00
Belle Aerni 2a1af73f75 Use the .twig file extension 2023-01-10 00:07:20 -08:00
Belle Aerni fa1d942d4e Started to migrate to twig 2023-01-09 12:50:11 -08:00
Belle Aerni b60439a9a9 Tests
Test, tests, baby (insert sounds from ice, ice, baby)
2023-01-09 10:47:55 -08:00
Belle Aerni 6d3f8a3da1 Admin plugin : added create page option
Also introduced AntTools::repairFilePath
2023-01-08 16:53:58 -08:00
Belle Aerni d6588573b0 Fallback to the default theme
if the configured one doesn't exist, fallback to "Default"
2023-01-08 15:47:23 -08:00
Belle Aerni f5844cb2cc Rewrote to server content through index.php 2023-01-07 17:44:16 -08:00
Belle Aerni b953821dd2 Add template fallbacks. Closes #2
Also improved slightly the keyword generator, and added npm to dependabot scanning
2023-01-07 13:35:14 -08:00
Belle Aerni a36755bb80 Improved caching 2023-01-07 12:15:29 -08:00
Yağızhan ce656562e9 Check the description
- Separated the part that generates the page layout into a new function.
- What we did above allowed us to use the page layout for pages that aren't meant to be loaded from local Markdown files, such as the error pages
- This allowed us to create a better error page. The new error page uses the theme's default layout, resulting in better error pages.
2023-01-07 17:41:17 +03:00
Yağızhan 5562f9b676 Allow defining what theme to get the content of 2023-01-07 17:25:12 +03:00
Yağızhan d153dc9a46 Moved the templates to their own folders 2023-01-07 13:49:47 +03:00
Belle Aerni 60633f11e0 Action to publish previews 2023-01-07 02:20:29 -08:00
Belle Aerni d3798cceca Move nav layout to it's own file 2023-01-07 02:02:51 -08:00
Belle Aerni 2fc2775720 Slightly better theming support 2023-01-07 01:28:04 -08:00
Belle Aerni 28ca1b87e4 Add PHPStan 2023-01-06 18:25:28 -08:00
Belle Aerni ceea75b233 Messed around a bit with the page template 2023-01-06 17:47:03 -08:00
Belle Aerni 622f99adff Rudimentary navigation generation 2023-01-06 17:09:55 -08:00
Belle Aerni 7ab664e18f Automated page list generation 2023-01-06 16:16:11 -08:00
Belle Aerni bb5da2fc50 Added support for index pages 2023-01-06 15:17:31 -08:00
Belle Aerni d6e4338689 Created an autoloader 2023-01-06 13:40:02 -08:00
Renamed from src/AntCMS/App.php (Browse further)