Contao\BackendIndex::__construct PHP Method

__construct() public method

1. Import the user 2. Call the parent constructor 3. Login the user 4. Load the language files DO NOT CHANGE THIS ORDER!
public __construct ( )
    public function __construct()
    {
        $this->import('BackendUser', 'User');
        parent::__construct();
        // Login
        if ($this->User->login()) {
            $strUrl = 'contao/main.php';
            // Redirect to the last page visited
            if (\Input::get('referer', true) != '') {
                $strUrl = base64_decode(\Input::get('referer', true));
            }
            $this->redirect($strUrl);
        } elseif (!empty($_POST['username']) && !empty($_POST['password'])) {
            $this->reload();
        } elseif ($this->User->logout()) {
            $this->reload();
        }
        \System::loadLanguageFile('default');
        \System::loadLanguageFile('tl_user');
    }
BackendIndex