fix user roles to always return from session, even when empty (to save repeat lookups) * change Model authenticate_user method name to validate_user_credentials to avoid confusion with inbuilt DPAE method * recovered ordering on grouped data for mysql db queries (not for sqlite) * app only loads 1 Routes file so all requests handled by same file, routes.t loads 2 routes so ajax call doesn't need login and to demonstrate how to run 2 apps with .psgi script
fix app to work properly with app.psgi as command-line or apache: * moved ajax route back to Routes::AJAX * Routes & Routes::AJAX load private instances of Reporter.pm, no longer shared * moved dbname logic from 2 routes files to Reporter dbname builder so only happens once in app routes.t uses Plack::Builder for app, same as app.psgi
fix ajax calls when app running from app.psgi * dance() deprecated in favour of to_app() * but to_app() didn't load Routes::AJAX routes so couldn't find ajax_get_diagnoses route * see bin/app.psgi.readme * modifying app.psgi to use Plack::Builder fixed it but not when used by Apache (which used bin/app.pl->dance) * recurrent problems with separate AJAX route so combined the only 1 into main Routes file, prefixed as '/ajax' * separated test schema into its own file and separated reports.t into routes.t & model.t * change reporter.fgci (Apache script) to use bin/app.psgi (->to_app)
fix authentication using DPAE::DB * re-writing user profile into session after loading roles replaced draft_report_users.id with users.id so previous reports did not load (expects draft_report_users.id) - now adding roles to existing user-profile * replace mysql-specific functions with sqlite-compatible equivalents * new reports.t for testing model functions and user authentication * fix main.tt error - loaded /register link because an empty grep is true
replace Config DPAE provider with database provider; had to adjust Data::Printer alias in Routes to avoid errors due to possible clash with another package
include password in call to DPAE authenticate_user() - something changed in DPAE so that password now required for authentication to get logged_in_user & logged_in_user_realm session entries
moved paginator code into own sub; separated model get_report_counts into own sub, using new count() method in Local::DB; new config item paginator.siblings; general code tidy
added authentication function using D2::Plugin::Auth::Extensible; new admin function to register new user; removed GET /login route - using auto_page()