Upgrading Bonfire

0.8.4 to 0.8.5

Neither 0.8.4 and now 0.8.5 have been made available to github – my bad, just that I do not have the time to learn how to pull and merge what I have done with the original branch. I have had good intentions here (really!) but there are so many projects I'm supporting that need my attention and family also needs a bit of me on occasions.

I have looked at CI 4.x and even installed it twice, however it still lacks the bits I like from Bonfire thus haven't taken the plunge. At this time I can roll up a new site with a new template in weeks, something I could not do with CI 4.

The internet world I interact with is still under siege from those trying to hack all and sundry, one of my projects has sensitive customer data and I do not want anyone, other than those authorised, to gain access. Thus this release is all about introducing 2FA/MFA.

This release now also supports CI 3.11 and PHP 7.3, thus some of the changes below relate to this.

Summary of items / files changed:

/bonfire/

c13/core/Input.php - deal with cookie samesite parameter
    /Security.php - sort out cookie samesite parameter

ci3/helpers/address_helper.php - add location_select()  
    - add location_abbr_to_name()   
    - add location_name_to_abbr()

        /cookie_helper.php - deal with samesite     

ci3/libraries/Session/Session_driver.php - add array[] for cookie options
        /Session.php -  add array[] for cookie options

modules/activities/controllers/Reports.php - change error to danger 

    /builder/controllers/developer.php - change error to danger
        /views/developer/modulebuilder_form.php - change error to danger
              /files/controller.php - change error to danger

    /database/controllers/Developer.php - change error to danger

    /docs/controllers/Docs.php - change error to danger

    /emailer/controllers/Settings.php - change error to danger
            /views/email/_footer.php - change copyright date

    /logs/controllers/Developer.php - change error to danger

    /migrations/config/config.php - bump version to 0.8.5
                /controllers/Developer.php - change error to danger
                /views/developer/index.php - change from nav-tabs to nav-pills

    /permissions/controllers/Settings.php - change error to danger

    /roles/config/config.php - bump version to 0.8.5
            /controllers/Settings.php - change error to danger
            /docs/developer/index.md - introduces 2FA items
            /language/english/roles_lang.php = role mandatory 2FA added
            /models/Role_model.php - mandatory 2FA - also force for admin role
            /views/settings/index.php - mandatory 2FA
                            /role_form.php - mandatory 2FA radio buttons
                    /controllers/Settings.php - change error to danger plus array items for 2FA
                    /views/settings/index.php - change default country, state and add location
                                    /index/extended.php - integrate location / state keyed.
                                          /security.php - 2FA stuff

    /sysinfo/config/config.php - bump version to 0.8.5
        /controllers/Developer.php - fix html
        /views/developer/php_info.php - fix html    

    /translate/controllers/Developer.php - change error to danger

    /ui/controllers/Settings.php - change error to danger

    /users/config/config.php - bump version to 0.8.5
        /controllers/Settings.php - change error to danger, 2FA logic, QR code
                        /Users.php - lots of 2FA logic
        /language/english/users_lang.php - 2FA and other interaction phrases.
        /libraries/Auth.php - 2FA logic
                    /GoogleAuthenticator.php - methods from google to calculate 2FA 
                        - plan to change this, but it was an easy start.
        /models/User_model.php - 2FA stuff
        /views/activate.php, 
                forgot_password.php, 
                login.php, 
                profile.php, 
                register.php, 
                resend_activation.php, 
                reset_password.php, 
                state_location.php, 
                twoFA.php, 
                user_fields.php, 
                user_meta.php
                    - misc changes to work and display better with the templates I use      
            /settings/user_form.php - show the QR code              
Profiler
Profiler Console 0 Load Time 14.8ms Memory Used 0.87 MB Database 5 Queries vars & Config Files 89

Console

Memory Usage

Benchmarks

2 ms Loading Time: Base Classes
9 ms Controller Execution Time ( Docs / Index )
15 ms Total Execution Time

Queries

0.0005 SHOW TABLES FROM `bonfire`
0.0002 SELECT * FROM `bf_users`Speed: 0.0002 - Possible keys: - Key Used: - Type: ALL - Rows: 4 - Extra:
0.0002 SELECT GET_LOCK('2478115e6eeefe297bd578c9a8b2ca53', 300) AS ci_session_lockSpeed: 0.0002 - Possible keys: - Key Used: - Type: - Rows: - Extra: No tables used
0.0004 SELECT `data` FROM `bf_ci_sessions` WHERE `id` = 'gvpjbku274f02aal8jdfq2pbpaolojh1' and `ip_address` = '44.192.65.228'Speed: 0.0004 - Possible keys: - Key Used: - Type: - Rows: - Extra: Impossible WHERE noticed after reading const tables
0.0001 SELECT * FROM `bf_settings`Speed: 0.0001 - Possible keys: - Key Used: - Type: ALL - Rows: 42 - Extra:
0.0014 Total Query Execution Time

Session User Data

__ci_last_regenerate 1657067267
requested_page https://robkampen.com/docs/developer/upgrade/085
previous_page https://robkampen.com/docs/developer/upgrade/085

GET DATA

No GET data exists

POST DATA

No POST data exists

URI STRING

docs/developer/upgrade/085

CLASS/METHOD

docs/index

HTTP HEADERS

HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_USER_AGENT CCBot/2.0 (https://commoncrawl.org/faq/)
HTTP_CONNECTION Keep-Alive
SERVER_PORT 443
SERVER_NAME robkampen.com
REMOTE_ADDR 44.192.65.228
SERVER_SOFTWARE Apache/2.4.41 (Ubuntu)
HTTP_ACCEPT_LANGUAGE en-US,en;q=0.5
SCRIPT_NAME /index.php
REQUEST_METHOD GET
HTTP_HOST
REMOTE_HOST
CONTENT_TYPE
SERVER_PROTOCOL HTTP/1.1
QUERY_STRING
HTTP_ACCEPT_ENCODING br,gzip
HTTP_X_FORWARDED_FOR

CONFIG VARIABLES

domain robkampen.com
base_url https://robkampen.com
index_page
uri_protocol AUTO
url_suffix
language english
charset UTF-8
enable_hooks true
subclass_prefix MY_
composer_autoload false
permitted_uri_chars a-z 0-9~%.:_-
allow_get_array true
enable_query_strings false
controller_trigger c
function_trigger m
directory_trigger d
log_threshold 2
log_path /var/www/htdocs/robkampen/application/logs/
log_file_extension
log_file_permissions 436
log_date_format Y-m-d H:i:s
error_views_path
cache_path /var/www/htdocs/robkampen/application/cache/
cache_query_string false
encryption_key 92b35b02920621aedbed3b8b9a68c0f1
sess_cookie_name bf_session
sess_expiration 7200
sess_time_to_update 300
sess_match_ip true
sess_driver database
sess_regenerate_destroy false
sess_save_path ci_sessions
cookie_prefix
cookie_domain robkampen.com
cookie_path /
cookie_secure false
cookie_httponly false
cookie_samesite Strict
standardize_newlines false
csrf_protection true
csrf_token_name ci_csrf_token
csrf_cookie_name ci_csrf_token
csrf_expire 7200
csrf_regenerate true
csrf_exclude_uris Array ( )
compress_output false
time_reference local
rewrite_short_tags false
proxy_ips
bonfire.installed 0
site.default_user_timezone UP12
modules_locations Array ( [/var/www/htdocs/robkampen/application/modules/] => ../../application/modules/ [/var/www/htdocs/robkampen/bonfire/modules/] => ../../bonfire/modules/ )
site.backup_folder archives/
contexts Array ( [0] => content [1] => reports [2] => settings [3] => developer )
enable_activity_logging true
sparks_path ../sparks/
template.site_path /var/www/htdocs/robkampen/public/
template.theme_paths Array ( [0] => themes )
template.default_layout index
template.ajax_layout ajax
template.use_mobile_themes false
template.default_theme default/
template.admin_theme admin
template.message_template <div class="alert alert-{type} alert-dismissable"> <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> <div>{message}</div> </div>
template.breadcrumb_symbol :
template.parse_views false
assets.directories Array ( [base] => assets [cache] => cache [css] => css [image] => images [js] => js [module] => module )
assets.js_opener $(document).ready(function() {
assets.js_closer });
assets.css_combine false
assets.js_combine false
assets.css_minify true
assets.js_minify true
assets.encrypt_name false
assets.encode false
assets.base_folder assets
assets.asset_folders Array ( [css] => css [js] => js [image] => images )
ui.current_shortcuts Array ( [form_save] => Array ( [description] => Save any form in the admin area. [action] => $("input[name=save]").click();return false; ) [create_new] => Array ( [description] => Create a new record in the module. [action] => window.location.href=$("a#create_new").attr("href"); ) [select_all] => Array ( [description] => Select all records in an index page. [action] => $("table input[type=checkbox]").click();return false; ) [delete] => Array ( [description] => Delete the record(s). [action] => $("#delete-me.btn-danger").click(); ) [module_index] => Array ( [description] => Return to the index of the current module. [action] => window.location.href=$("a#list").attr("href"); ) [goto_content] => Array ( [description] => Jump to the Content context. [action] => window.location.href=$("#tb_content").attr("href") ) [goto_reports] => Array ( [description] => Jump to the Reports context. [action] => window.location.href=$("#tb_reports").attr("href") ) [goto_settings] => Array ( [description] => Jump to the Settings context. [action] => window.location.href=$("#tb_settings").attr("href") ) [goto_developer] => Array ( [description] => Jump to the Developer context. [action] => window.location.href=$("#tb_developer").attr("href") ) )
emailer.write_to_file false
migrate.auto_core false
migrate.auto_app false
commonmark.valid_drivers Array ( [0] => Parsedown [1] => Markdown [2] => MarkdownExtra [3] => LeagueCommonMark )
commonmark.driver MarkdownExtended
docs.theme docs
docs.default_group developer
docs.show_dev_docs true
docs.show_app_docs true
docs.toc_file _toc.ini
docs.permitted_environments Array ( [0] => development [1] => testing [2] => production )

Files

application.php
/var/www/htdocs/robkampen/application/config/application.php
autoload.php
/var/www/htdocs/robkampen/application/config/autoload.php
config.php
/var/www/htdocs/robkampen/application/config/config.php
constants.php
/var/www/htdocs/robkampen/application/config/constants.php
database.php
/var/www/htdocs/robkampen/application/config/database.php
events.php
/var/www/htdocs/robkampen/application/config/events.php
hooks.php
/var/www/htdocs/robkampen/application/config/hooks.php
installer_lib.php
/var/www/htdocs/robkampen/application/config/installer_lib.php
mimes.php
/var/www/htdocs/robkampen/application/config/mimes.php
profiler.php
/var/www/htdocs/robkampen/application/config/profiler.php
routes.php
/var/www/htdocs/robkampen/application/config/routes.php
Base_Controller.php
/var/www/htdocs/robkampen/application/core/Base_Controller.php
MY_Model.php
/var/www/htdocs/robkampen/application/core/MY_Model.php
App_hooks.php
/var/www/htdocs/robkampen/application/hooks/App_hooks.php
application_lang.php
/var/www/htdocs/robkampen/application/language/english/application_lang.php
Profiler.php
/var/www/htdocs/robkampen/application/libraries/Profiler.php
Base.php
/var/www/htdocs/robkampen/application/third_party/MX/Base.php
Config.php
/var/www/htdocs/robkampen/application/third_party/MX/Config.php
Controller.php
/var/www/htdocs/robkampen/application/third_party/MX/Controller.php
Lang.php
/var/www/htdocs/robkampen/application/third_party/MX/Lang.php
Loader.php
/var/www/htdocs/robkampen/application/third_party/MX/Loader.php
Benchmark.php
/var/www/htdocs/robkampen/bonfire/ci3/core/Benchmark.php
CodeIgniter.php
/var/www/htdocs/robkampen/bonfire/ci3/core/CodeIgniter.php
Common.php
/var/www/htdocs/robkampen/bonfire/ci3/core/Common.php
Config.php
/var/www/htdocs/robkampen/bonfire/ci3/core/Config.php
Controller.php
/var/www/htdocs/robkampen/bonfire/ci3/core/Controller.php
Hooks.php
/var/www/htdocs/robkampen/bonfire/ci3/core/Hooks.php
Input.php
/var/www/htdocs/robkampen/bonfire/ci3/core/Input.php
Lang.php
/var/www/htdocs/robkampen/bonfire/ci3/core/Lang.php
Loader.php
/var/www/htdocs/robkampen/bonfire/ci3/core/Loader.php
Log.php
/var/www/htdocs/robkampen/bonfire/ci3/core/Log.php
Model.php
/var/www/htdocs/robkampen/bonfire/ci3/core/Model.php
Output.php
/var/www/htdocs/robkampen/bonfire/ci3/core/Output.php
Router.php
/var/www/htdocs/robkampen/bonfire/ci3/core/Router.php
Security.php
/var/www/htdocs/robkampen/bonfire/ci3/core/Security.php
URI.php
/var/www/htdocs/robkampen/bonfire/ci3/core/URI.php
Utf8.php
/var/www/htdocs/robkampen/bonfire/ci3/core/Utf8.php
hash.php
/var/www/htdocs/robkampen/bonfire/ci3/core/compat/hash.php
mbstring.php
/var/www/htdocs/robkampen/bonfire/ci3/core/compat/mbstring.php
password.php
/var/www/htdocs/robkampen/bonfire/ci3/core/compat/password.php
standard.php
/var/www/htdocs/robkampen/bonfire/ci3/core/compat/standard.php
DB.php
/var/www/htdocs/robkampen/bonfire/ci3/database/DB.php
DB_driver.php
/var/www/htdocs/robkampen/bonfire/ci3/database/DB_driver.php
DB_query_builder.php
/var/www/htdocs/robkampen/bonfire/ci3/database/DB_query_builder.php
DB_result.php
/var/www/htdocs/robkampen/bonfire/ci3/database/DB_result.php
mysqli_driver.php
/var/www/htdocs/robkampen/bonfire/ci3/database/drivers/mysqli/mysqli_driver.php
mysqli_result.php
/var/www/htdocs/robkampen/bonfire/ci3/database/drivers/mysqli/mysqli_result.php
directory_helper.php
/var/www/htdocs/robkampen/bonfire/ci3/helpers/directory_helper.php
form_helper.php
/var/www/htdocs/robkampen/bonfire/ci3/helpers/form_helper.php
language_helper.php
/var/www/htdocs/robkampen/bonfire/ci3/helpers/language_helper.php
url_helper.php
/var/www/htdocs/robkampen/bonfire/ci3/helpers/url_helper.php
profiler_lang.php
/var/www/htdocs/robkampen/bonfire/ci3/language/english/profiler_lang.php
Cache.php
/var/www/htdocs/robkampen/bonfire/ci3/libraries/Cache/Cache.php
Cache_dummy.php
/var/www/htdocs/robkampen/bonfire/ci3/libraries/Cache/drivers/Cache_dummy.php
Driver.php
/var/www/htdocs/robkampen/bonfire/ci3/libraries/Driver.php
CI_Session_driver_interface.php
/var/www/htdocs/robkampen/bonfire/ci3/libraries/Session/CI_Session_driver_interface.php
OldSessionWrapper.php
/var/www/htdocs/robkampen/bonfire/ci3/libraries/Session/OldSessionWrapper.php
Session.php
/var/www/htdocs/robkampen/bonfire/ci3/libraries/Session/Session.php
Session_driver.php
/var/www/htdocs/robkampen/bonfire/ci3/libraries/Session/Session_driver.php
Session_database_driver.php
/var/www/htdocs/robkampen/bonfire/ci3/libraries/Session/drivers/Session_database_driver.php
BF_Loader.php
/var/www/htdocs/robkampen/bonfire/core/BF_Loader.php
BF_Router.php
/var/www/htdocs/robkampen/bonfire/core/BF_Router.php
BF_directory_helper.php
/var/www/htdocs/robkampen/bonfire/helpers/BF_directory_helper.php
BF_form_helper.php
/var/www/htdocs/robkampen/bonfire/helpers/BF_form_helper.php
application_helper.php
/var/www/htdocs/robkampen/bonfire/helpers/application_helper.php
config_file_helper.php
/var/www/htdocs/robkampen/bonfire/helpers/config_file_helper.php
markdown_extended_helper.php
/var/www/htdocs/robkampen/bonfire/helpers/markdown_extended_helper.php
markdown_helper.php
/var/www/htdocs/robkampen/bonfire/helpers/markdown_helper.php
Assets.php
/var/www/htdocs/robkampen/bonfire/libraries/Assets.php
BF_Model.php
/var/www/htdocs/robkampen/bonfire/libraries/BF_Model.php
CommonMark.php
/var/www/htdocs/robkampen/bonfire/libraries/CommonMark.php
CommonMarkDriver.php
/var/www/htdocs/robkampen/bonfire/libraries/CommonMark/CommonMarkDriver.php
CommonMark_MarkdownExtended.php
/var/www/htdocs/robkampen/bonfire/libraries/CommonMark/drivers/CommonMark_MarkdownExtended.php
Console.php
/var/www/htdocs/robkampen/bonfire/libraries/Console.php
Events.php
/var/www/htdocs/robkampen/bonfire/libraries/Events.php
Installer_lib.php
/var/www/htdocs/robkampen/bonfire/libraries/Installer_lib.php
Modules.php
/var/www/htdocs/robkampen/bonfire/libraries/Modules.php
Route.php
/var/www/htdocs/robkampen/bonfire/libraries/Route.php
Template.php
/var/www/htdocs/robkampen/bonfire/libraries/Template.php
docs.php
/var/www/htdocs/robkampen/bonfire/modules/docs/config/docs.php
routes.php
/var/www/htdocs/robkampen/bonfire/modules/docs/config/routes.php
Docs.php
/var/www/htdocs/robkampen/bonfire/modules/docs/controllers/Docs.php
docs_lang.php
/var/www/htdocs/robkampen/bonfire/modules/docs/language/english/docs_lang.php
_sidebar.php
/var/www/htdocs/robkampen/bonfire/modules/docs/views/_sidebar.php
index.php
/var/www/htdocs/robkampen/bonfire/modules/docs/views/index.php
Settings_lib.php
/var/www/htdocs/robkampen/bonfire/modules/settings/libraries/Settings_lib.php
Settings_model.php
/var/www/htdocs/robkampen/bonfire/modules/settings/models/Settings_model.php
index.php
index.php
index.php
themes/docs/index.php