Welcome Guest, Not a member yet? Register   Sign In
Bonfire 2 Site Offline
#1
Tongue 

While experimenting with 'Bonfire 2,' I intentionally took the website offline and logged out from the superadmin account. Consequently, I currently find myself unable to access the login screen through any other means.
Given that every URL undergoes initial sanitization by the 'online' filter, I am faced with the challenge of restoring my website to an online state. What steps should I take to rectify this situation?
This is part of OnlineCheck.php filter.
PHP Code:
public function before(RequestInterface $request$arguments null)
    {
        helper(['setting''auth']);
        if (setting('Site.siteOnline') === null) {
            $user auth()->user();

            if (
                $user === null || (
                    $user !== null
                    
&& !$user->inGroup('superadmin')
                    && !$user->hasPermission('site.viewOffline')
                )
            ) {
                return redirect()->to('/site-offline');
            }
        }
    

I'm curious if there's a way to bypass the current filter checks with a specific link or method.

Thanks in advance everyone Smile
Learning Codeigniter 
Reply
#2

Bonfire uses the Settings library:

Quote:CodeIgniter Settings is a wrapper around the configuration files that allows any configuration setting to saved to the database, while defaulting to the config files when not custom value has been stored.

I think you should be able to access the login screen, but a quick hack will be to the configuration details directly from your database. Do the following:
  1. Go to the settings table
  2. Look for the row with the column (class) of Site and the column (key) of siteOnline.
Reply
#3

If you can use CLI, create a Spark command to change the config value.
https://codeigniter4.github.io/CodeIgnit...mands.html
Reply




Theme © iAndrew 2016 - Forum software by © MyBB